diff options
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r-- | build2/algorithm.ixx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index 6bc310f..6bbe4bb 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -63,7 +63,7 @@ namespace build2 pair<const rule*, match_result> match_impl (slock&, action, target&, bool apply, const rule* skip = nullptr); - inline void + inline bool match (slock& ml, action a, target& t) { assert (phase == run_phase::search_match); @@ -71,10 +71,12 @@ namespace build2 if (!t.recipe (a)) match_impl (ml, a, t, true); - t.dependents.fetch_add (1, std::memory_order_release); dependency_count.fetch_add (1, std::memory_order_release); + bool r (t.dependents++ != 0); // Safe if someone else is also a dependent. // text << "M " << t << ": " << t.dependents << " " << dependency_count; + + return r; } inline void @@ -94,15 +96,6 @@ namespace build2 #endif } - inline void - match_only (slock& ml, action a, target& t) - { - assert (phase == run_phase::search_match); - - if (!t.recipe (a)) - match_impl (ml, a, t, false); - } - inline pair<recipe, action> match_delegate (slock& ml, action a, target& t, const rule& r) { |