diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index c384925e709..0d2222dd0cb 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/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,