diff options
author | Brad King <brad.king@kitware.com> | 2015-11-13 18:09:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-19 15:08:26 (GMT) |
commit | b6f020d3640988824b1fe4355996ef0726a2c44c (patch) | |
tree | 761c78eeea9c16e4eaf28392b34dbb191a2e100b /src/build_test.cc | |
parent | a8b5cdc4e9034f8823ee0cfa94ea49d7795698ab (diff) | |
download | Ninja-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