[llvm] r372958 - [BPF] Remove unused variables. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 03:55:57 PDT 2019
Author: rksimon
Date: Thu Sep 26 03:55:57 2019
New Revision: 372958
URL: http://llvm.org/viewvc/llvm-project?rev=372958&view=rev
Log:
[BPF] Remove unused variables. NFCI.
Fixes a dyn_cast<> null dereference warning.
Modified:
llvm/trunk/lib/Target/BPF/BTFDebug.cpp
Modified: llvm/trunk/lib/Target/BPF/BTFDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BTFDebug.cpp?rev=372958&r1=372957&r2=372958&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BTFDebug.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BTFDebug.cpp Thu Sep 26 03:55:57 2019
@@ -1154,12 +1154,8 @@ bool BTFDebug::InstLower(const MachineIn
const GlobalValue *GVal = MO.getGlobal();
auto *GVar = dyn_cast<GlobalVariable>(GVal);
if (GVar && GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr)) {
- MDNode *MDN = GVar->getMetadata(LLVMContext::MD_preserve_access_index);
- DIType *Ty = dyn_cast<DIType>(MDN);
- std::string TypeName = Ty->getName();
- int64_t Imm = AccessOffsets[GVar->getName().str()];
-
// Emit "mov ri, <imm>" for abstract member accesses.
+ int64_t Imm = AccessOffsets[GVar->getName().str()];
OutMI.setOpcode(BPF::MOV_ri);
OutMI.addOperand(MCOperand::createReg(MI->getOperand(0).getReg()));
OutMI.addOperand(MCOperand::createImm(Imm));
More information about the llvm-commits
mailing list