summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-30 18:56:04 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-18 12:21:44 (GMT)
commit325602ca41c76753470b991c7a47b76b15e4241b (patch)
tree3a0fe810e629519ca8ba32510c515827e08eb852 /src/graph.cc
parentb08f3fb86909bf5b890e33936cf8fd44e1cbff47 (diff)
downloadNinja-325602ca41c76753470b991c7a47b76b15e4241b.zip
Ninja-325602ca41c76753470b991c7a47b76b15e4241b.tar.gz
Ninja-325602ca41c76753470b991c7a47b76b15e4241b.tar.bz2
Explicitly avoid repeat deps loading
Track for each Edge whether depfile information has been loaded using an explicit flag. This will allow RecomputeDirty to be repeated for an edge without loading deps again.
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/graph.cc b/src/graph.cc
index 9c2f784..bf9363d 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -75,12 +75,16 @@ bool DependencyScan::RecomputeDirty(Node* node, vector<Node*>* stack,
return false;
}
- if (!dep_loader_.LoadDeps(edge, err)) {
- if (!err->empty())
- return false;
- // Failed to load dependency info: rebuild to regenerate it.
- // LoadDeps() did EXPLAIN() already, no need to do it here.
- dirty = edge->deps_missing_ = true;
+ if (!edge->deps_loaded_) {
+ // This is our first encounter with this edge. Load discovered deps.
+ edge->deps_loaded_ = true;
+ if (!dep_loader_.LoadDeps(edge, err)) {
+ if (!err->empty())
+ return false;
+ // Failed to load dependency info: rebuild to regenerate it.
+ // LoadDeps() did EXPLAIN() already, no need to do it here.
+ dirty = edge->deps_missing_ = true;
+ }
}
// Visit all inputs; we're dirty if any of the inputs are dirty.