summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-12-17 17:08:15 (GMT)
committerEvan Martin <martine@danga.com>2013-04-08 21:45:06 (GMT)
commitb6a9a1c8adbb444c2489d884f06e5bd39627c3e9 (patch)
tree61a7e8e06a57e1ef054a48e6febe061ac51635a5 /src/graph.h
parent9f1852fa3c97197e1876f1d47ca45e66b5e6cd28 (diff)
downloadNinja-b6a9a1c8adbb444c2489d884f06e5bd39627c3e9.zip
Ninja-b6a9a1c8adbb444c2489d884f06e5bd39627c3e9.tar.gz
Ninja-b6a9a1c8adbb444c2489d884f06e5bd39627c3e9.tar.bz2
add DepsLog, a new data structure for dependency information
DepsLog is a compact serialization of dependency information. It can be used to replace depfiles for faster loading.
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/graph.h b/src/graph.h
index 8b93e29..4ef05ec 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -32,7 +32,8 @@ struct Node {
: path_(path),
mtime_(-1),
dirty_(false),
- in_edge_(NULL) {}
+ in_edge_(NULL),
+ id_(-1) {}
/// Return true if the file exists (mtime_ got a value).
bool Stat(DiskInterface* disk_interface);
@@ -74,6 +75,9 @@ struct Node {
Edge* in_edge() const { return in_edge_; }
void set_in_edge(Edge* edge) { in_edge_ = edge; }
+ int id() const { return id_; }
+ void set_id(int id) { id_ = id; }
+
const vector<Edge*>& out_edges() const { return out_edges_; }
void AddOutEdge(Edge* edge) { out_edges_.push_back(edge); }
@@ -98,6 +102,9 @@ private:
/// All Edges that use this Node as an input.
vector<Edge*> out_edges_;
+
+ /// A dense integer id for the node, assigned and used by DepsLog.
+ int id_;
};
/// An invokable build command and associated metadata (description, etc.).