diff options
author | Evan Martin <martine@danga.com> | 2011-02-05 19:04:47 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-02-05 19:05:33 (GMT) |
commit | 6f3054b9bbfa000510eb0d4d7ca8ae567d186e55 (patch) | |
tree | 113f45652bf8043741020f68ba9c88f0d1d56002 | |
parent | 62f0af8be4d2d11472c10d28320ca99f43a68bab (diff) | |
download | Ninja-6f3054b9bbfa000510eb0d4d7ca8ae567d186e55.zip Ninja-6f3054b9bbfa000510eb0d4d7ca8ae567d186e55.tar.gz Ninja-6f3054b9bbfa000510eb0d4d7ca8ae567d186e55.tar.bz2 |
cleanup phony testing
-rw-r--r-- | src/build.cc | 6 | ||||
-rw-r--r-- | src/graph.cc | 3 | ||||
-rw-r--r-- | src/graph.h | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/build.cc b/src/build.cc index 8e567d9..3e3482c 100644 --- a/src/build.cc +++ b/src/build.cc @@ -312,7 +312,7 @@ bool Builder::Build(string* err) { if (!StartEdge(edge, err)) return false; - if (edge->rule_ == &State::kPhonyRule) + if (edge->is_phony()) FinishEdge(edge); } @@ -338,7 +338,7 @@ bool Builder::Build(string* err) { } bool Builder::StartEdge(Edge* edge, string* err) { - if (edge->rule_ == &State::kPhonyRule) + if (edge->is_phony()) return true; status_->BuildEdgeStarted(edge); @@ -370,7 +370,7 @@ void Builder::FinishEdge(Edge* edge) { } plan_.EdgeFinished(edge); - if (edge->rule_ == &State::kPhonyRule) + if (edge->is_phony()) return; int ms = status_->BuildEdgeFinished(edge); diff --git a/src/graph.cc b/src/graph.cc index f73028e..39e7841 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -170,3 +170,6 @@ void Edge::Dump() { printf("]\n"); } +bool Edge::is_phony() const { + return rule_ == &State::kPhonyRule; +} diff --git a/src/graph.h b/src/graph.h index 2ebf2e4..4f936b7 100644 --- a/src/graph.h +++ b/src/graph.h @@ -101,6 +101,8 @@ struct Edge { bool is_order_only(int index) { return index >= ((int)inputs_.size()) - order_only_deps_; } + + bool is_phony() const; }; #endif // NINJA_GRAPH_H_ |