Ninja
DependencyScan Struct Reference

DependencyScan manages the process of scanning the files in a graph and updating the dirty/outputs_ready state of all the nodes and edges. More...

#include <graph.h>

Public Member Functions

BuildLogbuild_log () const
 
 DependencyScan (State *state, BuildLog *build_log, DepsLog *deps_log, DiskInterface *disk_interface, DepfileParserOptions const *depfile_parser_options, Explanations *explanations)
 
DepsLogdeps_log () const
 
bool LoadDyndeps (Node *node, DyndepFile *ddf, std::string *err) 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.
 
bool RecomputeDirty (Node *node, std::vector< Node * > *validation_nodes, std::string *err)
 Update the |dirty_| state of the given nodes by transitively inspecting their input edges.
 
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_build_log (BuildLog *log)
 

Private Member Functions

bool RecomputeNodeDirty (Node *node, std::vector< Node * > *stack, std::vector< Node * > *validation_nodes, std::string *err)
 
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 RecordExplanation (const Node *node, const char *fmt,...)
 
bool VerifyDAG (Node *node, std::vector< Node * > *stack, std::string *err)
 

Private Attributes

BuildLogbuild_log_
 
ImplicitDepLoader dep_loader_
 
DiskInterfacedisk_interface_
 
DyndepLoader dyndep_loader_
 
OptionalExplanations explanations_
 

Detailed Description

DependencyScan manages the process of scanning the files in a graph and updating the dirty/outputs_ready state of all the nodes and edges.

Definition at line 332 of file graph.h.

Constructor & Destructor Documentation

◆ DependencyScan()

DependencyScan::DependencyScan ( State * state,
BuildLog * build_log,
DepsLog * deps_log,
DiskInterface * disk_interface,
DepfileParserOptions const * depfile_parser_options,
Explanations * explanations )
inline

Member Function Documentation

◆ build_log()

BuildLog * DependencyScan::build_log ( ) const
inline

Definition at line 356 of file graph.h.

References build_log_.

Referenced by DependencyScan(), and RecomputeOutputDirty().

◆ deps_log()

DepsLog * DependencyScan::deps_log ( ) const
inline

Definition at line 363 of file graph.h.

References dep_loader_.

Referenced by DependencyScan().

◆ LoadDyndeps() [1/2]

bool DependencyScan::LoadDyndeps ( Node * node,
DyndepFile * ddf,
std::string * err ) const

◆ LoadDyndeps() [2/2]

bool DependencyScan::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.

One overload accepts a caller-owned 'DyndepFile' object in which to store the information loaded from the dyndep file.

Referenced by RecomputeNodeDirty().

◆ RecomputeDirty()

bool DependencyScan::RecomputeDirty ( Node * node,
std::vector< Node * > * validation_nodes,
std::string * err )

Update the |dirty_| state of the given nodes by transitively inspecting their input edges.

Examine inputs, outputs, and command lines to judge whether an edge needs to be re-run, and update outputs_ready_ and each outputs' |dirty_| state accordingly. Appends any validation nodes found to the nodes parameter. Returns false on failure.

Definition at line 49 of file graph.cc.

References RecomputeNodeDirty().

Referenced by Plan::RefreshDyndepDependents().

◆ RecomputeNodeDirty()

◆ RecomputeOutputDirty()

bool DependencyScan::RecomputeOutputDirty ( const Edge * edge,
const Node * most_recent_input,
const std::string & command,
Node * output )
private

◆ RecomputeOutputsDirty()

bool DependencyScan::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|.

Returns false on failure.

Definition at line 265 of file graph.cc.

References Edge::EvaluateCommand(), Edge::outputs_, and RecomputeOutputDirty().

Referenced by Plan::CleanNode(), and RecomputeNodeDirty().

◆ RecordExplanation()

void DependencyScan::RecordExplanation ( const Node * node,
const char * fmt,
... )
private

◆ set_build_log()

void DependencyScan::set_build_log ( BuildLog * log)
inline

Definition at line 359 of file graph.h.

References build_log_.

◆ VerifyDAG()

bool DependencyScan::VerifyDAG ( Node * node,
std::vector< Node * > * stack,
std::string * err )
private

Member Data Documentation

◆ build_log_

BuildLog* DependencyScan::build_log_
private

Definition at line 386 of file graph.h.

Referenced by build_log(), DependencyScan(), and set_build_log().

◆ dep_loader_

ImplicitDepLoader DependencyScan::dep_loader_
private

Definition at line 388 of file graph.h.

Referenced by DependencyScan(), deps_log(), and RecomputeNodeDirty().

◆ disk_interface_

DiskInterface* DependencyScan::disk_interface_
private

Definition at line 387 of file graph.h.

Referenced by DependencyScan(), and RecomputeNodeDirty().

◆ dyndep_loader_

DyndepLoader DependencyScan::dyndep_loader_
private

Definition at line 389 of file graph.h.

Referenced by DependencyScan().

◆ explanations_

OptionalExplanations DependencyScan::explanations_
private

Definition at line 390 of file graph.h.

Referenced by DependencyScan(), RecomputeNodeDirty(), and RecomputeOutputDirty().


The documentation for this struct was generated from the following files: