[llvm] 2e5366a - [NFC] Change `dyn_cast` to `cast` to make sure no dereference on nullptr
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 01:40:43 PST 2022
Author: Phoebe Wang
Date: 2022-11-25T17:40:37+08:00
New Revision: 2e5366ac2e05fb49ad4b62b86c23359ad95740bb
URL: https://github.com/llvm/llvm-project/commit/2e5366ac2e05fb49ad4b62b86c23359ad95740bb
DIFF: https://github.com/llvm/llvm-project/commit/2e5366ac2e05fb49ad4b62b86c23359ad95740bb.diff
LOG: [NFC] Change `dyn_cast` to `cast` to make sure no dereference on nullptr
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index bfdc2ec84d89e..714fbd2d6964e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -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(),
More information about the llvm-commits
mailing list