aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-14 12:32:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-14 14:53:51 +0200
commita523eb1b8b74a577e7ff0aa3fce4312acd4b3a75 (patch)
tree3cac12cad917eccfe8fffb57c7279f2d09bde0ca /build2/algorithm.ixx
parent8a7b3bb944ca08d240fc778a9269c6db0f9746f8 (diff)
Redo library meta-information protocol without match_only()
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx15
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)
{