|
Ninja
|
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... | |
| int64_t | critical_path_weight () const |
| void | Dump (const char *prefix="") const |
| Edge ()=default | |
| 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 |
| Pool * | pool () const |
| const Rule & | rule () const |
| void | set_critical_path_weight (int64_t critical_path_weight) |
| bool | use_console () const |
| int | weight () const |
Public Attributes | |
| TimeStamp | command_start_time_ = 0 |
| int64_t | critical_path_weight_ = -1 |
| bool | deps_loaded_ = false |
| bool | deps_missing_ = false |
| Node * | dyndep_ = nullptr |
| BindingEnv * | env_ = nullptr |
| bool | generated_by_dep_loader_ = false |
| size_t | id_ = 0 |
| int | implicit_deps_ = 0 |
| int | implicit_outs_ = 0 |
| std::vector< Node * > | inputs_ |
| Jobserver::Slot | job_slot_ |
| A Jobserver slot instance. Invalid by default. More... | |
| VisitMark | mark_ = VisitNone |
| int | order_only_deps_ = 0 |
| std::vector< Node * > | outputs_ |
| bool | outputs_ready_ = false |
| Pool * | pool_ = nullptr |
| int64_t | prev_elapsed_time_millis = -1 |
| const Rule * | rule_ = nullptr |
| std::vector< Node * > | validations_ |
An edge in the dependency graph; links between Nodes using Rules.
| enum Edge::VisitMark |
|
default |
| bool Edge::AllInputsReady | ( | ) | const |
Return true if all inputs' in-edges are ready.
Definition at line 381 of file graph.cc.
Referenced by Plan::EdgeMaybeReady(), and Plan::ScheduleInitialEdges().
|
inline |
Definition at line 209 of file graph.h.
References critical_path_weight_.
Referenced by Plan::ComputeCriticalPath(), EdgePriorityLess::operator()(), and set_critical_path_weight().
| 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 501 of file graph.cc.
Referenced by StatusPrinter::BuildEdgeFinished(), DependencyScan::RecomputeOutputsDirty(), BuildLog::RecordCommand(), FakeCommandRunner::StartCommand(), RealCommandRunner::StartCommand(), Builder::StartEdge(), and TEST_F().
| std::string Edge::GetBinding | ( | const std::string & | key | ) | const |
Returns the shell-escaped value of |key|.
Definition at line 511 of file graph.cc.
References EdgeEnv::kShellEscape, and EdgeEnv::LookupVariable().
Referenced by Builder::FinishCommand(), DepsLog::IsDepsEntryLiveFor(), ImplicitDepLoader::LoadDeps(), ManifestParser::ParseEdge(), StatusPrinter::PrintStatus(), MissingDependencyScanner::ProcessNode(), FakeCommandRunner::StartCommand(), Builder::StartEdge(), TEST_F(), and FakeCommandRunner::WaitForCommand().
| bool Edge::GetBindingBool | ( | const std::string & | key | ) | const |
Definition at line 516 of file graph.cc.
Referenced by Builder::Build(), Builder::FinishCommand(), DependencyScan::RecomputeOutputDirty(), FakeCommandRunner::StartCommand(), and TEST_F().
| string Edge::GetUnescapedDepfile | ( | ) | const |
Like GetBinding("depfile"), but without shell escaping.
Definition at line 520 of file graph.cc.
References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().
Referenced by Builder::ExtractDeps(), ImplicitDepLoader::LoadDeps(), Cleaner::RemoveEdgeFiles(), FakeCommandRunner::StartCommand(), and Builder::StartEdge().
| string Edge::GetUnescapedDyndep | ( | ) | const |
Like GetBinding("dyndep"), but without shell escaping.
Definition at line 525 of file graph.cc.
References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().
Referenced by ManifestParser::ParseEdge().
| std::string Edge::GetUnescapedRspfile | ( | ) | const |
Like GetBinding("rspfile"), but without shell escaping.
Definition at line 530 of file graph.cc.
References EdgeEnv::kDoNotEscape, and EdgeEnv::LookupVariable().
Referenced by Builder::FinishCommand(), Cleaner::RemoveEdgeFiles(), and Builder::StartEdge().
|
inline |
Definition at line 245 of file graph.h.
References implicit_deps_, inputs_, is_order_only(), and order_only_deps_.
Referenced by TEST_F().
|
inline |
Definition at line 259 of file graph.h.
References implicit_outs_, and outputs_.
Referenced by TEST_F().
|
inline |
Definition at line 249 of file graph.h.
References inputs_, and order_only_deps_.
Referenced by GraphViz::AddTarget(), is_implicit(), DependencyScan::RecomputeNodeDirty(), and TEST_F().
| bool Edge::is_phony | ( | ) | const |
Definition at line 563 of file graph.cc.
Referenced by Builder::Build(), CommandCollector::CollectFrom(), Plan::EdgeWanted(), DependencyScan::RecomputeNodeDirty(), DependencyScan::RecomputeOutputDirty(), Builder::StartEdge(), and InputsCollector::VisitNode().
| bool Edge::maybe_phonycycle_diagnostic | ( | ) | const |
Definition at line 571 of file graph.cc.
Referenced by ManifestParser::ParseEdge(), and DependencyScan::VerifyDAG().
|
inline |
Definition at line 233 of file graph.h.
References outputs_ready_.
Referenced by Plan::AddSubTarget(), Plan::DyndepsLoaded(), DependencyScan::RecomputeNodeDirty(), and Plan::RefreshDyndepDependents().
|
inline |
Definition at line 231 of file graph.h.
References pool_.
Referenced by Plan::EdgeFinished(), Plan::ScheduleInitialEdges(), and Plan::ScheduleWork().
|
inline |
Definition at line 230 of file graph.h.
References rule_.
Referenced by FakeCommandRunner::StartCommand(), and FakeCommandRunner::WaitForCommand().
|
inline |
Definition at line 210 of file graph.h.
References critical_path_weight(), and critical_path_weight_.
Referenced by Plan::ComputeCriticalPath(), and TEST_F().
| bool Edge::use_console | ( | ) | const |
Definition at line 567 of file graph.cc.
References State::kConsolePool.
Referenced by StatusPrinter::BuildEdgeFinished(), StatusPrinter::BuildEdgeStarted(), RealCommandRunner::StartCommand(), and FakeCommandRunner::WaitForCommand().
|
inline |
Definition at line 232 of file graph.h.
Referenced by Pool::EdgeFinished(), Pool::EdgeScheduled(), Pool::WeightedEdgeCmp::operator()(), and Pool::RetrieveReadyEdges().
| TimeStamp Edge::command_start_time_ = 0 |
Definition at line 228 of file graph.h.
Referenced by Builder::FinishCommand(), and Builder::StartEdge().
| int64_t Edge::critical_path_weight_ = -1 |
Definition at line 223 of file graph.h.
Referenced by critical_path_weight(), and set_critical_path_weight().
| bool Edge::deps_loaded_ = false |
Definition at line 225 of file graph.h.
Referenced by DependencyScan::RecomputeNodeDirty().
| bool Edge::deps_missing_ = false |
Definition at line 226 of file graph.h.
Referenced by DependencyScan::RecomputeNodeDirty().
| Node* Edge::dyndep_ = nullptr |
Definition at line 219 of file graph.h.
Referenced by GraphViz::AddTarget(), ManifestParser::ParseEdge(), DependencyScan::RecomputeNodeDirty(), and TEST_F().
| BindingEnv* Edge::env_ = nullptr |
Definition at line 220 of file graph.h.
Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and DyndepLoader::UpdateEdge().
| size_t Edge::id_ = 0 |
Definition at line 222 of file graph.h.
Referenced by State::AddEdge(), EdgeCmp::operator()(), and EdgePriorityLess::operator()().
| int Edge::implicit_deps_ = 0 |
Definition at line 243 of file graph.h.
Referenced by is_implicit(), ImplicitDepLoader::LoadDepsFromLog(), ManifestParser::ParseEdge(), ImplicitDepLoader::PreallocateSpace(), TEST_F(), and DyndepLoader::UpdateEdge().
| int Edge::implicit_outs_ = 0 |
Definition at line 258 of file graph.h.
Referenced by is_implicit_out(), ManifestParser::ParseEdge(), TEST_F(), and DyndepLoader::UpdateEdge().
| std::vector<Node*> Edge::inputs_ |
Definition at line 216 of file graph.h.
Referenced by State::AddIn(), Plan::AddSubTarget(), GraphViz::AddTarget(), CommandCollector::CollectFrom(), Plan::ComputeCriticalPath(), is_implicit(), is_order_only(), ImplicitDepLoader::LoadDepsFromLog(), ManifestParser::ParseEdge(), MissingDependencyScanner::PathExistsBetween(), ImplicitDepLoader::PreallocateSpace(), MissingDependencyScanner::ProcessNode(), DependencyScan::RecomputeNodeDirty(), DependencyScan::RecomputeOutputDirty(), FakeCommandRunner::StartCommand(), TEST_F(), PlanTest::TestPoolWithDepthOne(), DyndepLoader::UpdateEdge(), InputsCollector::VisitNode(), and FakeCommandRunner::WaitForCommand().
| Jobserver::Slot Edge::job_slot_ |
A Jobserver slot instance. Invalid by default.
Definition at line 268 of file graph.h.
Referenced by Plan::EdgeFinished(), and Plan::FindWork().
Definition at line 221 of file graph.h.
Referenced by DependencyScan::RecomputeNodeDirty(), Plan::UnmarkDependents(), and DependencyScan::VerifyDAG().
| int Edge::order_only_deps_ = 0 |
Definition at line 244 of file graph.h.
Referenced by is_implicit(), is_order_only(), ImplicitDepLoader::LoadDepsFromLog(), ManifestParser::ParseEdge(), ImplicitDepLoader::PreallocateSpace(), TEST_F(), and DyndepLoader::UpdateEdge().
| std::vector<Node*> Edge::outputs_ |
Definition at line 217 of file graph.h.
Referenced by State::AddOut(), GraphViz::AddTarget(), StatusPrinter::BuildEdgeFinished(), CompareEdgesByOutput::cmp(), Plan::EdgeFinished(), Builder::FinishCommand(), is_implicit_out(), ImplicitDepLoader::LoadDepFile(), ImplicitDepLoader::LoadDepsFromLog(), DyndepLoader::LoadDyndeps(), ManifestParser::ParseEdge(), StatusPrinter::PrintStatus(), DependencyScan::RecomputeNodeDirty(), DependencyScan::RecomputeOutputsDirty(), BuildLog::RecordCommand(), FakeCommandRunner::StartCommand(), Builder::StartEdge(), TEST_F(), PlanTest::TestPoolWithDepthOne(), Plan::UnmarkDependents(), and DyndepLoader::UpdateEdge().
| bool Edge::outputs_ready_ = false |
Definition at line 224 of file graph.h.
Referenced by Plan::EdgeFinished(), outputs_ready(), and DependencyScan::RecomputeNodeDirty().
| Pool* Edge::pool_ = nullptr |
Definition at line 215 of file graph.h.
Referenced by State::AddEdge(), ManifestParser::ParseEdge(), and pool().
| int64_t Edge::prev_elapsed_time_millis = -1 |
Definition at line 272 of file graph.h.
Referenced by StatusPrinter::BuildEdgeFinished(), StatusPrinter::EdgeAddedToPlan(), and StatusPrinter::EdgeRemovedFromPlan().
| const Rule* Edge::rule_ = nullptr |
Definition at line 214 of file graph.h.
Referenced by State::AddEdge(), GraphViz::AddTarget(), and rule().
| std::vector<Node*> Edge::validations_ |
Definition at line 218 of file graph.h.
Referenced by State::AddValidation(), ManifestParser::ParseEdge(), DependencyScan::RecomputeNodeDirty(), and TEST_F().