[llvm] r267073 - Fix some -Wunused-variable warnings in non-asserts builds.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 21 15:53:33 PDT 2016


Author: dblaikie
Date: Thu Apr 21 17:53:33 2016
New Revision: 267073

URL: http://llvm.org/viewvc/llvm-project?rev=267073&view=rev
Log:
Fix some -Wunused-variable warnings in non-asserts builds.

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp?rev=267073&r1=267072&r2=267073&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp Thu Apr 21 17:53:33 2016
@@ -68,13 +68,13 @@ RegisterBankInfo::RegisterBankInfo(unsig
 }
 
 bool RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const {
-  for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
+  DEBUG(for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
     const RegisterBank &RegBank = getRegBank(Idx);
     assert(Idx == RegBank.getID() &&
            "ID does not match the index in the array");
-    DEBUG(dbgs() << "Verify " << RegBank << '\n');
+    dbgs() << "Verify " << RegBank << '\n';
     assert(RegBank.verify(TRI) && "RegBank is invalid");
-  }
+  });
   return true;
 }
 
@@ -450,6 +450,7 @@ bool RegisterBankInfo::InstructionMappin
   for (unsigned Idx = 0; Idx < NumOperands; ++Idx) {
     const MachineOperand &MO = MI.getOperand(Idx);
     const RegisterBankInfo::ValueMapping &MOMapping = getOperandMapping(Idx);
+    (void)MOMapping;
     if (!MO.isReg()) {
       assert(MOMapping.BreakDown.empty() &&
              "We should not care about non-reg mapping");
@@ -460,8 +461,8 @@ bool RegisterBankInfo::InstructionMappin
       continue;
     // Register size in bits.
     // This size must match what the mapping expects.
-    unsigned RegSize = getSizeInBits(Reg, MRI, TRI);
-    assert(MOMapping.verify(RegSize) && "Value mapping is invalid");
+    assert(MOMapping.verify(getSizeInBits(Reg, MRI, TRI)) &&
+           "Value mapping is invalid");
   }
   return true;
 }




More information about the llvm-commits mailing list