Move variable that's unused in an NDEBUG build inside the DEBUG() macro, fixing
authorNick Lewycky <nicholas@mxc.ca>
Fri, 10 Dec 2010 23:05:10 +0000 (23:05 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 10 Dec 2010 23:05:10 +0000 (23:05 +0000)
lib/CodeGen/RegAllocGreedy.cpp:233: error: unused variable 'TRC' [-Wunused-variable]

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

lib/CodeGen/RegAllocGreedy.cpp

index b527b9fe4eb8fbb15458c473104f2ea40153f073..e88016fbb374957feb4d08715d49fb3e48c674fd 100644 (file)
@@ -230,8 +230,10 @@ unsigned RAGreedy::selectOrSplit(LiveInterval &VirtReg,
   SmallVector<unsigned, 8> PhysRegSpillCands, ReassignCands;
 
   // Check for an available register in this class.
-  const TargetRegisterClass *TRC = MRI->getRegClass(VirtReg.reg);
-  DEBUG(dbgs() << "RegClass: " << TRC->getName() << ' ');
+  DEBUG({
+      const TargetRegisterClass *TRC = MRI->getRegClass(VirtReg.reg);
+      dbgs() << "RegClass: " << TRC->getName() << ' ');
+    });
 
   AllocationOrder Order(VirtReg.reg, *VRM, ReservedRegs);
   while (unsigned PhysReg = Order.next()) {
@@ -324,4 +326,3 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
 
   return true;
 }
-