aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/Dominators.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index b70b23c01f..31c19c4931 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -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);