diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h index a8e178d6461e0..08ada7b5c43e3 100644 --- a/llvm/include/llvm/Support/GenericDomTree.h +++ b/llvm/include/llvm/Support/GenericDomTree.h @@ -419,7 +419,7 @@ class DominatorTreeBase { bool isReachableFromEntry(const NodeT *A) const { assert(!this->isPostDominator() && "This is not implemented for post dominators"); - return isReachableFromEntry(getNode(const_cast(A))); + return isReachableFromEntry(getNode(A)); } bool isReachableFromEntry(const DomTreeNodeBase *A) const { return A; } @@ -939,11 +939,7 @@ bool DominatorTreeBase::dominates(const NodeT *A, if (A == B) return true; - // Cast away the const qualifiers here. This is ok since - // this function doesn't actually return the values returned - // from getNode. - return dominates(getNode(const_cast(A)), - getNode(const_cast(B))); + return dominates(getNode(A), getNode(B)); } template bool DominatorTreeBase::properlyDominates( @@ -951,11 +947,7 @@ bool DominatorTreeBase::properlyDominates( if (A == B) return false; - // Cast away the const qualifiers here. This is ok since - // this function doesn't actually return the values returned - // from getNode. - return dominates(getNode(const_cast(A)), - getNode(const_cast(B))); + return dominates(getNode(A), getNode(B)); } } // end namespace llvm