[llvm] r287705 - [LCG] Add a previously missing assert about the relationship of RefSCCs.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 13:40:11 PST 2016


Author: chandlerc
Date: Tue Nov 22 15:40:10 2016
New Revision: 287705

URL: http://llvm.org/viewvc/llvm-project?rev=287705&view=rev
Log:
[LCG] Add a previously missing assert about the relationship of RefSCCs.

No intended change, everything seems to be in working order already.

Modified:
    llvm/trunk/lib/Analysis/LazyCallGraph.cpp

Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyCallGraph.cpp?rev=287705&r1=287704&r2=287705&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Tue Nov 22 15:40:10 2016
@@ -1435,6 +1435,13 @@ void LazyCallGraph::RefSCC::insertTrivia
 #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(




More information about the llvm-commits mailing list