[llvm-commits] [llvm] r51131 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

Evan Cheng evan.cheng at apple.com
Wed May 14 14:08:07 PDT 2008


Author: evancheng
Date: Wed May 14 16:08:07 2008
New Revision: 51131

URL: http://llvm.org/viewvc/llvm-project?rev=51131&view=rev
Log:
Use a better idiom to silence compiler warnings.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=51131&r1=51130&r2=51131&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed May 14 16:08:07 2008
@@ -406,11 +406,8 @@
     // Just use the input register directly!
     if (InstanceNo > 0)
       VRBaseMap.erase(SDOperand(Node, ResNo));
-#ifndef NDEBUG
     bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg));
-#else
-    VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg));
-#endif
+    isNew = isNew; // Silence compiler warning.
     assert(isNew && "Node emitted out of order - early");
     return;
   }
@@ -468,11 +465,8 @@
 
   if (InstanceNo > 0)
     VRBaseMap.erase(SDOperand(Node, ResNo));
-#ifndef NDEBUG
   bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase));
-#else
-  VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase));
-#endif
+  isNew = isNew; // Silence compiler warning.
   assert(isNew && "Node emitted out of order - early");
 }
 
@@ -529,11 +523,8 @@
       MI->addOperand(MachineOperand::CreateReg(VRBase, true));
     }
 
-#ifndef NDEBUG
     bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase));
-#else
-    VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase));
-#endif
+    isNew = isNew; // Silence compiler warning.
     assert(isNew && "Node emitted out of order - early");
   }
 }
@@ -785,11 +776,8 @@
   } else
     assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg");
      
-#ifndef NDEBUG
   bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase));
-#else
-  VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase));
-#endif
+  isNew = isNew; // Silence compiler warning.
   assert(isNew && "Node emitted out of order - early");
 }
 
@@ -1016,11 +1004,8 @@
       // Copy from physical register.
       assert(I->Reg && "Unknown physical register!");
       unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
-#ifndef NDEBUG
       bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase));
-#else
-      VRBaseMap.insert(std::make_pair(SU, VRBase));
-#endif
+      isNew = isNew; // Silence compiler warning.
       assert(isNew && "Node emitted out of order - early");
       TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg,
                         SU->CopyDstRC, SU->CopySrcRC);





More information about the llvm-commits mailing list