aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-27 15:25:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:41 +0200
commitf93038fbee1631b95922b0742e0fd00fa8dae02e (patch)
tree6fe67cbde528ee8ded490085b9a8d5adc0ce5aca /build2/algorithm.ixx
parent267d34d2800d9cc3ed2865cbecf8d32f8f1ab6ec (diff)
Add notion of phase, enforce
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx
index 7da189d..ec06ddf 100644
--- a/build2/algorithm.ixx
+++ b/build2/algorithm.ixx
@@ -11,6 +11,8 @@ namespace build2
inline target&
search (prerequisite& p)
{
+ assert (phase == run_phase::search_match);
+
if (p.target == nullptr)
p.target = &search (p.key ());
@@ -56,6 +58,8 @@ namespace build2
inline void
match (slock& ml, action a, target& t)
{
+ assert (phase == run_phase::search_match);
+
if (!t.recipe (a))
match_impl (ml, a, t, true);
@@ -72,6 +76,8 @@ namespace build2
{
// text << "U " << t << ": " << t.dependents << " " << dependency_count;
+ assert (phase == run_phase::search_match);
+
//@@ MT
//
assert (t.dependents != 0 && dependency_count != 0);
@@ -82,6 +88,8 @@ namespace build2
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);
}
@@ -89,6 +97,8 @@ namespace build2
inline pair<recipe, action>
match_delegate (slock& ml, action a, target& t, const rule& r)
{
+ assert (phase == run_phase::search_match);
+
auto rp (match_impl (ml, a, t, false, &r));
const match_result& mr (rp.second);
return make_pair (rp.first->apply (ml, mr.recipe_action, t),
@@ -101,6 +111,8 @@ namespace build2
inline group_view
resolve_group_members (slock& ml, action a, target& g)
{
+ assert (phase == run_phase::search_match);
+
group_view r (g.group_members (a));
return r.members != nullptr ? r : resolve_group_members_impl (ml, a, g);
}