diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-27 09:07:56 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-27 08:12:41 +0000 |
commit | 98ff39cb35ef2bd32bb1af9565628a4a4b0979b2 (patch) | |
tree | 151fe6c7d22b64f237f2f452cc72b581274a02d6 /ninja/src/state.cc | |
parent | af3d4809763ef308f08ced947a73b624729ac7ea (diff) | |
download | qtwebengine-chromium-98ff39cb35ef2bd32bb1af9565628a4a4b0979b2.tar.gz |
BASELINE: Update Chromium to 47.0.2526.34 and Ninja to 1.6.0
Change-Id: Ie8863b493c7ff19eb46478935dfe7602679b227e
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'ninja/src/state.cc')
-rw-r--r-- | ninja/src/state.cc | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/ninja/src/state.cc b/ninja/src/state.cc index 6e3e10d65a9..a70f211425b 100644 --- a/ninja/src/state.cc +++ b/ninja/src/state.cc @@ -61,6 +61,7 @@ void Pool::Dump() const { } } +// static bool Pool::WeightedEdgeCmp(const Edge* a, const Edge* b) { if (!a) return b; if (!b) return false; @@ -73,23 +74,11 @@ Pool State::kConsolePool("console", 1); const Rule State::kPhonyRule("phony"); State::State() { - AddRule(&kPhonyRule); + bindings_.AddRule(&kPhonyRule); AddPool(&kDefaultPool); AddPool(&kConsolePool); } -void State::AddRule(const Rule* rule) { - assert(LookupRule(rule->name()) == NULL); - rules_[rule->name()] = rule; -} - -const Rule* State::LookupRule(const string& rule_name) { - map<string, const Rule*>::iterator i = rules_.find(rule_name); - if (i == rules_.end()) - return NULL; - return i->second; -} - void State::AddPool(Pool* pool) { assert(LookupPool(pool->name()) == NULL); pools_[pool->name()] = pool; @@ -151,16 +140,13 @@ void State::AddIn(Edge* edge, StringPiece path, unsigned int slash_bits) { node->AddOutEdge(edge); } -void State::AddOut(Edge* edge, StringPiece path, unsigned int slash_bits) { +bool State::AddOut(Edge* edge, StringPiece path, unsigned int slash_bits) { Node* node = GetNode(path, slash_bits); + if (node->in_edge()) + return false; edge->outputs_.push_back(node); - if (node->in_edge()) { - Warning("multiple rules generate %s. " - "builds involving this target will not be correct; " - "continuing anyway", - path.AsString().c_str()); - } node->set_in_edge(edge); + return true; } bool State::AddDefault(StringPiece path, string* err) { @@ -187,7 +173,6 @@ vector<Node*> State::RootNodes(string* err) { if (!edges_.empty() && root_nodes.empty()) *err = "could not determine root nodes of build graph"; - assert(edges_.empty() || !root_nodes.empty()); return root_nodes; } |