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 ()
 
string EvaluateCommand (bool incl_rsp_file=false)
 Expand all variables in a command and return it as a string. More...
 
string GetBinding (const string &key)
 Returns the shell-escaped value of |key|. More...
 
bool GetBindingBool (const string &key)
 
string GetUnescapedDepfile ()
 Like GetBinding("depfile"), but without shell escaping. More...
 
string GetUnescapedRspfile ()
 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_missing_
 
BindingEnvenv_
 
int implicit_deps_
 
int implicit_outs_
 
vector< Node * > inputs_
 
VisitMark mark_
 
int order_only_deps_
 
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 131 of file graph.h.

Member Enumeration Documentation

◆ VisitMark

Enumerator
VisitNone 
VisitInStack 
VisitDone 

Definition at line 132 of file graph.h.

Constructor & Destructor Documentation

◆ Edge()

Edge::Edge ( )
inline

Definition at line 138 of file graph.h.

Member Function Documentation

◆ AllInputsReady()

bool Edge::AllInputsReady ( ) const

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

Definition at line 275 of file graph.cc.

References inputs_.

Referenced by Plan::AddSubTarget().

◆ Dump()

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

Definition at line 391 of file graph.cc.

References inputs_, Pool::name(), Rule::name(), outputs_, pool_, and rule_.

Referenced by Node::Dump().

◆ EvaluateCommand()

string Edge::EvaluateCommand ( bool  incl_rsp_file = false)

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

References GetBinding().

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

◆ GetBinding()

string Edge::GetBinding ( const string &  key)

◆ GetBindingBool()

bool Edge::GetBindingBool ( const string &  key)

Definition at line 377 of file graph.cc.

References GetBinding().

Referenced by Builder::FinishCommand(), and DependencyScan::RecomputeOutputDirty().

◆ GetUnescapedDepfile()

string Edge::GetUnescapedDepfile ( )

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

Definition at line 381 of file graph.cc.

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

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

◆ GetUnescapedRspfile()

string Edge::GetUnescapedRspfile ( )

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

Definition at line 386 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 185 of file graph.h.

Referenced by TEST_F().

◆ is_implicit_out()

bool Edge::is_implicit_out ( size_t  index) const
inline

Definition at line 199 of file graph.h.

Referenced by TEST_F().

◆ is_order_only()

bool Edge::is_order_only ( size_t  index)
inline

Definition at line 189 of file graph.h.

Referenced by GraphViz::AddTarget(), DependencyScan::RecomputeDirty(), and TEST_F().

◆ is_phony()

bool Edge::is_phony ( ) const

◆ maybe_phonycycle_diagnostic()

bool Edge::maybe_phonycycle_diagnostic ( ) const

Definition at line 420 of file graph.cc.

References implicit_deps_, implicit_outs_, is_phony(), and outputs_.

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

◆ outputs_ready()

bool Edge::outputs_ready ( ) const
inline

Definition at line 173 of file graph.h.

Referenced by Plan::AddSubTarget().

◆ pool()

Pool* Edge::pool ( ) const
inline

Definition at line 171 of file graph.h.

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

◆ rule()

const Rule& Edge::rule ( ) const
inline

Definition at line 170 of file graph.h.

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

◆ use_console()

bool Edge::use_console ( ) const

◆ weight()

int Edge::weight ( ) const
inline

Member Data Documentation

◆ deps_missing_

bool Edge::deps_missing_

Definition at line 168 of file graph.h.

Referenced by DependencyScan::RecomputeDirty().

◆ env_

BindingEnv* Edge::env_

Definition at line 165 of file graph.h.

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

◆ implicit_deps_

int Edge::implicit_deps_

◆ implicit_outs_

int Edge::implicit_outs_

◆ inputs_

vector<Node*> Edge::inputs_

◆ mark_

VisitMark Edge::mark_

Definition at line 166 of file graph.h.

Referenced by DependencyScan::RecomputeDirty(), and DependencyScan::VerifyDAG().

◆ order_only_deps_

int Edge::order_only_deps_

◆ outputs_

vector<Node*> Edge::outputs_

◆ outputs_ready_

bool Edge::outputs_ready_

◆ pool_

Pool* Edge::pool_

Definition at line 162 of file graph.h.

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

◆ rule_

const Rule* Edge::rule_

Definition at line 161 of file graph.h.

Referenced by State::AddEdge(), GraphViz::AddTarget(), Dump(), is_phony(), and EdgeEnv::LookupVariable().


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