diff options
author | Scott Graham <scottmg@chromium.org> | 2015-04-27 18:12:43 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2015-04-27 18:12:45 (GMT) |
commit | bf2f4b7356c8ea918718651bae586149ab97ebee (patch) | |
tree | 10fd1af3827d3ac80803af72829af24a492a0f88 /src | |
parent | 4c4887d26011225deaa20b6752193be0293624ab (diff) | |
download | Ninja-bf2f4b7356c8ea918718651bae586149ab97ebee.zip Ninja-bf2f4b7356c8ea918718651bae586149ab97ebee.tar.gz Ninja-bf2f4b7356c8ea918718651bae586149ab97ebee.tar.bz2 |
simplify & inline
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 19 | ||||
-rw-r--r-- | src/build.h | 7 |
2 files changed, 8 insertions, 18 deletions
diff --git a/src/build.cc b/src/build.cc index e266b5c..cdb8e0a 100644 --- a/src/build.cc +++ b/src/build.cc @@ -374,24 +374,19 @@ void Plan::ScheduleWork(Edge* edge) { } } -void Plan::ResumeDelayedJobs(Edge* edge) { - edge->pool()->EdgeFinished(*edge); - edge->pool()->RetrieveReadyEdges(&ready_); -} - -void Plan::EdgeFinished(Edge* edge, bool directly_wanted) { +void Plan::EdgeFinished(Edge* edge) { map<Edge*, bool>::iterator e = want_.find(edge); assert(e != want_.end()); - if (e->second) + bool directly_wanted = e->second; + if (directly_wanted) --wanted_edges_; want_.erase(e); edge->outputs_ready_ = true; - // See if this job frees up any delayed jobs + // See if this job frees up any delayed jobs. if (directly_wanted) - ResumeDelayedJobs(edge); - else - edge->pool()->RetrieveReadyEdges(&ready_); + edge->pool()->EdgeFinished(*edge); + edge->pool()->RetrieveReadyEdges(&ready_); // Check off any nodes we were waiting for with this edge. for (vector<Node*>::iterator o = edge->outputs_.begin(); @@ -415,7 +410,7 @@ void Plan::NodeFinished(Node* node) { } else { // We do not need to build this edge, but we might need to build one of // its dependents. - EdgeFinished(*oe, want_e->second); + EdgeFinished(*oe); } } } diff --git a/src/build.h b/src/build.h index 6eabae5..8106faa 100644 --- a/src/build.h +++ b/src/build.h @@ -58,7 +58,7 @@ struct Plan { /// Mark an edge as done building. Used internally and by /// tests. - void EdgeFinished(Edge* edge, bool directly_wanted = true); + void EdgeFinished(Edge* edge); /// Clean the given node during the build. /// Return false on error. @@ -78,11 +78,6 @@ private: /// currently-full pool. void ScheduleWork(Edge* edge); - /// Allows jobs blocking on |edge| to potentially resume. - /// For example, if |edge| is a member of a pool, calling this may schedule - /// previously pending jobs in that pool. - void ResumeDelayedJobs(Edge* edge); - /// 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 |