llvm.org GIT mirror llvm / de9cae2
Cleanup some problems with LLVM_ENABLE_DUMP in release builds, and always set LLVM_ENABLE_DUMP=ON for +Asserts builds. Differential Revision: https://reviews.llvm.org/D38306 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314346 91177308-0d34-0410-b5e6-96231b3b80d8 Don Hinton 2 years ago
10 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
387387 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
388388 option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
389389
390 option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" OFF)
391
390392 if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
391393 option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
392394 else()
393395 option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
394396 endif()
395397
398 if( LLVM_ENABLE_ASSERTIONS )
399 set(LLVM_ENABLE_DUMP ON)
400 endif()
401
396402 option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
397
398 option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" OFF)
399403
400404 set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
401405 "Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
8181 if(LLVM_ENABLE_EXPENSIVE_CHECKS)
8282 add_definitions(-DEXPENSIVE_CHECKS)
8383 add_definitions(-D_GLIBCXX_DEBUG)
84 endif()
85
86 if(LLVM_ENABLE_DUMP)
87 add_definitions(-DLLVM_ENABLE_DUMP)
8884 endif()
8985
9086 string(TOUPPER "${LLVM_ABI_BREAKING_CHECKS}" uppercase_LLVM_ABI_BREAKING_CHECKS)
574574 /// preserve conservative kill flag information.
575575 void clearKillFlags(unsigned Reg) const;
576576
577 #ifndef NDEBUG
578577 void dumpUses(unsigned RegNo) const;
579 #endif
580578
581579 /// Returns true if PhysReg is unallocatable and constant throughout the
582580 /// function. Writing to a constant register has no effect.
775775 /// available instruction, or NULL if there are multiple candidates.
776776 SUnit *pickOnlyChoice();
777777
778 #ifndef NDEBUG
779778 void dumpScheduledState() const;
780 #endif
781779 };
782780
783781 /// Base class for GenericScheduler. This class maintains information about
115115 return SchedModel.getProcResource(PIdx);
116116 }
117117
118 #ifndef NDEBUG
118 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
119119 const char *getResourceName(unsigned PIdx) const {
120120 if (!PIdx)
121121 return "MOps";
346346 /* Has gcc/MSVC atomic intrinsics */
347347 #cmakedefine01 LLVM_HAS_ATOMICS
348348
349 /* Define if LLVM_ENABLE_DUMP is enabled */
350 #cmakedefine LLVM_ENABLE_DUMP
351
349352 /* Host triple LLVM will be executed on */
350353 #cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
351354
2323
2424 /// Define a kind of processor resource that will be modeled by the scheduler.
2525 struct MCProcResourceDesc {
26 #ifndef NDEBUG
26 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2727 const char *Name;
2828 #endif
2929 unsigned NumUnits; // Number of resource of this kind
101101 static const unsigned short InvalidNumMicroOps = UINT16_MAX;
102102 static const unsigned short VariantNumMicroOps = UINT16_MAX - 1;
103103
104 #ifndef NDEBUG
104 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
105105 const char* Name;
106106 #endif
107107 unsigned short NumMicroOps;
354354
355355 } // end anonymous namespace
356356
357 #ifndef NDEBUG
357 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
358358 static void printDebugLoc(const DebugLoc &DL, raw_ostream &CommentOS,
359359 const LLVMContext &Ctx) {
360360 if (!DL)
3131 const char *ParentDebugType)
3232 : ScheduleHazardRecognizer(), DebugType(ParentDebugType), ItinData(II),
3333 DAG(SchedDAG) {
34 (void)DebugType;
3435 // Determine the maximum depth of any itinerary. This determines the depth of
3536 // the scoreboard. We always make the scoreboard at least 1 cycle deep to
3637 // avoid dealing with the boundary condition.
12361236 OS << "#ifdef DBGFIELD\n"
12371237 << "#error \"GenSubtargetInfo.inc requires a DBGFIELD macro\"\n"
12381238 << "#endif\n"
1239 << "#ifndef NDEBUG\n"
1239 << "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)\n"
12401240 << "#define DBGFIELD(x) x,\n"
12411241 << "#else\n"
12421242 << "#define DBGFIELD(x)\n"