[PATCH] D31866: Keep NDEBUG out of header

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:07:23 PDT 2017


jaykang10 created this revision.

Keep NDEBUG out of header in order to build llvm with cmake option -DCMAKE_CXX_FLAGS:STRING="-DLLVM_ENABLE_DUMP" -DCMAKE_BUILD_TYPE=RelWithDebInfo.


https://reviews.llvm.org/D31866

Files:
  include/llvm/CodeGen/MachineRegisterInfo.h
  include/llvm/CodeGen/MachineScheduler.h
  include/llvm/CodeGen/TargetSchedule.h
  include/llvm/MC/MCSchedule.h
  utils/TableGen/SubtargetEmitter.cpp


Index: utils/TableGen/SubtargetEmitter.cpp
===================================================================
--- utils/TableGen/SubtargetEmitter.cpp
+++ utils/TableGen/SubtargetEmitter.cpp
@@ -1236,11 +1236,7 @@
   OS << "#ifdef DBGFIELD\n"
      << "#error \"<target>GenSubtargetInfo.inc requires a DBGFIELD macro\"\n"
      << "#endif\n"
-     << "#ifndef NDEBUG\n"
-     << "#define DBGFIELD(x) x,\n"
-     << "#else\n"
-     << "#define DBGFIELD(x)\n"
-     << "#endif\n";
+     << "#define DBGFIELD(x) x,\n";
 
   if (SchedModels.hasItineraries()) {
     std::vector<std::vector<InstrItinerary>> ProcItinLists;
Index: include/llvm/MC/MCSchedule.h
===================================================================
--- include/llvm/MC/MCSchedule.h
+++ include/llvm/MC/MCSchedule.h
@@ -24,9 +24,7 @@
 
 /// Define a kind of processor resource that will be modeled by the scheduler.
 struct MCProcResourceDesc {
-#ifndef NDEBUG
   const char *Name;
-#endif
   unsigned NumUnits; // Number of resource of this kind
   unsigned SuperIdx; // Index of the resources kind that contains this kind.
 
@@ -102,9 +100,7 @@
   static const unsigned short InvalidNumMicroOps = UINT16_MAX;
   static const unsigned short VariantNumMicroOps = UINT16_MAX - 1;
 
-#ifndef NDEBUG
   const char* Name;
-#endif
   unsigned short NumMicroOps;
   bool     BeginGroup;
   bool     EndGroup;
Index: include/llvm/CodeGen/TargetSchedule.h
===================================================================
--- include/llvm/CodeGen/TargetSchedule.h
+++ include/llvm/CodeGen/TargetSchedule.h
@@ -112,13 +112,11 @@
     return SchedModel.getProcResource(PIdx);
   }
 
-#ifndef NDEBUG
   const char *getResourceName(unsigned PIdx) const {
     if (!PIdx)
       return "MOps";
     return SchedModel.getProcResource(PIdx)->Name;
   }
-#endif
 
   typedef const MCWriteProcResEntry *ProcResIter;
 
Index: include/llvm/CodeGen/MachineScheduler.h
===================================================================
--- include/llvm/CodeGen/MachineScheduler.h
+++ include/llvm/CodeGen/MachineScheduler.h
@@ -750,9 +750,7 @@
   /// available instruction, or NULL if there are multiple candidates.
   SUnit *pickOnlyChoice();
 
-#ifndef NDEBUG
   void dumpScheduledState();
-#endif
 };
 
 /// Base class for GenericScheduler. This class maintains information about
Index: include/llvm/CodeGen/MachineRegisterInfo.h
===================================================================
--- include/llvm/CodeGen/MachineRegisterInfo.h
+++ include/llvm/CodeGen/MachineRegisterInfo.h
@@ -573,9 +573,7 @@
   /// preserve conservative kill flag information.
   void clearKillFlags(unsigned Reg) const;
 
-#ifndef NDEBUG
   void dumpUses(unsigned RegNo) const;
-#endif
 
   /// Returns true if PhysReg is unallocatable and constant throughout the
   /// function. Writing to a constant register has no effect.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31866.94623.patch
Type: text/x-patch
Size: 2872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170410/dd5986f0/attachment.bin>


More information about the llvm-commits mailing list