]> granicus.if.org Git - llvm/commitdiff
[BPF] Remove unused variables. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 26 Sep 2019 10:55:57 +0000 (10:55 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 26 Sep 2019 10:55:57 +0000 (10:55 +0000)
Fixes a dyn_cast<> null dereference warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372958 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/BPF/BTFDebug.cpp

index 11886305739edecebe9a1b66d6c1b8f42e8abb1a..3ad32347e0a1086c5e8966588eb717a4864f234d 100644 (file)
@@ -1154,12 +1154,8 @@ bool BTFDebug::InstLower(const MachineInstr *MI, MCInst &OutMI) {
       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));