[bpf] fix build
authorAlexei Starovoitov <alexei.starovoitov@gmail.com>
Tue, 7 Apr 2015 20:25:34 +0000 (20:25 +0000)
committerAlexei Starovoitov <alexei.starovoitov@gmail.com>
Tue, 7 Apr 2015 20:25:34 +0000 (20:25 +0000)
fix the build and remove unused variable warnings in Release mode.

Patch by Brenden Blanco.

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

lib/Target/BPF/BPFISelLowering.cpp
lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp

index cdcf0936a3de189d4d7a446f6585a4693d0c808e..1ccb9ebe7e779d53d23b1165081dffff421a3a1f 100644 (file)
@@ -64,7 +64,7 @@ public:
     raw_string_ostream OS(Str);
 
     if (DLoc) {
-      DILocation DIL(DLoc.getAsMDNode());
+      DILocation DIL(DLoc.get());
       StringRef Filename = DIL.getFilename();
       unsigned Line = DIL.getLineNumber();
       unsigned Column = DIL.getColumnNumber();
@@ -537,12 +537,10 @@ SDValue BPFTargetLowering::LowerGlobalAddress(SDValue Op,
 MachineBasicBlock *
 BPFTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
                                                MachineBasicBlock *BB) const {
-  unsigned Opc = MI->getOpcode();
-
   const TargetInstrInfo &TII = *BB->getParent()->getSubtarget().getInstrInfo();
   DebugLoc DL = MI->getDebugLoc();
 
-  assert(Opc == BPF::Select && "Unexpected instr type to insert");
+  assert(MI->getOpcode() == BPF::Select && "Unexpected instr type to insert");
 
   // To "insert" a SELECT instruction, we actually have to insert the diamond
   // control-flow pattern.  The incoming instruction knows the destination vreg
index 280d2f1e57f4fd5695b8199d7835b1ac107da016..32d2ef56351be1fbaaa017dc7dd332470f5b73a0 100644 (file)
@@ -76,9 +76,8 @@ unsigned BPFMCCodeEmitter::getMachineOpValue(const MCInst &MI,
   assert(MO.isExpr());
 
   const MCExpr *Expr = MO.getExpr();
-  MCExpr::ExprKind Kind = Expr->getKind();
 
-  assert(Kind == MCExpr::SymbolRef);
+  assert(Expr->getKind() == MCExpr::SymbolRef);
 
   if (MI.getOpcode() == BPF::JAL)
     // func call name