Guard private fields that are unused in Release builds with #ifndef NDEBUG.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 16 Jun 2012 21:48:13 +0000 (21:48 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 16 Jun 2012 21:48:13 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158608 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LexicalScopes.h
lib/CodeGen/MachineScheduler.cpp
lib/CodeGen/RegAllocBasic.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp

index eb01f66c31294b2a10833642e84441ba12b80f36..8414c64544e5323c3030d6f64eaec133c58360e9 100644 (file)
@@ -158,7 +158,10 @@ class LexicalScope {
 public:
   LexicalScope(LexicalScope *P, const MDNode *D, const MDNode *I, bool A)
     : Parent(P), Desc(D), InlinedAtLocation(I), AbstractScope(A),
-      LastInsn(0), FirstInsn(0), DFSIn(0), DFSOut(0), IndentLevel(0) {
+      LastInsn(0), FirstInsn(0), DFSIn(0), DFSOut(0) {
+#ifndef NDEBUG
+    IndentLevel = 0;
+#endif
     if (Parent)
       Parent->addChild(this);
   }
@@ -241,7 +244,9 @@ private:
   const MachineInstr *FirstInsn;      // First instruction of this scope.
   unsigned DFSIn, DFSOut;             // In & Out Depth use to determine
                                       // scope nesting.
+#ifndef NDEBUG
   mutable unsigned IndentLevel;       // Private state for dump()
+#endif
 };
 
 } // end llvm namespace
index 1783cbe21ee7eeee78a681278eab3c38efb4994b..3b8e826e5aca935869014212da4f08965a0f58d8 100644 (file)
@@ -351,15 +351,21 @@ class ScheduleDAGMI : public ScheduleDAGInstrs {
   IntervalPressure BotPressure;
   RegPressureTracker BotRPTracker;
 
+#ifndef NDEBUG
   /// The number of instructions scheduled so far. Used to cut off the
   /// scheduler at the point determined by misched-cutoff.
   unsigned NumInstrsScheduled;
+#endif
 public:
   ScheduleDAGMI(MachineSchedContext *C, MachineSchedStrategy *S):
     ScheduleDAGInstrs(*C->MF, *C->MLI, *C->MDT, /*IsPostRA=*/false, C->LIS),
     AA(C->AA), RegClassInfo(C->RegClassInfo), SchedImpl(S),
     RPTracker(RegPressure), CurrentTop(), TopRPTracker(TopPressure),
-    CurrentBottom(), BotRPTracker(BotPressure), NumInstrsScheduled(0) {}
+    CurrentBottom(), BotRPTracker(BotPressure) {
+#ifndef NDEBUG
+    NumInstrsScheduled = 0;
+#endif
+  }
 
   ~ScheduleDAGMI() {
     delete SchedImpl;
index 1fa54cd74844e6f7b208eea222b6970d537ea7f1..73059ec0ab3c54db898154cf1eafdd09a6ebcb2c 100644 (file)
@@ -64,8 +64,10 @@ class RABasic : public MachineFunctionPass, public RegAllocBase
   // context
   MachineFunction *MF;
 
+#ifndef NDEBUG
   // analyses
   RenderMachineFunction *RMF;
+#endif
 
   // state
   std::auto_ptr<Spiller> SpillerInstance;
index 504c8bdffd1b37a5280599664a6df7253f4352cd..5427eec4dff9062260093a5cc0eeb4d53646b129 100644 (file)
@@ -186,12 +186,17 @@ namespace {
 
     JITEmitter &JE;
 
+#ifndef NDEBUG
     /// Instance of JIT corresponding to this Resolver.
     JIT *TheJIT;
+#endif
 
   public:
     explicit JITResolver(JIT &jit, JITEmitter &je)
-      : state(&jit), nextGOTIndex(0), JE(je), TheJIT(&jit) {
+      : state(&jit), nextGOTIndex(0), JE(je) {
+#ifndef NDEBUG
+      TheJIT = &jit;
+#endif
       LazyResolverFn = jit.getJITInfo().getLazyResolverFunction(JITCompilerFn);
     }