@@ -456,7 +456,7 @@ class DominatorTreeBase {
456
456
bool isReachableFromEntry (const NodeT *A) const {
457
457
assert (!this ->isPostDominator () &&
458
458
" This is not implemented for post dominators" );
459
- return isReachableFromEntry (getNode (const_cast <NodeT *>(A) ));
459
+ return isReachableFromEntry (getNode (A ));
460
460
}
461
461
462
462
bool isReachableFromEntry (const DomTreeNodeBase<NodeT> *A) const { return A; }
@@ -1014,23 +1014,15 @@ bool DominatorTreeBase<NodeT, IsPostDom>::dominates(const NodeT *A,
1014
1014
if (A == B)
1015
1015
return true ;
1016
1016
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));
1022
1018
}
1023
1019
template <typename NodeT, bool IsPostDom>
1024
1020
bool DominatorTreeBase<NodeT, IsPostDom>::properlyDominates(
1025
1021
const NodeT *A, const NodeT *B) const {
1026
1022
if (A == B)
1027
1023
return false ;
1028
1024
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));
1034
1026
}
1035
1027
1036
1028
} // end namespace llvm
0 commit comments