summaryrefslogtreecommitdiffstats
path: root/src/build.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-09-18 02:07:35 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-18 22:01:48 (GMT)
commit5ff5891f5bed923b983c0f5a23c16d988d55f30e (patch)
treed882ee9f327e7ab138429dcee85625b88d7fa915 /src/build.h
parentafbe2185a3bbd2453d6b1c27ee8f7c1cce6371a3 (diff)
downloadNinja-5ff5891f5bed923b983c0f5a23c16d988d55f30e.zip
Ninja-5ff5891f5bed923b983c0f5a23c16d988d55f30e.tar.gz
Ninja-5ff5891f5bed923b983c0f5a23c16d988d55f30e.tar.bz2
Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_
dirty_ is intended to remain static during the build (unless a restat occurs), while outputs_ready_ reflects the dynamic state of the build.
Diffstat (limited to 'src/build.h')
-rw-r--r--src/build.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/build.h b/src/build.h
index 0f7303e..fa0abd2 100644
--- a/src/build.h
+++ b/src/build.h
@@ -15,6 +15,7 @@
#ifndef NINJA_BUILD_H_
#define NINJA_BUILD_H_
+#include <map>
#include <set>
#include <string>
#include <queue>
@@ -41,7 +42,7 @@ struct Plan {
Edge* FindWork();
/// Returns true if there's more work to be done.
- bool more_to_do() const { return !want_.empty(); }
+ bool more_to_do() const { return wanted_edges_; }
/// Dumps the current state of the plan.
void Dump();
@@ -58,11 +59,20 @@ private:
bool CheckDependencyCycle(Node* node, vector<Node*>* stack, string* err);
void NodeFinished(Node* node);
- set<Edge*> want_;
+ /// Keep track of which edges we want to build in this plan. If this map does
+ /// not contain an entry for an edge, we do not want to build the entry or its
+ /// dependents. If an entry maps to false, we do not want to build it, but we
+ /// might want to build one of its dependents. If the entry maps to true, we
+ /// want to build it.
+ map<Edge*, bool> want_;
+
set<Edge*> ready_;
/// Total number of edges that have commands (not phony).
int command_edges_;
+
+ /// Total remaining number of wanted edges.
+ int wanted_edges_;
};
/// CommandRunner is an interface that wraps running the build