From e52aad42029beb74d50bc493df34b4971ed74b31 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 28 Apr 2014 10:49:06 +0000 Subject: [LCG] Make the return of the IntraSCC removal method actually match its contract (and be much more useful). It now provides exactly the post-order traversal a caller might need to perform on newly formed SCCs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207410 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Analysis/LazyCallGraphTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'unittests/Analysis/LazyCallGraphTest.cpp') diff --git a/unittests/Analysis/LazyCallGraphTest.cpp b/unittests/Analysis/LazyCallGraphTest.cpp index dd66c5cf3a..3fbd3ec20f 100644 --- a/unittests/Analysis/LazyCallGraphTest.cpp +++ b/unittests/Analysis/LazyCallGraphTest.cpp @@ -378,18 +378,21 @@ TEST(LazyCallGraphTest, IntraSCCEdgeRemoval) { // Remove the edge from b -> a, which should leave the 3 functions still in // a single connected component because of a -> b -> c -> a. - SCC.removeIntraSCCEdge(B, A); + SmallVector NewSCCs = SCC.removeIntraSCCEdge(B, A); + EXPECT_EQ(0u, NewSCCs.size()); EXPECT_EQ(&SCC, CG1.lookupSCC(A)); EXPECT_EQ(&SCC, CG1.lookupSCC(B)); EXPECT_EQ(&SCC, CG1.lookupSCC(C)); // Remove the edge from c -> a, which should leave 'a' in the original SCC // and form a new SCC for 'b' and 'c'. - SCC.removeIntraSCCEdge(C, A); + NewSCCs = SCC.removeIntraSCCEdge(C, A); + EXPECT_EQ(1u, NewSCCs.size()); EXPECT_EQ(&SCC, CG1.lookupSCC(A)); EXPECT_EQ(1, std::distance(SCC.begin(), SCC.end())); LazyCallGraph::SCC *SCC2 = CG1.lookupSCC(B); EXPECT_EQ(SCC2, CG1.lookupSCC(C)); + EXPECT_EQ(SCC2, NewSCCs[0]); } } -- cgit v1.2.3