Fix a warning about a variable which is only used in an assertion.
authorMatt Beaumont-Gay <matthewbg@google.com>
Tue, 7 Dec 2010 23:26:21 +0000 (23:26 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Tue, 7 Dec 2010 23:26:21 +0000 (23:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121206 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMMCCodeEmitter.cpp

index 0376a16e4b01b6e96c99b2363b4d116831b0afa1..229e00e65d44100f0861fd0528d21a1bc3c94d95 100644 (file)
@@ -667,9 +667,9 @@ getAddrModeThumbSPOpValue(const MCInst &MI, unsigned OpIdx,
                           SmallVectorImpl<MCFixup> &Fixups) const {
   // [SP, #imm]
   //   {7-0} = imm8
-  const MCOperand &MO = MI.getOperand(OpIdx);
   const MCOperand &MO1 = MI.getOperand(OpIdx + 1);
-  assert (MO.getReg() == ARM::SP && "Unexpected base register!");
+  assert (MI.getOperand(OpIdx).getReg() == ARM::SP &&
+          "Unexpected base register!");
   // The immediate is already shifted for the implicit zeroes, so no change
   // here.
   return MO1.getImm() & 0xff;