aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-21 12:18:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-21 12:18:15 +0200
commit6082d76936b8a65380eb7af03b4167d8f0298158 (patch)
tree4cfadd3f54c134a1a45086ad15015a88b902ffba /build2/algorithm.ixx
parent0165fa7178319bb250be1882b3b457232236c820 (diff)
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.
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx11
1 files changed, 8 insertions, 3 deletions
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: