diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-28 10:49:06 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-28 10:49:06 +0000 |
commit | e52aad42029beb74d50bc493df34b4971ed74b31 (patch) | |
tree | eaccdf1a06fe17fd9bfd8c510c44b2a166703aed /unittests/Analysis | |
parent | 55eab086e3932664450fafb64c2e37675bf9a52d (diff) | |
download | llvm-e52aad42029beb74d50bc493df34b4971ed74b31.tar.gz llvm-e52aad42029beb74d50bc493df34b4971ed74b31.tar.bz2 llvm-e52aad42029beb74d50bc493df34b4971ed74b31.tar.xz |
[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
Diffstat (limited to 'unittests/Analysis')
-rw-r--r-- | unittests/Analysis/LazyCallGraphTest.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<LazyCallGraph::SCC *, 1> 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]); } } |