15 #ifndef NINJA_GRAPH_H_ 16 #define NINJA_GRAPH_H_ 54 return Stat(disk_interface, err);
103 void Dump(
const char* prefix=
"")
const;
160 std::string
GetBinding(
const std::string& key)
const;
170 void Dump(
const char* prefix=
"")
const;
243 bool LoadDepFile(
Edge* edge,
const std::string& path, std::string* err);
286 bool* dirty, std::string* err);
308 bool VerifyDAG(
Node* node, std::vector<Node*>* stack, std::string* err);
313 const std::string& command,
Node* output);
321 #endif // NINJA_GRAPH_H_
bool dyndep_pending() const
std::vector< Edge * > out_edges_
All Edges that use this Node as an input.
bool Stat(DiskInterface *disk_interface, std::string *err)
Return false on error.
bool RecomputeOutputDirty(const Edge *edge, const Node *most_recent_input, const std::string &command, Node *output)
Recompute whether a given single output should be marked dirty.
void Dump(const char *prefix="") const
DepsLog * deps_log() const
Store data loaded from one dyndep file.
void Dump(const char *prefix="") const
DepfileParserOptions const * depfile_parser_options_
bool RecomputeOutputsDirty(Edge *edge, Node *most_recent_input, bool *dirty, std::string *err)
Recompute whether any output of the edge is dirty, if so sets |*dirty|.
void set_dirty(bool dirty)
Information about a node in the dependency graph: the file, whether it's dirty, mtime, etc.
bool RecomputeDirty(Node *node, std::string *err)
Update the |dirty_| state of the given node by inspecting its input edge.
bool outputs_ready() const
DyndepLoader dyndep_loader_
std::vector< Node * >::iterator PreallocateSpace(Edge *edge, int count)
Preallocate count spaces in the input array on edge, returning an iterator pointing at the first new ...
ImplicitDepLoader dep_loader_
Interface for accessing the disk.
uint64_t slash_bits() const
bool StatIfNecessary(DiskInterface *disk_interface, std::string *err)
Return false on error.
bool is_implicit_out(size_t index) const
bool LoadDyndeps(Node *node, std::string *err) const
Load a dyndep file from the given node's path and update the build graph with the new information...
std::vector< Node * > outputs_
void AddOutEdge(Edge *edge)
bool LoadDepsFromLog(Edge *edge, std::string *err)
Load implicit dependencies for edge from the DepsLog.
An edge in the dependency graph; links between Nodes using Rules.
Edge * in_edge_
The Edge that produces this Node, or NULL when there is no known edge to produce it.
bool LoadDepFile(Edge *edge, const std::string &path, std::string *err)
Load implicit dependencies for edge from a depfile attribute.
Store a log of every command ran for every build.
std::string PathDecanonicalized() const
Get |path()| but use slash_bits to convert back to original slash styles.
bool is_order_only(size_t index)
const std::string & path() const
As build commands run they can output extra dependency information (e.g.
An Env which contains a mapping of variables to values as well as a pointer to a parent scope...
bool is_implicit(size_t index)
void set_dyndep_pending(bool pending)
DiskInterface * disk_interface_
An invokable build command and associated metadata (description, etc.).
void ResetState()
Mark as not-yet-stat()ed and not dirty.
void MarkMissing()
Mark the Node as already-stat()ed and missing.
uint64_t slash_bits_
Set bits starting from lowest for backslashes that were normalized to forward slashes by Canonicalize...
std::string GetUnescapedRspfile() const
Like GetBinding("rspfile"), but without shell escaping.
bool VerifyDAG(Node *node, std::vector< Node *> *stack, std::string *err)
ImplicitDepLoader(State *state, DepsLog *deps_log, DiskInterface *disk_interface, DepfileParserOptions const *depfile_parser_options)
DepsLog * deps_log() const
BuildLog * build_log() const
Node(const std::string &path, uint64_t slash_bits)
void CreatePhonyInEdge(Node *node)
If we don't have a edge that generates this input already, create one; this makes us not abort if the...
bool LoadDeps(Edge *edge, std::string *err)
Load implicit dependencies for edge.
DyndepLoader loads dynamically discovered dependencies, as referenced via the "dyndep" attribute in b...
A pool for delayed edges.
void set_build_log(BuildLog *log)
TimeStamp mtime_
Possible values of mtime_: -1: file hasn't been examined 0: we looked, and file doesn't exist >0: act...
std::vector< Node * > inputs_
std::string GetUnescapedDepfile() const
Like GetBinding("depfile"), but without shell escaping.
bool status_known() const
bool dirty_
Dirty is true when the underlying file is out-of-date.
int id_
A dense integer id for the node, assigned and used by DepsLog.
std::string GetBinding(const std::string &key) const
Returns the shell-escaped value of |key|.
DependencyScan manages the process of scanning the files in a graph and updating the dirty/outputs_re...
ImplicitDepLoader loads implicit dependencies, as referenced via the "depfile" attribute in build fil...
const Rule & rule() const
std::string EvaluateCommand(bool incl_rsp_file=false) const
Expand all variables in a command and return it as a string.
bool AllInputsReady() const
Return true if all inputs' in-edges are ready.
bool maybe_phonycycle_diagnostic() const
const std::vector< Edge * > & out_edges() const
Global state (file status) for a single run.
void set_in_edge(Edge *edge)
unsigned long long uint64_t
DiskInterface * disk_interface_
bool GetBindingBool(const std::string &key) const
std::string GetUnescapedDyndep() const
Like GetBinding("dyndep"), but without shell escaping.
bool dyndep_pending_
Store whether dyndep information is expected from this node but has not yet been loaded.
DependencyScan(State *state, BuildLog *build_log, DepsLog *deps_log, DiskInterface *disk_interface, DepfileParserOptions const *depfile_parser_options)