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

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

Protected Attributes

DepfileParserOptions const * depfile_parser_options_
 
DepsLogdeps_log_
 
DiskInterfacedisk_interface_
 
Statestate_
 

Detailed Description

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

Definition at line 263 of file graph.h.

Constructor & Destructor Documentation

◆ ImplicitDepLoader()

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

Definition at line 264 of file graph.h.

Member Function Documentation

◆ CreatePhonyInEdge()

void ImplicitDepLoader::CreatePhonyInEdge ( Node node)
protected

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 740 of file graph.cc.

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

◆ deps_log()

DepsLog* ImplicitDepLoader::deps_log ( ) const
inline

Definition at line 275 of file graph.h.

References deps_log_.

Referenced by DependencyScan::deps_log().

◆ 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 622 of file graph.cc.

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

◆ 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 598 of file graph.cc.

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

◆ 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 705 of file graph.cc.

References Node::AddOutEdge(), EXPLAIN, DepsLog::Deps::mtime, Node::mtime(), DepsLog::Deps::node_count, DepsLog::Deps::nodes, Edge::outputs_, Node::path(), and PRId64.

◆ 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 732 of file graph.cc.

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

◆ 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 685 of file graph.cc.

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

Member Data Documentation

◆ depfile_parser_options_

DepfileParserOptions const* ImplicitDepLoader::depfile_parser_options_
protected

Definition at line 306 of file graph.h.

◆ deps_log_

DepsLog* ImplicitDepLoader::deps_log_
protected

Definition at line 305 of file graph.h.

Referenced by deps_log().

◆ disk_interface_

DiskInterface* ImplicitDepLoader::disk_interface_
protected

Definition at line 304 of file graph.h.

◆ state_

State* ImplicitDepLoader::state_
protected

Definition at line 303 of file graph.h.


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