summaryrefslogtreecommitdiffstats
path: root/src/state.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-03-24 01:16:36 (GMT)
committerNico Weber <nicolasweber@gmx.de>2015-03-24 01:16:36 (GMT)
commit96d873e6efb5da29a683ff48294c2216a52e34c1 (patch)
tree79e83b5779d38c6369c01206b5c18b0e5f48cc68 /src/state.cc
parentda1be5ece1f164ec6087aafe4efb0084c474afea (diff)
downloadNinja-96d873e6efb5da29a683ff48294c2216a52e34c1.zip
Ninja-96d873e6efb5da29a683ff48294c2216a52e34c1.tar.gz
Ninja-96d873e6efb5da29a683ff48294c2216a52e34c1.tar.bz2
Move warning emission on dupe edges from State to ManifestParser.
This will make it easier to optionally make this an error (because ManifestParser has a way of printing errors), and it'll also make it easier to make the tests quiet again. No behavior change.
Diffstat (limited to 'src/state.cc')
-rw-r--r--src/state.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/state.cc b/src/state.cc
index 0426b85..a70f211 100644
--- a/src/state.cc
+++ b/src/state.cc
@@ -140,17 +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()) {
- Warning("multiple rules generate %s. "
- "builds involving this target will not be correct; "
- "continuing anyway",
- path.AsString().c_str());
- return;
- }
+ if (node->in_edge())
+ return false;
edge->outputs_.push_back(node);
node->set_in_edge(edge);
+ return true;
}
bool State::AddDefault(StringPiece path, string* err) {