Ninja
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, DepfileParserOptions const *depfile_parser_options, Explanations *explanations)
 
bool LoadDeps (Edge *edge, std::string *err)
 Load implicit dependencies for edge.
 

Protected Member Functions

bool LoadDepFile (Edge *edge, const std::string &path, std::string *err)
 Load implicit dependencies for edge from a depfile attribute.
 
bool LoadDepsFromLog (Edge *edge, std::string *err)
 Load implicit dependencies for edge from the DepsLog.
 
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 space.
 
virtual bool ProcessDepfileDeps (Edge *edge, std::vector< StringPiece > *depfile_ins, std::string *err)
 Process loaded implicit dependencies for edge and update the graph.
 

Protected Attributes

DepfileParserOptions const * depfile_parser_options_
 
DepsLogdeps_log_
 
DiskInterfacedisk_interface_
 
OptionalExplanations explanations_
 
Statestate_
 

Detailed Description

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

Definition at line 285 of file graph.h.

Constructor & Destructor Documentation

◆ ImplicitDepLoader()

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

Definition at line 286 of file graph.h.

References depfile_parser_options_, deps_log(), deps_log_, disk_interface_, explanations_, and state_.

Member Function Documentation

◆ deps_log()

DepsLog * ImplicitDepLoader::deps_log ( ) const
inline

Definition at line 299 of file graph.h.

References deps_log_.

Referenced by ImplicitDepLoader().

◆ LoadDepFile()

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

Load implicit dependencies for edge from a depfile attribute.

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

Definition at line 642 of file graph.cc.

References CanonicalizePath(), depfile_parser_options_, disk_interface_, explanations_, DepfileParser::ins_, METRIC_RECORD, FileReader::NotFound, FileReader::Okay, FileReader::OtherError, Edge::outputs_, DepfileParser::outs_, DepfileParser::Parse(), Node::path(), and ProcessDepfileDeps().

Referenced by LoadDeps().

◆ LoadDeps()

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

Load implicit dependencies for edge.

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

Definition at line 618 of file graph.cc.

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

◆ LoadDepsFromLog()

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

Load implicit dependencies for edge from the DepsLog.

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

Definition at line 726 of file graph.cc.

References Node::AddOutEdge(), deps_log_, explanations_, Edge::implicit_deps_, Edge::inputs_, DepsLog::Deps::mtime, Node::mtime(), DepsLog::Deps::node_count, DepsLog::Deps::nodes, Edge::order_only_deps_, Edge::outputs_, Node::path(), and PRId64.

Referenced by LoadDeps().

◆ PreallocateSpace()

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

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

Definition at line 756 of file graph.cc.

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

Referenced by ProcessDepfileDeps().

◆ ProcessDepfileDeps()

bool ImplicitDepLoader::ProcessDepfileDeps ( Edge * edge,
std::vector< StringPiece > * depfile_ins,
std::string * err )
protectedvirtual

Process loaded implicit dependencies for edge and update the graph.

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

Definition at line 707 of file graph.cc.

References Node::AddOutEdge(), CanonicalizePath(), PreallocateSpace(), and state_.

Referenced by LoadDepFile().

Member Data Documentation

◆ depfile_parser_options_

DepfileParserOptions const* ImplicitDepLoader::depfile_parser_options_
protected

Definition at line 325 of file graph.h.

Referenced by ImplicitDepLoader(), and LoadDepFile().

◆ deps_log_

DepsLog* ImplicitDepLoader::deps_log_
protected

Definition at line 324 of file graph.h.

Referenced by deps_log(), ImplicitDepLoader(), and LoadDepsFromLog().

◆ disk_interface_

DiskInterface* ImplicitDepLoader::disk_interface_
protected

Definition at line 323 of file graph.h.

Referenced by ImplicitDepLoader(), and LoadDepFile().

◆ explanations_

OptionalExplanations ImplicitDepLoader::explanations_
protected

Definition at line 326 of file graph.h.

Referenced by ImplicitDepLoader(), LoadDepFile(), and LoadDepsFromLog().

◆ state_

State* ImplicitDepLoader::state_
protected

Definition at line 322 of file graph.h.

Referenced by ImplicitDepLoader(), and ProcessDepfileDeps().


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