Ninja
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ImplicitDepLoader Struct Reference

ImplicitDepLoader loads implicit dependencies, as referenced via the "depfile" attribute in build files. More...

#include <graph.h>

Public Member Functions

DepsLogdeps_log () const
 
 ImplicitDepLoader (State *state, DepsLog *deps_log, DiskInterface *disk_interface)
 
bool LoadDeps (Edge *edge, string *err)
 Load implicit dependencies for edge. More...
 

Private Member Functions

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 input is missing, but instead will rebuild in that circumstance. More...
 
bool LoadDepFile (Edge *edge, const string &path, string *err)
 Load implicit dependencies for edge from a depfile attribute. More...
 
bool LoadDepsFromLog (Edge *edge, string *err)
 Load implicit dependencies for edge from the DepsLog. More...
 
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 space. More...
 

Private Attributes

DepsLogdeps_log_
 
DiskInterfacedisk_interface_
 
Statestate_
 

Detailed Description

ImplicitDepLoader loads implicit dependencies, as referenced via the "depfile" attribute in build files.

Definition at line 198 of file graph.h.

Constructor & Destructor Documentation

ImplicitDepLoader::ImplicitDepLoader ( State state,
DepsLog deps_log,
DiskInterface disk_interface 
)
inline

Definition at line 199 of file graph.h.

Member Function Documentation

void ImplicitDepLoader::CreatePhonyInEdge ( Node node)
private

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.

Definition at line 445 of file graph.cc.

References State::AddEdge(), Node::in_edge(), State::kPhonyRule, Edge::outputs_, Edge::outputs_ready_, Node::set_in_edge(), and state_.

Referenced by LoadDepFile(), and LoadDepsFromLog().

DepsLog* ImplicitDepLoader::deps_log ( ) const
inline

Definition at line 208 of file graph.h.

bool ImplicitDepLoader::LoadDepFile ( Edge edge,
const string &  path,
string *  err 
)
private

Load implicit dependencies for edge from a depfile attribute.

Returns
false on error (without filling err if info is just missing).

Definition at line 361 of file graph.cc.

References Node::AddOutEdge(), StringPiece::AsString(), CanonicalizePath(), CreatePhonyInEdge(), disk_interface_, EXPLAIN, State::GetNode(), DepfileParser::ins_, METRIC_RECORD, DepfileParser::out_, Edge::outputs_, DepfileParser::Parse(), Node::path(), PreallocateSpace(), DiskInterface::ReadFile(), and state_.

Referenced by LoadDeps().

bool ImplicitDepLoader::LoadDeps ( Edge edge,
string *  err 
)

Load implicit dependencies for edge.

Returns
false on error (without filling err if info is just missing

Definition at line 348 of file graph.cc.

References Edge::GetBinding(), Edge::GetUnescapedDepfile(), LoadDepFile(), and LoadDepsFromLog().

Referenced by DependencyScan::RecomputeDirty().

bool ImplicitDepLoader::LoadDepsFromLog ( Edge edge,
string *  err 
)
private

Load implicit dependencies for edge from the DepsLog.

Returns
false on error (without filling err if info is just missing).

Definition at line 410 of file graph.cc.

References Node::AddOutEdge(), CreatePhonyInEdge(), deps_log_, EXPLAIN, DepsLog::GetDeps(), Node::mtime(), DepsLog::Deps::mtime, DepsLog::Deps::node_count, DepsLog::Deps::nodes, Edge::outputs_, Node::path(), and PreallocateSpace().

Referenced by LoadDeps().

vector< Node * >::iterator ImplicitDepLoader::PreallocateSpace ( Edge edge,
int  count 
)
private

Preallocate count spaces in the input array on edge, returning an iterator pointing at the first new space.

Definition at line 437 of file graph.cc.

References Edge::implicit_deps_, Edge::inputs_, and Edge::order_only_deps_.

Referenced by LoadDepFile(), and LoadDepsFromLog().

Member Data Documentation

DepsLog* ImplicitDepLoader::deps_log_
private

Definition at line 232 of file graph.h.

Referenced by LoadDepsFromLog().

DiskInterface* ImplicitDepLoader::disk_interface_
private

Definition at line 231 of file graph.h.

Referenced by LoadDepFile().

State* ImplicitDepLoader::state_
private

Definition at line 230 of file graph.h.

Referenced by CreatePhonyInEdge(), and LoadDepFile().


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