diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:10 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-19 07:02:10 +0000 | 
| commit | 93c91e39b29142dec1d03a30df9f6e757f56c193 (patch) | |
| tree | 33a9b014a327e64450b3c9ed46d8c5bdb78ad345 /lib/Analysis/CGSCCPassManager.cpp | |
| parent | ca089b24d48ef6fa8da2d0bb8c25bb802c4a95c0 (diff) | |
Notes
Diffstat (limited to 'lib/Analysis/CGSCCPassManager.cpp')
| -rw-r--r-- | lib/Analysis/CGSCCPassManager.cpp | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/lib/Analysis/CGSCCPassManager.cpp b/lib/Analysis/CGSCCPassManager.cpp index 3ddefc6520a78..74b5d79ebac56 100644 --- a/lib/Analysis/CGSCCPassManager.cpp +++ b/lib/Analysis/CGSCCPassManager.cpp @@ -433,7 +433,7 @@ LazyCallGraph::SCC &llvm::updateCGAndAnalysisManagerForFunctionPass(          if (Visited.insert(C).second)            Worklist.push_back(C); -  LazyCallGraph::visitReferences(Worklist, Visited, [&](Function &Referee) { +  auto VisitRef = [&](Function &Referee) {      Node &RefereeN = *G.lookup(Referee);      Edge *E = N->lookup(RefereeN);      // FIXME: Similarly to new calls, we also currently preclude @@ -444,7 +444,12 @@ LazyCallGraph::SCC &llvm::updateCGAndAnalysisManagerForFunctionPass(      RetainedEdges.insert(&RefereeN);      if (E->isCall())        DemotedCallTargets.insert(&RefereeN); -  }); +  }; +  LazyCallGraph::visitReferences(Worklist, Visited, VisitRef); + +  // Include synthetic reference edges to known, defined lib functions. +  for (auto *F : G.getLibFunctions()) +    VisitRef(*F);    // First remove all of the edges that are no longer present in this function.    // We have to build a list of dead targets first and then remove them as the | 
