Ninja
Public Types | Public Member Functions | Public Attributes | List of all members
Edge Struct Reference

An edge in the dependency graph; links between Nodes using Rules. More...

#include <graph.h>

Public Types

enum  VisitMark { VisitNone, VisitInStack, VisitDone }
 

Public Member Functions

bool AllInputsReady () const
 Return true if all inputs' in-edges are ready. More...
 
void Dump (const char *prefix="") const
 
 Edge ()
 
std::string EvaluateCommand (bool incl_rsp_file=false) const
 Expand all variables in a command and return it as a string. More...
 
std::string GetBinding (const std::string &key) const
 Returns the shell-escaped value of |key|. More...
 
bool GetBindingBool (const std::string &key) const
 
std::string GetUnescapedDepfile () const
 Like GetBinding("depfile"), but without shell escaping. More...
 
std::string GetUnescapedDyndep () const
 Like GetBinding("dyndep"), but without shell escaping. More...
 
std::string GetUnescapedRspfile () const
 Like GetBinding("rspfile"), but without shell escaping. More...
 
bool is_implicit (size_t index)
 
bool is_implicit_out (size_t index) const
 
bool is_order_only (size_t index)
 
bool is_phony () const
 
bool maybe_phonycycle_diagnostic () const
 
bool outputs_ready () const
 
Poolpool () const
 
const Rulerule () const
 
bool use_console () const
 
int weight () const
 

Public Attributes

bool deps_loaded_
 
bool deps_missing_
 
Nodedyndep_
 
BindingEnvenv_
 
int implicit_deps_
 
int implicit_outs_
 
std::vector< Node * > inputs_
 
VisitMark mark_
 
int order_only_deps_
 
std::vector< Node * > outputs_
 
bool outputs_ready_
 
Poolpool_
 
const Rulerule_
 

Detailed Description

An edge in the dependency graph; links between Nodes using Rules.

Definition at line 139 of file graph.h.

Member Enumeration Documentation

◆ VisitMark

Enumerator
VisitNone 
VisitInStack 
VisitDone 

Definition at line 140 of file graph.h.

Constructor & Destructor Documentation

◆ Edge()

Edge::Edge ( )
inline

Definition at line 146 of file graph.h.

Member Function Documentation

◆ AllInputsReady()

bool Edge::AllInputsReady ( ) const

Return true if all inputs' in-edges are ready.

Definition at line 316 of file graph.cc.

Referenced by Plan::AddSubTarget(), and Plan::EdgeMaybeReady().

◆ Dump()

void Edge::Dump ( const char *  prefix = "") const

Definition at line 435 of file graph.cc.

◆ EvaluateCommand()

std::string Edge::EvaluateCommand ( bool  incl_rsp_file = false) const

Expand all variables in a command and return it as a string.

If incl_rsp_file is enabled, the string will also contain the full contents of a response file (if applicable)

Definition at line 401 of file graph.cc.

Referenced by BuildStatus::BuildEdgeFinished(), DependencyScan::RecomputeOutputsDirty(), BuildLog::RecordCommand(), FakeCommandRunner::StartCommand(), RealCommandRunner::StartCommand(), Builder::StartEdge(), and TEST_F().

◆ GetBinding()

std::string Edge::GetBinding ( const std::string &  key) const

◆ GetBindingBool()

bool Edge::GetBindingBool ( const std::string &  key) const

◆ GetUnescapedDepfile()

string Edge::GetUnescapedDepfile ( ) const

Like GetBinding("depfile"), but without shell escaping.

Definition at line 420 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by Builder::ExtractDeps(), Builder::FinishCommand(), ImplicitDepLoader::LoadDeps(), and Cleaner::RemoveEdgeFiles().

◆ GetUnescapedDyndep()

string Edge::GetUnescapedDyndep ( ) const

Like GetBinding("dyndep"), but without shell escaping.

Definition at line 425 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by ManifestParser::ParseEdge().

◆ GetUnescapedRspfile()

std::string Edge::GetUnescapedRspfile ( ) const

Like GetBinding("rspfile"), but without shell escaping.

Definition at line 430 of file graph.cc.

References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().

Referenced by Builder::FinishCommand(), Cleaner::RemoveEdgeFiles(), and Builder::StartEdge().

◆ is_implicit()

bool Edge::is_implicit ( size_t  index)
inline

Definition at line 198 of file graph.h.

References implicit_deps_, inputs_, is_order_only(), and order_only_deps_.

Referenced by TEST_F().

◆ is_implicit_out()

bool Edge::is_implicit_out ( size_t  index) const
inline

Definition at line 212 of file graph.h.

References implicit_outs_, and outputs_.

Referenced by TEST_F().

◆ is_order_only()

bool Edge::is_order_only ( size_t  index)
inline

Definition at line 202 of file graph.h.

References inputs_, and order_only_deps_.

Referenced by GraphViz::AddTarget(), is_implicit(), and TEST_F().

◆ is_phony()

bool Edge::is_phony ( ) const

◆ maybe_phonycycle_diagnostic()

bool Edge::maybe_phonycycle_diagnostic ( ) const

Definition at line 464 of file graph.cc.

Referenced by ManifestParser::ParseEdge(), and DependencyScan::VerifyDAG().

◆ outputs_ready()

bool Edge::outputs_ready ( ) const
inline

Definition at line 186 of file graph.h.

References outputs_ready_.

Referenced by Plan::AddSubTarget(), Plan::DyndepsLoaded(), and Plan::RefreshDyndepDependents().

◆ pool()

Pool* Edge::pool ( ) const
inline

Definition at line 184 of file graph.h.

References pool_.

Referenced by Plan::EdgeFinished(), and Plan::ScheduleWork().

◆ rule()

const Rule& Edge::rule ( ) const
inline

Definition at line 183 of file graph.h.

References rule_.

Referenced by FakeCommandRunner::StartCommand(), and FakeCommandRunner::WaitForCommand().

◆ use_console()

bool Edge::use_console ( ) const

◆ weight()

int Edge::weight ( ) const
inline

Member Data Documentation

◆ deps_loaded_

bool Edge::deps_loaded_

Definition at line 180 of file graph.h.

◆ deps_missing_

bool Edge::deps_missing_

Definition at line 181 of file graph.h.

◆ dyndep_

Node* Edge::dyndep_

◆ env_

BindingEnv* Edge::env_

Definition at line 177 of file graph.h.

Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and DyndepLoader::UpdateEdge().

◆ implicit_deps_

int Edge::implicit_deps_

◆ implicit_outs_

int Edge::implicit_outs_

◆ inputs_

std::vector<Node*> Edge::inputs_

◆ mark_

VisitMark Edge::mark_

Definition at line 178 of file graph.h.

Referenced by Plan::UnmarkDependents(), and DependencyScan::VerifyDAG().

◆ order_only_deps_

int Edge::order_only_deps_

◆ outputs_

std::vector<Node*> Edge::outputs_

◆ outputs_ready_

bool Edge::outputs_ready_

◆ pool_

Pool* Edge::pool_

Definition at line 173 of file graph.h.

Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and pool().

◆ rule_

const Rule* Edge::rule_

Definition at line 172 of file graph.h.

Referenced by State::AddEdge(), GraphViz::AddTarget(), and rule().


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