From fa104687bc75dcb526056e47af5915f99c882da3 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 5 Aug 2017 03:37:38 +0000 Subject: [PATCH] [LCG] Remove the complex walk of the parent sets to update graph pointers. This is completely unnecessary as we have a trivial list of RefSCCs now that we can walk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310162 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/LazyCallGraph.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/Analysis/LazyCallGraph.cpp b/lib/Analysis/LazyCallGraph.cpp index fbf39a23779..690ca7d5122 100644 --- a/lib/Analysis/LazyCallGraph.cpp +++ b/lib/Analysis/LazyCallGraph.cpp @@ -1699,17 +1699,8 @@ void LazyCallGraph::updateGraphPtrs() { } } - // Process all SCCs updating the graph pointers. - { - SmallVector Worklist(LeafRefSCCs.begin(), LeafRefSCCs.end()); - - while (!Worklist.empty()) { - RefSCC &C = *Worklist.pop_back_val(); - C.G = this; - for (RefSCC &ParentC : C.parents()) - Worklist.push_back(&ParentC); - } - } + for (auto *RC : PostOrderRefSCCs) + RC->G = this; } template