[llvm] r372992 - ARMBaseInstrInfo getOperandLatency - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 09:05:56 PDT 2019
Author: rksimon
Date: Thu Sep 26 09:05:55 2019
New Revision: 372992
URL: http://llvm.org/viewvc/llvm-project?rev=372992&view=rev
Log:
ARMBaseInstrInfo getOperandLatency - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but we should be able to use cast<> directly and if not assert will fire for us.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=372992&r1=372991&r2=372992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Sep 26 09:05:55 2019
@@ -4337,10 +4337,10 @@ ARMBaseInstrInfo::getOperandLatency(cons
}
const MCInstrDesc &UseMCID = get(UseNode->getMachineOpcode());
- const MachineSDNode *DefMN = dyn_cast<MachineSDNode>(DefNode);
+ auto *DefMN = cast<MachineSDNode>(DefNode);
unsigned DefAlign = !DefMN->memoperands_empty()
? (*DefMN->memoperands_begin())->getAlignment() : 0;
- const MachineSDNode *UseMN = dyn_cast<MachineSDNode>(UseNode);
+ auto *UseMN = cast<MachineSDNode>(UseNode);
unsigned UseAlign = !UseMN->memoperands_empty()
? (*UseMN->memoperands_begin())->getAlignment() : 0;
int Latency = getOperandLatency(ItinData, DefMCID, DefIdx, DefAlign,
More information about the llvm-commits
mailing list