diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-05-13 12:18:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-05-13 12:18:15 +0200 |
commit | 59692f8b9fa2b71711de78d07f031c4866024da4 (patch) | |
tree | 49962a069bbfcc424a19a524b223f7f82566f8c8 /build2/algorithm.ixx | |
parent | cff78d388133e50d4b930915ae0bb2d0cafe1248 (diff) |
Remove order dependence in ad hoc group handling
Also, don't match group_recipe since we neither execute nor access the
state.
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r-- | build2/algorithm.ixx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index a01ee58..0150587 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -7,14 +7,6 @@ namespace build2 { - inline const target* - find_adhoc_member (const target& t, const target_type& tt) - { - const target* m (t.member); - for (; m != nullptr && !m->is_a (tt); m = m->member) ; - return m; - } - inline const target& search (const target& t, const prerequisite& p) { @@ -241,19 +233,35 @@ namespace build2 } inline target_lock - add_adhoc_member (action a, target& t, const target_type& tt, const char* s) + add_adhoc_member (action a, target& t, const target_type& tt, const char* e) { string n (t.name); - if (s != nullptr) + if (e != nullptr) { n += '.'; - n += s; + n += e; } return add_adhoc_member (a, t, tt, t.dir, t.out, n); } + inline target* + find_adhoc_member (target& g, const target_type& tt) + { + target* m (g.member); + for (; m != nullptr && !m->is_a (tt); m = m->member) ; + return m; + } + + inline const target* + find_adhoc_member (const target& g, const target_type& tt) + { + const target* m (g.member); + for (; m != nullptr && !m->is_a (tt); m = m->member) ; + return m; + } + const rule_match* match_impl (action, target&, const rule* skip, bool try_match = false); |