Lines Matching refs:edge
52 virtual bool StartCommand(Edge* edge);
63 bool DryRunCommandRunner::StartCommand(Edge* edge) {
64 finished_.push(edge);
73 result->edge = finished_.front();
99 Edge* edge = node->in_edge();
100 if (!edge) {
105 // since there is no producing edge to add to the plan.
116 if (edge->outputs_ready())
119 // If an entry in want_ does not already exist for edge, create an entry which
122 want_.insert(make_pair(edge, kWantNothing));
126 return false; // Don't need to do anything with already-scheduled edge.
128 // If we do need to build edge and we haven't already marked it as wanted,
132 EdgeWanted(edge);
133 if (!dyndep_walk && edge->AllInputsReady())
138 dyndep_walk->insert(edge);
143 for (vector<Node*>::iterator i = edge->inputs_.begin();
144 i != edge->inputs_.end(); ++i) {
152 void Plan::EdgeWanted(const Edge* edge) {
154 if (!edge->is_phony()) {
157 builder_->status_->EdgeAddedToPlan(edge);
166 Edge* edge = *e;
168 return edge;
173 // This edge has already been scheduled. We can get here again if an edge
175 // duplicates an out edge (see https://github.com/ninja-build/ninja/pull/519).
182 Edge* edge = want_e->first;
183 Pool* pool = edge->pool();
185 pool->DelayEdge(edge);
188 pool->EdgeScheduled(*edge);
189 ready_.insert(edge);
193 bool Plan::EdgeFinished(Edge* edge, EdgeResult result, string* err) {
194 map<Edge*, Want>::iterator e = want_.find(edge);
200 edge->pool()->EdgeFinished(*edge);
201 edge->pool()->RetrieveReadyEdges(&ready_);
210 edge->outputs_ready_ = true;
212 // Check off any nodes we were waiting for with this edge.
213 for (vector<Node*>::iterator o = edge->outputs_.begin();
214 o != edge->outputs_.end(); ++o) {
237 // See if the edge is now ready.
245 Edge* edge = want_e->first;
246 if (edge->AllInputsReady()) {
250 // We do not need to build this edge, but we might need to build one of
252 if (!EdgeFinished(edge, kEdgeSucceeded, err))
269 // Don't attempt to clean an edge if it failed to load deps.
273 // If all non-order-only inputs for this edge are now clean,
291 // Now, this edge is dirty if any of the outputs are dirty.
292 // If the edge isn't dirty, clean the outputs and mark the edge as not
334 Edge* edge = oe->first;
336 // If the edge outputs are ready we do not need to consider it here.
337 if (edge->outputs_ready())
340 map<Edge*, Want>::iterator want_e = want_.find(edge);
342 // If the edge has not been encountered before then nothing already in the
343 // plan depends on it so we do not need to consider the edge yet either.
347 // This edge is already in the plan so queue it for the walk.
419 // This edge was encountered before. However, we may not have wanted to
421 // information an output is now known to be dirty, so we want the edge.
422 Edge* edge = n->in_edge();
423 assert(edge && !edge->outputs_ready());
424 map<Edge*, Want>::iterator want_e = want_.find(edge);
428 EdgeWanted(edge);
437 Edge* edge = *oe;
439 map<Edge*, Want>::iterator want_e = want_.find(edge);
443 if (edge->mark_ != Edge::VisitNone) {
444 edge->mark_ = Edge::VisitNone;
445 for (vector<Node*>::iterator o = edge->outputs_.begin();
446 o != edge->outputs_.end(); ++o) {
468 virtual bool StartCommand(Edge* edge);
512 bool RealCommandRunner::StartCommand(Edge* edge) {
513 string command = edge->EvaluateCommand();
514 Subprocess* subproc = subprocs_.Add(command, edge->use_console());
517 subproc_to_edge_.insert(make_pair(subproc, edge));
534 result->edge = e->second;
662 Edge* edge = plan_.FindWork();
663 if (!edge)
666 if (edge->GetBindingBool("generator")) {
670 if (!StartEdge(edge, err)) {
676 if (edge->is_phony()) {
677 if (!plan_.EdgeFinished(edge, Plan::kEdgeSucceeded, err)) {
809 std::string Builder::GetContent(Edge* edge)
811 std::string content = edge->GetBinding("rspfile_content");
812 std::string toolchain_whole_status = edge->env_->LookupVariable("toolchain_whole_status");
815 return SplicingWholeContent(content, edge->env_->LookupVariable("whole-archive"), true);
817 return SplicingWholeContent(content, edge->env_->LookupVariable("no-whole-archive"), false);
823 bool Builder::StartEdge(Edge* edge, string* err) {
825 if (edge->is_phony())
829 running_edges_.insert(make_pair(edge, start_time_millis));
831 status_->BuildEdgeStarted(edge, start_time_millis);
838 for (vector<Node*>::iterator o = edge->outputs_.begin();
839 o != edge->outputs_.end(); ++o) {
850 edge->command_start_time_ = build_start;
854 string rspfile = edge->GetUnescapedRspfile();
856 string content = GetContent(edge);
862 if (!command_runner_->StartCommand(edge)) {
863 err->assign("command '" + edge->EvaluateCommand() + "' failed.");
873 Edge* edge = result->edge;
881 string deps_type = edge->GetBinding("deps");
882 const string deps_prefix = edge->GetBinding("msvc_deps_prefix");
895 RunningEdgeMap::iterator it = running_edges_.find(edge);
900 status_->BuildEdgeFinished(edge, start_time_millis, end_time_millis,
905 return plan_.EdgeFinished(edge, Plan::kEdgeFailed, err);
908 // Restat the edge outputs
911 const bool restat = edge->GetBindingBool("restat");
912 const bool generator = edge->GetBindingBool("generator");
914 record_mtime = edge->command_start_time_;
918 // attempting to touch/stat the temp file when the edge started and
922 for (vector<Node*>::iterator o = edge->outputs_.begin();
923 o != edge->outputs_.end(); ++o) {
940 record_mtime = edge->command_start_time_;
944 if (!plan_.EdgeFinished(edge, Plan::kEdgeSucceeded, err))
948 string rspfile = edge->GetUnescapedRspfile();
953 if (!scan_.build_log()->RecordCommand(edge, start_time_millis,
961 assert(!edge->outputs_.empty() && "should have been rejected by parser");
962 for (std::vector<Node*>::const_iterator o = edge->outputs_.begin();
963 o != edge->outputs_.end(); ++o) {
996 string depfile = result->edge->GetUnescapedDepfile();
998 *err = string("edge with deps=gcc but no depfile makes no sense");