summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-12-04 20:15:27 (GMT)
committerEvan Martin <martine@danga.com>2011-12-04 20:16:47 (GMT)
commitd412c2cfec1f8cd4d6a94a895773fb7c562c839c (patch)
tree40e303a715e295c0886320f0c16a049cab746c6e /src/graph.h
parenta756c374310d028e90fd89b7c30949f032d6aa36 (diff)
downloadNinja-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/graph.h')
-rw-r--r--src/graph.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/graph.h b/src/graph.h
index 64496d5..9080dcc 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -80,9 +80,17 @@ struct Edge {
Edge() : rule_(NULL), env_(NULL), outputs_ready_(false), implicit_deps_(0),
order_only_deps_(0) {}
+ /// Examine inputs, outputs, and command lines to judge whether this edge needs
+ /// to be re-run, and update outputs_ready_ and each outputs' dirty_ state
+ /// accordingly.
+ /// Returns false on failure.
bool RecomputeDirty(State* state, DiskInterface* disk_interface, string* err);
- void RecomputeOutputDirty(BuildLog* build_log, time_t most_recent_input,
- bool dirty, const string& command, Node* output);
+
+ /// Recompute whether a given single output should be marked dirty.
+ /// Returns true if so.
+ bool RecomputeOutputDirty(BuildLog* build_log, time_t most_recent_input,
+ const string& command, Node* output);
+
string EvaluateCommand(); // XXX move to env, take env ptr
string GetDescription();
bool LoadDepFile(State* state, DiskInterface* disk_interface, string* err);