From 6082d76936b8a65380eb7af03b4167d8f0298158 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Apr 2016 12:18:15 +0200 Subject: Implement short-circuiting to group state This is necessary to get rid of bogus restarts in inject_prerequisites() where it think a group member was updated since its state changed from unknown to (group's) changed. --- build2/algorithm.ixx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'build2/algorithm.ixx') diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index 3930412..17c9d8d 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -135,11 +135,14 @@ namespace build2 if (dependency_count != 0) // Re-examination of a postponed target? { assert (t.dependents != 0); - t.dependents--; - dependency_count--; + --t.dependents; + --dependency_count; } - switch (target_state ts = t.state ()) + // Don't short-circuit to the group state since we need to execute the + // member's recipe to keep the dependency counts straight. + // + switch (target_state ts = t.state (false)) { case target_state::unchanged: case target_state::changed: @@ -188,6 +191,8 @@ namespace build2 inline target_state execute_direct (action a, target& t) { + // Here we don't care about the counts so short-circuit state is ok. + // switch (target_state ts = t.state ()) { case target_state::unchanged: -- cgit v1.1