@@ -456,7 +456,7 @@ class DominatorTreeBase {
456456 bool isReachableFromEntry (const NodeT *A) const {
457457 assert (!this ->isPostDominator () &&
458458 " This is not implemented for post dominators" );
459- return isReachableFromEntry (getNode (const_cast <NodeT *>(A) ));
459+ return isReachableFromEntry (getNode (A ));
460460 }
461461
462462 bool isReachableFromEntry (const DomTreeNodeBase<NodeT> *A) const { return A; }
@@ -1014,23 +1014,15 @@ bool DominatorTreeBase<NodeT, IsPostDom>::dominates(const NodeT *A,
10141014 if (A == B)
10151015 return true ;
10161016
1017- // Cast away the const qualifiers here. This is ok since
1018- // this function doesn't actually return the values returned
1019- // from getNode.
1020- return dominates (getNode (const_cast <NodeT *>(A)),
1021- getNode (const_cast <NodeT *>(B)));
1017+ return dominates (getNode (A), getNode (B));
10221018}
10231019template <typename NodeT, bool IsPostDom>
10241020bool DominatorTreeBase<NodeT, IsPostDom>::properlyDominates(
10251021 const NodeT *A, const NodeT *B) const {
10261022 if (A == B)
10271023 return false ;
10281024
1029- // Cast away the const qualifiers here. This is ok since
1030- // this function doesn't actually return the values returned
1031- // from getNode.
1032- return dominates (getNode (const_cast <NodeT *>(A)),
1033- getNode (const_cast <NodeT *>(B)));
1025+ return dominates (getNode (A), getNode (B));
10341026}
10351027
10361028} // end namespace llvm
0 commit comments