Add assert to check dominance dfs numbers.
authorTobias Grosser <grosser@fim.uni-passau.de>
Thu, 7 Jan 2010 23:50:41 +0000 (23:50 +0000)
committerTobias Grosser <grosser@fim.uni-passau.de>
Thu, 7 Jan 2010 23:50:41 +0000 (23:50 +0000)
Compare the dominance information calculated using a dominance tree walk to the
information calculated based on DFS numbers, if XDEBUG is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92969 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index b70b23c01f464dbf404ea37f597d9442995fcd88..31c19c49313ab4e35f0815d8c72e9a28ea064a38 100644 (file)
@@ -390,6 +390,13 @@ public:
     if (A == 0 || B == 0)
       return false;
 
+    // Compare the result of the tree walk and the dfs numbers, if expensive
+    // checks are enabled.
+#ifdef XDEBUG
+    assert(!DFSInfoValid
+           || (dominatedBySlowTreeWalk(A, B) == B->DominatedBy(A)));
+#endif
+
     if (DFSInfoValid)
       return B->DominatedBy(A);