summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-09-04 22:39:04 (GMT)
committerEvan Martin <martine@danga.com>2012-09-04 22:39:04 (GMT)
commit1e11c8a6bd119025efd8725370ffa42354f92f88 (patch)
tree53adfbd3d97d14a84bc9e0657e85569d0d547a11 /src/graph.h
parent703dcffd6d2e4b64411eb44d3025093abfd1d737 (diff)
downloadNinja-1e11c8a6bd119025efd8725370ffa42354f92f88.zip
Ninja-1e11c8a6bd119025efd8725370ffa42354f92f88.tar.gz
Ninja-1e11c8a6bd119025efd8725370ffa42354f92f88.tar.bz2
move BuildLog to DependencyScan
The build log is needed in computing whether an edge is dirty, so I think it belongs here. (It's a bit weird that Builder needs to reach into it to record completed commands, maybe it will become cleaner with more thought.)
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/graph.h b/src/graph.h
index ced1f4f..893ec09 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -201,8 +201,10 @@ struct Edge {
/// DependencyScan manages the process of scanning the files in a graph
/// and updating the dirty/outputs_ready state of all the nodes and edges.
struct DependencyScan {
- DependencyScan(State* state, DiskInterface* disk_interface)
- : state_(state), disk_interface_(disk_interface) {}
+ DependencyScan(State* state, BuildLog* build_log,
+ DiskInterface* disk_interface)
+ : state_(state), build_log_(build_log),
+ disk_interface_(disk_interface) {}
/// Examine inputs, outputs, and command lines to judge whether an edge
/// needs to be re-run, and update outputs_ready_ and each outputs' |dirty_|
@@ -217,11 +219,17 @@ struct DependencyScan {
bool LoadDepFile(Edge* edge, string* err);
- State* state_;
- DiskInterface* disk_interface_;
BuildLog* build_log() const {
- return state_->build_log_;
+ return build_log_;
}
+ void set_build_log(BuildLog* log) {
+ build_log_ = log;
+ }
+
+ private:
+ State* state_;
+ BuildLog* build_log_;
+ DiskInterface* disk_interface_;
};
#endif // NINJA_GRAPH_H_