summaryrefslogtreecommitdiffstats
path: root/src/build_test.cc
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-13 18:09:11 (GMT)
committerBrad King <brad.king@kitware.com>2017-06-19 15:08:26 (GMT)
commitb6f020d3640988824b1fe4355996ef0726a2c44c (patch)
tree761c78eeea9c16e4eaf28392b34dbb191a2e100b /src/build_test.cc
parenta8b5cdc4e9034f8823ee0cfa94ea49d7795698ab (diff)
downloadNinja-b6f020d3640988824b1fe4355996ef0726a2c44c.zip
Ninja-b6f020d3640988824b1fe4355996ef0726a2c44c.tar.gz
Ninja-b6f020d3640988824b1fe4355996ef0726a2c44c.tar.bz2
Teach RecomputeDirty to detect cycles in the build graph
RecomputeDirty is the earliest traversal of the build graph complete with depfile-loaded dependencies. Teach it to detect cycles and fail immediately. This avoids the need to tolerate cycles in RecomputeDirty only to diagnose them later. It also enables future simplification of Plan and Builder logic because they will be able to assume DAG input. When RecomputeDirty detects a cycle, reject it with an error message like that previously produced by Plan::CheckDependencyCycle. Previously we used the stat state of each node to determine whether we reached it earlier in the walk. Retain this approach for leaf nodes, but add an explicit walk state mark for each Edge so that we can have a temporary mark to aid cycle detection.
Diffstat (limited to 'src/build_test.cc')
0 files changed, 0 insertions, 0 deletions