From: Evan Martin Date: Sat, 5 Feb 2011 19:04:47 +0000 (-0800) Subject: cleanup phony testing X-Git-Tag: release-120715~483^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f3054b9bbfa000510eb0d4d7ca8ae567d186e55;p=platform%2Fupstream%2Fninja.git cleanup phony testing --- 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_