diff options
author | Evan Martin <martine@danga.com> | 2011-12-04 20:15:27 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-12-04 20:16:47 (GMT) |
commit | d412c2cfec1f8cd4d6a94a895773fb7c562c839c (patch) | |
tree | 40e303a715e295c0886320f0c16a049cab746c6e /src/build.cc | |
parent | a756c374310d028e90fd89b7c30949f032d6aa36 (diff) | |
download | Ninja-d412c2cfec1f8cd4d6a94a895773fb7c562c839c.zip Ninja-d412c2cfec1f8cd4d6a94a895773fb7c562c839c.tar.gz Ninja-d412c2cfec1f8cd4d6a94a895773fb7c562c839c.tar.bz2 |
refactor RecomputeOutputDirty to return true/false for dirty
Rather than taking whether the edge is dirty as an input, instead
only consider the arguments and return true/false, allowing the caller
to decide what to do with that information. (In the restat case we
were faking out the environment to get particular behavior for this.)
Should have no side effects, but this is part of fixing issue 148.
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/build.cc b/src/build.cc index ae6ebbb..25d3ba9 100644 --- a/src/build.cc +++ b/src/build.cc @@ -337,14 +337,9 @@ void Plan::CleanNode(BuildLog* build_log, Node* node) { if (!(*ni)->dirty_) continue; - // RecomputeOutputDirty will not modify dirty_ if the output is clean. - (*ni)->dirty_ = false; - - // Since we know that all non-order-only inputs are clean, we can pass - // "false" as the "dirty" argument here. - (*ei)->RecomputeOutputDirty(build_log, most_recent_input, false, - command, *ni); - if ((*ni)->dirty_) { + if ((*ei)->RecomputeOutputDirty(build_log, most_recent_input, command, + *ni)) { + (*ni)->dirty_ = true; all_outputs_clean = false; } else { CleanNode(build_log, *ni); |