summaryrefslogtreecommitdiffstats
path: root/src/state.cc
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2014-11-08 06:38:59 (GMT)
committerScott Graham <scottmg@chromium.org>2014-11-08 06:39:07 (GMT)
commitaacfd606f463bc3a7c2cc92d961dbded7979051c (patch)
treedac42a0635f199f39419c219ced98830b967d0e7 /src/state.cc
parente24d31901fc79aa7348be46bef5dea8d0dce6c4b (diff)
downloadNinja-aacfd606f463bc3a7c2cc92d961dbded7979051c.zip
Ninja-aacfd606f463bc3a7c2cc92d961dbded7979051c.tar.gz
Ninja-aacfd606f463bc3a7c2cc92d961dbded7979051c.tar.bz2
wip on adding tests at higher level, some not right
Diffstat (limited to 'src/state.cc')
-rw-r--r--src/state.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/state.cc b/src/state.cc
index 7258272..b6c29ff 100644
--- a/src/state.cc
+++ b/src/state.cc
@@ -112,10 +112,14 @@ Edge* State::AddEdge(const Rule* rule) {
}
Node* State::GetNode(StringPiece path) {
+ return GetNode(path, 0);
+}
+
+Node* State::GetNode(StringPiece path, unsigned int slash_bits) {
Node* node = LookupNode(path);
if (node)
return node;
- node = new Node(path.AsString());
+ node = new Node(path.AsString(), slash_bits);
paths_[node->path()] = node;
return node;
}
@@ -145,14 +149,14 @@ Node* State::SpellcheckNode(const string& path) {
return result;
}
-void State::AddIn(Edge* edge, StringPiece path) {
- Node* node = GetNode(path);
+void State::AddIn(Edge* edge, StringPiece path, unsigned int slash_bits) {
+ Node* node = GetNode(path, slash_bits);
edge->inputs_.push_back(node);
node->AddOutEdge(edge);
}
-void State::AddOut(Edge* edge, StringPiece path) {
- Node* node = GetNode(path);
+void State::AddOut(Edge* edge, StringPiece path, unsigned int slash_bits) {
+ Node* node = GetNode(path, slash_bits);
edge->outputs_.push_back(node);
if (node->in_edge()) {
Warning("multiple rules generate %s. "