From 59692f8b9fa2b71711de78d07f031c4866024da4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 May 2019 12:18:15 +0200 Subject: Remove order dependence in ad hoc group handling Also, don't match group_recipe since we neither execute nor access the state. --- build2/algorithm.ixx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'build2/algorithm.ixx') 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); -- cgit v1.1