summaryrefslogtreecommitdiffstats
path: root/src/build.h
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-04-05 17:07:58 (GMT)
committerGitHub <noreply@github.com>2018-04-05 17:07:58 (GMT)
commitf2bb21376c30cbd91aab3e76acf4ff93f3e73f92 (patch)
tree0b41359bd441a1a6299975bcf6eed52e081e03e1 /src/build.h
parentef05d51bf9ae4c2cdc9afb14325094f98b80f971 (diff)
parentf87e865e5b4ef91ac642f063ba55708359b8294f (diff)
downloadNinja-f2bb21376c30cbd91aab3e76acf4ff93f3e73f92.zip
Ninja-f2bb21376c30cbd91aab3e76acf4ff93f3e73f92.tar.gz
Ninja-f2bb21376c30cbd91aab3e76acf4ff93f3e73f92.tar.bz2
Merge pull request #1294 from bradking/plan-track-scheduling
Track in Plan whether wanted edges have been scheduled
Diffstat (limited to 'src/build.h')
-rw-r--r--src/build.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/build.h b/src/build.h
index e38719c..9b90e8a 100644
--- a/src/build.h
+++ b/src/build.h
@@ -78,17 +78,29 @@ private:
bool AddSubTarget(Node* node, Node* dependent, string* err);
void NodeFinished(Node* node);
+ /// Enumerate possible steps we want for an edge.
+ enum Want
+ {
+ /// We do not want to build the edge, but we might want to build one of
+ /// its dependents.
+ kWantNothing,
+ /// We want to build the edge, but have not yet scheduled it.
+ kWantToStart,
+ /// We want to build the edge, have scheduled it, and are waiting
+ /// for it to complete.
+ kWantToFinish
+ };
+
/// Submits a ready edge as a candidate for execution.
/// The edge may be delayed from running, for example if it's a member of a
/// currently-full pool.
- void ScheduleWork(Edge* edge);
+ void ScheduleWork(map<Edge*, Want>::iterator want_e);
/// 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_;
+ /// dependents. If it does contain an entry, the enumeration indicates what
+ /// we want for the edge.
+ map<Edge*, Want> want_;
set<Edge*> ready_;