summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-12-29 19:55:52 (GMT)
committerEvan Martin <martine@danga.com>2013-04-08 21:45:06 (GMT)
commit5504c0cb054ecfa1c8cd04fa141f5831560d13f4 (patch)
treefa543a6bba11b01fd43b0b05aebaebc59479a3ee /src/graph.h
parent00ffada47e1f9649ba76f12ff514f9434a182ef8 (diff)
downloadNinja-5504c0cb054ecfa1c8cd04fa141f5831560d13f4.zip
Ninja-5504c0cb054ecfa1c8cd04fa141f5831560d13f4.tar.gz
Ninja-5504c0cb054ecfa1c8cd04fa141f5831560d13f4.tar.bz2
use DepsLog in loading dependencies
WIP
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/graph.h b/src/graph.h
index dc1ef89..b27111b 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -22,8 +22,13 @@ using namespace std;
#include "eval_env.h"
#include "timestamp.h"
+struct BuildLog;
struct DiskInterface;
+struct DepsLog;
struct Edge;
+struct Node;
+struct Pool;
+struct State;
/// Information about a node in the dependency graph: the file, whether
/// it's dirty, mtime, etc.
@@ -128,11 +133,6 @@ struct Rule {
map<string, EvalString> bindings_;
};
-struct BuildLog;
-struct Node;
-struct State;
-struct Pool;
-
/// An edge in the dependency graph; links between Nodes using Rules.
struct Edge {
Edge() : rule_(NULL), env_(NULL), outputs_ready_(false), implicit_deps_(0),
@@ -192,11 +192,24 @@ struct ImplicitDepLoader {
: state_(state), disk_interface_(disk_interface) {}
bool LoadDepFile(Edge* edge, const string& path, string* err);
+ bool LoadDepsFromLog(Edge* edge, string* err);
+
+ private:
+ /// Preallocate \a count spaces in the input array on \a edge, returning
+ /// an iterator pointing at the first new space.
+ vector<Node*>::iterator PreallocateSpace(Edge* edge, int count);
+
+ /// If we don't have a edge that generates this input already,
+ /// create one; this makes us not abort if the input is missing,
+ /// but instead will rebuild in that circumstance.
+ void CreatePhonyInEdge(Node* node);
State* state_;
DiskInterface* disk_interface_;
+ DepsLog* deps_log_;
};
+
/// DependencyScan manages the process of scanning the files in a graph
/// and updating the dirty/outputs_ready state of all the nodes and edges.
struct DependencyScan {