From c9dccb117964116180cef143cad6016204bdf96f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 24 Mar 2012 22:52:25 +0000 Subject: [PATCH] Avoid using dominatedBySlowTreeWalk. llvm-svn: 153398 --- llvm/include/llvm/Analysis/Dominators.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h index c384925e7091..0d2222dd0cbc 100644 --- a/llvm/include/llvm/Analysis/Dominators.h +++ b/llvm/include/llvm/Analysis/Dominators.h @@ -338,9 +338,12 @@ public: /// Note that this is not a constant time operation! /// bool properlyDominates(const DomTreeNodeBase *A, - const DomTreeNodeBase *B) const { - if (A == 0 || B == 0) return false; - return dominatedBySlowTreeWalk(A, B); + const DomTreeNodeBase *B) { + if (A == 0 || B == 0) + return false; + if (A == B) + return false; + return dominates(A, B); } inline bool properlyDominates(const NodeT *A, const NodeT *B) { @@ -350,8 +353,8 @@ public: // Cast away the const qualifiers here. This is ok since // this function doesn't actually return the values returned // from getNode. - return properlyDominates(getNode(const_cast(A)), - getNode(const_cast(B))); + return dominates(getNode(const_cast(A)), + getNode(const_cast(B))); } bool dominatedBySlowTreeWalk(const DomTreeNodeBase *A,