[NFC] Change `dyn_cast` to `cast` to make sure no dereference on nullptr
authorPhoebe Wang <phoebe.wang@intel.com>
Fri, 25 Nov 2022 09:39:08 +0000 (17:39 +0800)
committerPhoebe Wang <phoebe.wang@intel.com>
Fri, 25 Nov 2022 09:40:37 +0000 (17:40 +0800)
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index bfdc2ec..714fbd2 100644 (file)
@@ -9147,7 +9147,7 @@ void SelectionDAGBuilder::visitInlineAsm(const CallBase &Call,
 
         SDValue AsmOp = InOperandVal;
         if (isFunction(InOperandVal)) {
-          auto *GA = dyn_cast<GlobalAddressSDNode>(InOperandVal);
+          auto *GA = cast<GlobalAddressSDNode>(InOperandVal);
           ResOpType = InlineAsm::getFlagWord(InlineAsm::Kind_Func, 1);
           AsmOp = DAG.getTargetGlobalAddress(GA->getGlobal(), getCurSDLoc(),
                                              InOperandVal.getValueType(),