diff --git a/llvm/lib/Target/VE/VEISelDAGToDAG.cpp b/llvm/lib/Target/VE/VEISelDAGToDAG.cpp --- a/llvm/lib/Target/VE/VEISelDAGToDAG.cpp +++ b/llvm/lib/Target/VE/VEISelDAGToDAG.cpp @@ -236,7 +236,7 @@ Addr.getOpcode() == ISD::TargetGlobalTLSAddress) return false; // direct calls. - if (ConstantSDNode *CN = cast(Addr)) { + if (auto *CN = dyn_cast(Addr)) { if (isInt<32>(CN->getSExtValue())) { Base = CurDAG->getTargetConstant(0, SDLoc(Addr), MVT::i32); Index = CurDAG->getTargetConstant(0, SDLoc(Addr), MVT::i32);