diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-11-22 21:40:10 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-11-22 21:40:10 +0000 |
commit | 9eb857cb842f98abd3c9e1135613959e3ba5f03c (patch) | |
tree | aa392ce1a1e3d24aa79080ac21f2e3af20961ddf /llvm/lib/Analysis/LazyCallGraph.cpp | |
parent | 4e1a698be05697549072c8328918375a1609f3bd (diff) | |
download | bcm5719-llvm-9eb857cb842f98abd3c9e1135613959e3ba5f03c.tar.gz bcm5719-llvm-9eb857cb842f98abd3c9e1135613959e3ba5f03c.zip |
[LCG] Add a previously missing assert about the relationship of RefSCCs.
No intended change, everything seems to be in working order already.
llvm-svn: 287705
Diffstat (limited to 'llvm/lib/Analysis/LazyCallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyCallGraph.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index 9377fcb0d60..6111bba9d24 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -1435,6 +1435,13 @@ void LazyCallGraph::RefSCC::insertTrivialRefEdge(Node &SourceN, Node &TargetN) { #ifndef NDEBUG // Check that the RefSCC is still valid when we finish. auto ExitVerifier = make_scope_exit([this] { verify(); }); + + // Check that we aren't breaking some invariants of the RefSCC graph. + RefSCC &SourceRC = *G->lookupRefSCC(SourceN); + RefSCC &TargetRC = *G->lookupRefSCC(TargetN); + if (&SourceRC != &TargetRC) + assert(SourceRC.isAncestorOf(TargetRC) && + "Ref edge is not trivial in the RefSCC graph!"); #endif // First insert it into the source or find the existing edge. auto InsertResult = SourceN.EdgeIndexMap.insert( |