Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -388,15 +388,15 @@ option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) -option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" OFF) - if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF) + option(LLVM_FORCE_ENABLE_DUMP "Enable dump functions in release builds" OFF) else() option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON) + option(LLVM_FORCE_ENABLE_DUMP "Enable dump functions in release builds" ON) endif() -if( LLVM_ENABLE_ASSERTIONS ) +if( LLVM_ENABLE_ASSERTIONS OR LLVM_FORCE_ENABLE_DUMP ) set(LLVM_ENABLE_DUMP ON) endif() Index: bindings/ocaml/llvm/llvm_ocaml.c =================================================================== --- bindings/ocaml/llvm/llvm_ocaml.c +++ bindings/ocaml/llvm/llvm_ocaml.c @@ -336,7 +336,7 @@ /* lltype -> unit */ CAMLprim value llvm_dump_type(LLVMTypeRef Val) { -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVMDumpType(Val); #else caml_raise_with_arg(*caml_named_value("Llvm.FeatureDisabled"), Index: include/llvm/Analysis/DominanceFrontier.h =================================================================== --- include/llvm/Analysis/DominanceFrontier.h +++ include/llvm/Analysis/DominanceFrontier.h @@ -109,7 +109,7 @@ void print(raw_ostream &OS) const; /// dump - Dump the dominance frontier to dbgs(). -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() const; #endif }; Index: include/llvm/Analysis/DominanceFrontierImpl.h =================================================================== --- include/llvm/Analysis/DominanceFrontierImpl.h +++ include/llvm/Analysis/DominanceFrontierImpl.h @@ -148,7 +148,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP template void DominanceFrontierBase::dump() const { print(dbgs()); Index: include/llvm/Analysis/RegionInfo.h =================================================================== --- include/llvm/Analysis/RegionInfo.h +++ include/llvm/Analysis/RegionInfo.h @@ -437,7 +437,7 @@ void print(raw_ostream &OS, bool printTree = true, unsigned level = 0, PrintStyle Style = PrintNone) const; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// @brief Print the region to stderr. void dump() const; #endif @@ -805,7 +805,7 @@ static typename RegionT::PrintStyle printStyle; void print(raw_ostream &OS) const; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() const; #endif Index: include/llvm/Analysis/RegionInfoImpl.h =================================================================== --- include/llvm/Analysis/RegionInfoImpl.h +++ include/llvm/Analysis/RegionInfoImpl.h @@ -521,7 +521,7 @@ OS.indent(level * 2) << "} \n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP template void RegionBase::dump() const { print(dbgs(), true, getDepth(), RegionInfoBase::printStyle); @@ -789,7 +789,7 @@ OS << "End region tree\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP template void RegionInfoBase::dump() const { print(dbgs()); } #endif Index: include/llvm/CodeGen/TargetSchedule.h =================================================================== --- include/llvm/CodeGen/TargetSchedule.h +++ include/llvm/CodeGen/TargetSchedule.h @@ -116,7 +116,7 @@ return SchedModel.getProcResource(PIdx); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP const char *getResourceName(unsigned PIdx) const { if (!PIdx) return "MOps"; Index: include/llvm/Config/config.h.cmake =================================================================== --- include/llvm/Config/config.h.cmake +++ include/llvm/Config/config.h.cmake @@ -347,9 +347,6 @@ /* Has gcc/MSVC atomic intrinsics */ #cmakedefine01 LLVM_HAS_ATOMICS -/* Define if LLVM_ENABLE_DUMP is enabled */ -#cmakedefine LLVM_ENABLE_DUMP - /* Host triple LLVM will be executed on */ #cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}" Index: include/llvm/Config/llvm-config.h.cmake =================================================================== --- include/llvm/Config/llvm-config.h.cmake +++ include/llvm/Config/llvm-config.h.cmake @@ -14,6 +14,10 @@ #ifndef LLVM_CONFIG_H #define LLVM_CONFIG_H +/* Defined in debug builds and release builds if LLVM_FORCE_ENABLE_DUMP + or LLVM_ENABLE_ASSERTIONS */ +#cmakedefine LLVM_ENABLE_DUMP + /* Define if we link Polly to the tools */ #cmakedefine LINK_POLLY_INTO_TOOLS Index: include/llvm/IR/Attributes.h =================================================================== --- include/llvm/IR/Attributes.h +++ include/llvm/IR/Attributes.h @@ -283,7 +283,7 @@ iterator begin() const; iterator end() const; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() const; #endif }; Index: include/llvm/MC/MCSchedule.h =================================================================== --- include/llvm/MC/MCSchedule.h +++ include/llvm/MC/MCSchedule.h @@ -24,7 +24,7 @@ /// Define a kind of processor resource that will be modeled by the scheduler. struct MCProcResourceDesc { -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP const char *Name; #endif unsigned NumUnits; // Number of resource of this kind @@ -102,7 +102,7 @@ static const unsigned short InvalidNumMicroOps = UINT16_MAX; static const unsigned short VariantNumMicroOps = UINT16_MAX - 1; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP const char* Name; #endif unsigned short NumMicroOps; Index: include/llvm/Object/Wasm.h =================================================================== --- include/llvm/Object/Wasm.h +++ include/llvm/Object/Wasm.h @@ -87,7 +87,7 @@ << ", ImportIndex=" << ImportIndex; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; Index: include/llvm/Support/Compiler.h =================================================================== --- include/llvm/Support/Compiler.h +++ include/llvm/Support/Compiler.h @@ -442,10 +442,10 @@ /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. /// Note that you should also surround dump() functions with -/// `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` so they do always -/// get stripped in release builds. +/// `#ifdef LLVM_ENABLE_DUMP` so they do always get stripped in release builds +/// unless asserts are enabled.. // FIXME: Move this to a private config.h as it's not usable in public headers. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP #define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED #else #define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE Index: lib/Analysis/AliasSetTracker.cpp =================================================================== --- lib/Analysis/AliasSetTracker.cpp +++ lib/Analysis/AliasSetTracker.cpp @@ -648,7 +648,7 @@ OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void AliasSet::dump() const { print(dbgs()); } LLVM_DUMP_METHOD void AliasSetTracker::dump() const { print(dbgs()); } #endif Index: lib/Analysis/BlockFrequencyInfoImpl.cpp =================================================================== --- lib/Analysis/BlockFrequencyInfoImpl.cpp +++ lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -46,7 +46,7 @@ return ScaledNumber(getMass() + 1, -64); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void BlockMass::dump() const { print(dbgs()); } #endif Index: lib/Analysis/CallGraph.cpp =================================================================== --- lib/Analysis/CallGraph.cpp +++ lib/Analysis/CallGraph.cpp @@ -109,7 +109,7 @@ CN->print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void CallGraph::dump() const { print(dbgs()); } #endif @@ -178,7 +178,7 @@ OS << '\n'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void CallGraphNode::dump() const { print(dbgs()); } #endif @@ -292,7 +292,7 @@ G->print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void CallGraphWrapperPass::dump() const { print(dbgs(), nullptr); } #endif Index: lib/Analysis/DependenceAnalysis.cpp =================================================================== --- lib/Analysis/DependenceAnalysis.cpp +++ lib/Analysis/DependenceAnalysis.cpp @@ -385,7 +385,7 @@ Kind = Any; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // For debugging purposes. Dumps the constraint out to OS. LLVM_DUMP_METHOD void DependenceInfo::Constraint::dump(raw_ostream &OS) const { if (isEmpty()) Index: lib/Analysis/DominanceFrontier.cpp =================================================================== --- lib/Analysis/DominanceFrontier.cpp +++ lib/Analysis/DominanceFrontier.cpp @@ -59,7 +59,7 @@ DF.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const { print(dbgs()); } Index: lib/Analysis/IVUsers.cpp =================================================================== --- lib/Analysis/IVUsers.cpp +++ lib/Analysis/IVUsers.cpp @@ -340,7 +340,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void IVUsers::dump() const { print(dbgs()); } #endif Index: lib/Analysis/InlineCost.cpp =================================================================== --- lib/Analysis/InlineCost.cpp +++ lib/Analysis/InlineCost.cpp @@ -1700,7 +1700,7 @@ return Cost < std::max(1, Threshold); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// \brief Dump stats about this call's analysis. LLVM_DUMP_METHOD void CallAnalyzer::dump() { #define DEBUG_PRINT_STAT(x) dbgs() << " " #x ": " << x << "\n" Index: lib/Analysis/LazyCallGraph.cpp =================================================================== --- lib/Analysis/LazyCallGraph.cpp +++ lib/Analysis/LazyCallGraph.cpp @@ -137,7 +137,7 @@ F = &NewF; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LazyCallGraph::Node::dump() const { dbgs() << *this << '\n'; } @@ -207,7 +207,7 @@ return *this; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LazyCallGraph::SCC::dump() const { dbgs() << *this << '\n'; } @@ -281,7 +281,7 @@ LazyCallGraph::RefSCC::RefSCC(LazyCallGraph &G) : G(&G) {} -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LazyCallGraph::RefSCC::dump() const { dbgs() << *this << '\n'; } Index: lib/Analysis/LoopInfo.cpp =================================================================== --- lib/Analysis/LoopInfo.cpp +++ lib/Analysis/LoopInfo.cpp @@ -407,7 +407,7 @@ return nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Loop::dump() const { print(dbgs()); } LLVM_DUMP_METHOD void Loop::dumpVerbose() const { Index: lib/Analysis/MemorySSA.cpp =================================================================== --- lib/Analysis/MemorySSA.cpp +++ lib/Analysis/MemorySSA.cpp @@ -1622,7 +1622,7 @@ F.print(OS, &Writer); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MemorySSA::dump() const { print(dbgs()); } #endif @@ -1899,7 +1899,7 @@ void MemoryAccess::dump() const { // Cannot completely remove virtual function even in release mode. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP print(dbgs()); dbgs() << "\n"; #endif Index: lib/Analysis/PHITransAddr.cpp =================================================================== --- lib/Analysis/PHITransAddr.cpp +++ lib/Analysis/PHITransAddr.cpp @@ -41,7 +41,7 @@ return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void PHITransAddr::dump() const { if (!Addr) { dbgs() << "PHITransAddr: null\n"; Index: lib/Analysis/RegionInfo.cpp =================================================================== --- lib/Analysis/RegionInfo.cpp +++ lib/Analysis/RegionInfo.cpp @@ -152,7 +152,7 @@ RI.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegionInfoPass::dump() const { RI.dump(); } Index: lib/Analysis/ScalarEvolution.cpp =================================================================== --- lib/Analysis/ScalarEvolution.cpp +++ lib/Analysis/ScalarEvolution.cpp @@ -212,7 +212,7 @@ // Implementation of the SCEV class. // -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SCEV::dump() const { print(dbgs()); dbgs() << '\n'; Index: lib/Analysis/Trace.cpp =================================================================== --- lib/Analysis/Trace.cpp +++ lib/Analysis/Trace.cpp @@ -44,7 +44,7 @@ O << "; Trace parent function: \n" << *F; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// dump - Debugger convenience method; writes trace to standard error /// output stream. LLVM_DUMP_METHOD void Trace::dump() const { Index: lib/Bitcode/Writer/ValueEnumerator.cpp =================================================================== --- lib/Bitcode/Writer/ValueEnumerator.cpp +++ lib/Bitcode/Writer/ValueEnumerator.cpp @@ -465,7 +465,7 @@ return I->second-1; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ValueEnumerator::dump() const { print(dbgs(), ValueMap, "Default"); dbgs() << '\n'; Index: lib/CodeGen/AsmPrinter/DIE.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DIE.cpp +++ lib/CodeGen/AsmPrinter/DIE.cpp @@ -127,7 +127,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DIEAbbrev::dump() const { print(dbgs()); } @@ -267,7 +267,7 @@ O << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DIE::dump() const { print(dbgs()); } @@ -359,7 +359,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DIEValue::dump() const { print(dbgs()); } Index: lib/CodeGen/AsmPrinter/DebugLocEntry.h =================================================================== --- lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -76,7 +76,7 @@ const DIExpression *getExpression() const { return Expression; } friend bool operator==(const Value &, const Value &); friend bool operator<(const Value &, const Value &); -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { if (isLocation()) { llvm::dbgs() << "Loc = { reg=" << Loc.getReg() << " "; Index: lib/CodeGen/BranchRelaxation.cpp =================================================================== --- lib/CodeGen/BranchRelaxation.cpp +++ lib/CodeGen/BranchRelaxation.cpp @@ -138,7 +138,7 @@ #endif } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// print block size and offset information - debugging LLVM_DUMP_METHOD void BranchRelaxation::dumpBBs() { for (auto &MBB : *MF) { Index: lib/CodeGen/CodeGenPrepare.cpp =================================================================== --- lib/CodeGen/CodeGenPrepare.cpp +++ lib/CodeGen/CodeGenPrepare.cpp @@ -2698,7 +2698,7 @@ } #endif -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void ExtAddrMode::print(raw_ostream &OS) const { bool NeedPlus = false; OS << "["; Index: lib/CodeGen/GlobalISel/RegBankSelect.cpp =================================================================== --- lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -987,7 +987,7 @@ LocalFreq == Cost.LocalFreq; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegBankSelect::MappingCost::dump() const { print(dbgs()); dbgs() << '\n'; Index: lib/CodeGen/GlobalISel/RegisterBank.cpp =================================================================== --- lib/CodeGen/GlobalISel/RegisterBank.cpp +++ lib/CodeGen/GlobalISel/RegisterBank.cpp @@ -76,7 +76,7 @@ return &OtherRB == this; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegisterBank::dump(const TargetRegisterInfo *TRI) const { print(dbgs(), /* IsForDebug */ true, TRI); } Index: lib/CodeGen/GlobalISel/RegisterBankInfo.cpp =================================================================== --- lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -465,7 +465,7 @@ //------------------------------------------------------------------------------ // Helper classes implementation. //------------------------------------------------------------------------------ -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegisterBankInfo::PartialMapping::dump() const { print(dbgs()); dbgs() << '\n'; @@ -518,7 +518,7 @@ return true; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegisterBankInfo::ValueMapping::dump() const { print(dbgs()); dbgs() << '\n'; @@ -571,7 +571,7 @@ return true; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegisterBankInfo::InstructionMapping::dump() const { print(dbgs()); dbgs() << '\n'; @@ -694,7 +694,7 @@ return Res; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegisterBankInfo::OperandsMapper::dump() const { print(dbgs(), true); dbgs() << '\n'; Index: lib/CodeGen/InlineSpiller.cpp =================================================================== --- lib/CodeGen/InlineSpiller.cpp +++ lib/CodeGen/InlineSpiller.cpp @@ -706,7 +706,7 @@ return true; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD // Dump the range of instructions from B to E with their slot indexes. static void dumpMachineInstrRangeWithSlotIndex(MachineBasicBlock::iterator B, Index: lib/CodeGen/LexicalScopes.cpp =================================================================== --- lib/CodeGen/LexicalScopes.cpp +++ lib/CodeGen/LexicalScopes.cpp @@ -317,7 +317,7 @@ return Result; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LexicalScope::dump(unsigned Indent) const { raw_ostream &err = dbgs(); err.indent(Indent); Index: lib/CodeGen/LiveDebugValues.cpp =================================================================== --- lib/CodeGen/LiveDebugValues.cpp +++ lib/CodeGen/LiveDebugValues.cpp @@ -160,7 +160,7 @@ /// dominates MBB. bool dominates(MachineBasicBlock &MBB) const { return UVS.dominates(&MBB); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { MI.dump(); } #endif Index: lib/CodeGen/LiveDebugVariables.cpp =================================================================== --- lib/CodeGen/LiveDebugVariables.cpp +++ lib/CodeGen/LiveDebugVariables.cpp @@ -355,7 +355,7 @@ } // end anonymous namespace -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP static void printDebugLoc(const DebugLoc &DL, raw_ostream &CommentOS, const LLVMContext &Ctx) { if (!DL) @@ -1131,7 +1131,7 @@ return Pass::doInitialization(M); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveDebugVariables::dump() const { if (pImpl) static_cast(pImpl)->print(dbgs()); Index: lib/CodeGen/LiveInterval.cpp =================================================================== --- lib/CodeGen/LiveInterval.cpp +++ lib/CodeGen/LiveInterval.cpp @@ -944,7 +944,7 @@ return OS << '[' << S.start << ',' << S.end << ':' << S.valno->id << ')'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveRange::Segment::dump() const { dbgs() << *this << '\n'; } @@ -993,7 +993,7 @@ OS << SR; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveRange::dump() const { dbgs() << *this << '\n'; } @@ -1077,7 +1077,7 @@ // When they exist, Spills.back().start <= LastStart, // and WriteI[-1].start <= LastStart. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void LiveRangeUpdater::print(raw_ostream &OS) const { if (!isDirty()) { if (LR) Index: lib/CodeGen/LiveIntervalAnalysis.cpp =================================================================== --- lib/CodeGen/LiveIntervalAnalysis.cpp +++ lib/CodeGen/LiveIntervalAnalysis.cpp @@ -179,7 +179,7 @@ MF->print(OS, Indexes); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveIntervals::dumpInstrs() const { printInstrs(dbgs()); } Index: lib/CodeGen/LivePhysRegs.cpp =================================================================== --- lib/CodeGen/LivePhysRegs.cpp +++ lib/CodeGen/LivePhysRegs.cpp @@ -130,7 +130,7 @@ OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LivePhysRegs::dump() const { dbgs() << " " << *this; } Index: lib/CodeGen/LiveVariables.cpp =================================================================== --- lib/CodeGen/LiveVariables.cpp +++ lib/CodeGen/LiveVariables.cpp @@ -64,7 +64,7 @@ return nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveVariables::VarInfo::dump() const { dbgs() << " Alive in blocks: "; for (SparseBitVector<>::iterator I = AliveBlocks.begin(), Index: lib/CodeGen/MachineBasicBlock.cpp =================================================================== --- lib/CodeGen/MachineBasicBlock.cpp +++ lib/CodeGen/MachineBasicBlock.cpp @@ -222,7 +222,7 @@ return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineBasicBlock::dump() const { print(dbgs()); } Index: lib/CodeGen/MachineFrameInfo.cpp =================================================================== --- lib/CodeGen/MachineFrameInfo.cpp +++ lib/CodeGen/MachineFrameInfo.cpp @@ -242,7 +242,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineFrameInfo::dump(const MachineFunction &MF) const { print(MF, dbgs()); } Index: lib/CodeGen/MachineFunction.cpp =================================================================== --- lib/CodeGen/MachineFunction.cpp +++ lib/CodeGen/MachineFunction.cpp @@ -447,7 +447,7 @@ return Dest; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineFunction::dump() const { print(dbgs()); } @@ -882,7 +882,7 @@ OS << '\n'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineJumpTableInfo::dump() const { print(dbgs()); } #endif @@ -1038,6 +1038,6 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineConstantPool::dump() const { print(dbgs()); } #endif Index: lib/CodeGen/MachineInstr.cpp =================================================================== --- lib/CodeGen/MachineInstr.cpp +++ lib/CodeGen/MachineInstr.cpp @@ -566,7 +566,7 @@ OS << "[TF=" << TF << ']'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineOperand::dump() const { dbgs() << *this << '\n'; } @@ -1869,7 +1869,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineInstr::dump() const { dbgs() << " "; print(dbgs()); Index: lib/CodeGen/MachineLoopInfo.cpp =================================================================== --- lib/CodeGen/MachineLoopInfo.cpp +++ lib/CodeGen/MachineLoopInfo.cpp @@ -138,7 +138,7 @@ return Preheader; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineLoop::dump() const { print(dbgs()); } Index: lib/CodeGen/MachinePipeliner.cpp =================================================================== --- lib/CodeGen/MachinePipeliner.cpp +++ lib/CodeGen/MachinePipeliner.cpp @@ -557,7 +557,7 @@ os << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; @@ -3961,7 +3961,7 @@ DEBUG(dump();); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// Print the schedule information to the given output. void SMSchedule::print(raw_ostream &os) const { // Iterate over each cycle. Index: lib/CodeGen/MachineRegionInfo.cpp =================================================================== --- lib/CodeGen/MachineRegionInfo.cpp +++ lib/CodeGen/MachineRegionInfo.cpp @@ -118,7 +118,7 @@ RI.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineRegionInfoPass::dump() const { RI.dump(); } Index: lib/CodeGen/MachineRegisterInfo.cpp =================================================================== --- lib/CodeGen/MachineRegisterInfo.cpp +++ lib/CodeGen/MachineRegisterInfo.cpp @@ -458,7 +458,7 @@ return TRC.getLaneMask(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineRegisterInfo::dumpUses(unsigned Reg) const { for (MachineInstr &I : use_instructions(Reg)) I.dump(); Index: lib/CodeGen/MachineScheduler.cpp =================================================================== --- lib/CodeGen/MachineScheduler.cpp +++ lib/CodeGen/MachineScheduler.cpp @@ -581,7 +581,7 @@ // unimplemented } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ReadyQueue::dump() const { dbgs() << "Queue " << Name << ": "; for (const SUnit *SU : Queue) @@ -919,7 +919,7 @@ FirstDbgValue = nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ScheduleDAGMI::dumpSchedule() const { for (MachineBasicBlock::iterator MI = begin(), ME = end(); MI != ME; ++MI) { if (SUnit *SU = getSUnit(&(*MI))) @@ -2352,7 +2352,7 @@ return nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // This is useful information to dump after bumpNode. // Note that the Queue contents are more useful before pickNodeFromQueue. LLVM_DUMP_METHOD void SchedBoundary::dumpScheduledState() const { @@ -2696,7 +2696,7 @@ void GenericScheduler::dumpPolicy() const { // Cannot completely remove virtual function even in release mode. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP dbgs() << "GenericScheduler RegionPolicy: " << " ShouldTrackPressure=" << RegionPolicy.ShouldTrackPressure << " OnlyTopDown=" << RegionPolicy.OnlyTopDown Index: lib/CodeGen/PostRASchedulerList.cpp =================================================================== --- lib/CodeGen/PostRASchedulerList.cpp +++ lib/CodeGen/PostRASchedulerList.cpp @@ -251,7 +251,7 @@ ScheduleDAGInstrs::exitRegion(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// dumpSchedule - dump the scheduled Sequence. LLVM_DUMP_METHOD void SchedulePostRATDList::dumpSchedule() const { for (unsigned i = 0, e = Sequence.size(); i != e; i++) { Index: lib/CodeGen/RegAllocPBQP.cpp =================================================================== --- lib/CodeGen/RegAllocPBQP.cpp +++ lib/CodeGen/RegAllocPBQP.cpp @@ -868,7 +868,7 @@ }); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void PBQP::RegAlloc::PBQPRAGraph::dump(raw_ostream &OS) const { for (auto NId : nodeIds()) { const Vector &Costs = getNodeCosts(NId); Index: lib/CodeGen/RegisterPressure.cpp =================================================================== --- lib/CodeGen/RegisterPressure.cpp +++ lib/CodeGen/RegisterPressure.cpp @@ -76,7 +76,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void llvm::dumpRegSetPressure(ArrayRef SetPressure, const TargetRegisterInfo *TRI) { Index: lib/CodeGen/SafeStackColoring.cpp =================================================================== --- lib/CodeGen/SafeStackColoring.cpp +++ lib/CodeGen/SafeStackColoring.cpp @@ -237,7 +237,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void StackColoring::dumpAllocas() { dbgs() << "Allocas:\n"; for (unsigned AllocaNo = 0; AllocaNo < NumAllocas; ++AllocaNo) Index: lib/CodeGen/ScheduleDAG.cpp =================================================================== --- lib/CodeGen/ScheduleDAG.cpp +++ lib/CodeGen/ScheduleDAG.cpp @@ -335,7 +335,7 @@ std::swap(*Preds.begin(), *BestI); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD raw_ostream &SUnit::print(raw_ostream &OS, const SUnit *Entry, const SUnit *Exit) const { Index: lib/CodeGen/ScheduleDAGInstrs.cpp =================================================================== --- lib/CodeGen/ScheduleDAGInstrs.cpp +++ lib/CodeGen/ScheduleDAGInstrs.cpp @@ -97,7 +97,7 @@ } static void dumpSUList(ScheduleDAGInstrs::SUList &L) { -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP dbgs() << "{ "; for (const SUnit *su : L) { dbgs() << "SU(" << su->NodeNum << ")"; @@ -1089,7 +1089,7 @@ void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const { // Cannot completely remove virtual function even in release mode. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP SU->getInstr()->dump(); #endif } @@ -1401,7 +1401,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ILPValue::print(raw_ostream &OS) const { OS << InstrCount << " / " << Length << " = "; if (!Length) Index: lib/CodeGen/ScoreboardHazardRecognizer.cpp =================================================================== --- lib/CodeGen/ScoreboardHazardRecognizer.cpp +++ lib/CodeGen/ScoreboardHazardRecognizer.cpp @@ -83,7 +83,7 @@ ReservedScoreboard.reset(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ScoreboardHazardRecognizer::Scoreboard::dump() const { dbgs() << "Scoreboard:\n"; Index: lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp =================================================================== --- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1824,7 +1824,7 @@ return V; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump(ScheduleDAG *DAG) const override { // Emulate pop() without clobbering NodeQueueIds. std::vector DumpQueue = Queue; @@ -2001,7 +2001,7 @@ // Register Pressure Tracking //===----------------------------------------------------------------------===// -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegReductionPQBase::dumpRegPressure() const { for (const TargetRegisterClass *RC : TRI->regclasses()) { unsigned Id = RC->getID(); Index: lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp =================================================================== --- lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -651,7 +651,7 @@ void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const { // Cannot completely remove virtual function even in release mode. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP if (!SU->getNode()) { dbgs() << "PHYS REG COPY\n"; return; @@ -671,7 +671,7 @@ #endif } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void ScheduleDAGSDNodes::dumpSchedule() const { for (unsigned i = 0, e = Sequence.size(); i != e; i++) { if (SUnit *SU = Sequence[i]) Index: lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -383,7 +383,7 @@ }); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SDNode::dump() const { dump(nullptr); } LLVM_DUMP_METHOD void SDNode::dump(const SelectionDAG *G) const { print(dbgs(), G); @@ -585,7 +585,7 @@ return Node.getNumOperands() == 0; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) { for (const SDValue &Op : N->op_values()) { if (shouldPrintInline(*Op.getNode())) @@ -639,7 +639,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP typedef SmallPtrSet VisitedSDNodeSet; static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, const SelectionDAG *G, VisitedSDNodeSet &once) { @@ -711,7 +711,7 @@ printrWithDepth(OS, G, 10); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SDNode::dumprWithDepth(const SelectionDAG *G, unsigned depth) const { printrWithDepth(dbgs(), G, depth); Index: lib/CodeGen/SlotIndexes.cpp =================================================================== --- lib/CodeGen/SlotIndexes.cpp +++ lib/CodeGen/SlotIndexes.cpp @@ -250,7 +250,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SlotIndexes::dump() const { for (IndexList::const_iterator itr = indexList.begin(); itr != indexList.end(); ++itr) { @@ -277,7 +277,7 @@ os << "invalid"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // Dump a SlotIndex to stderr. LLVM_DUMP_METHOD void SlotIndex::dump() const { print(dbgs()); Index: lib/CodeGen/SplitKit.cpp =================================================================== --- lib/CodeGen/SplitKit.cpp +++ lib/CodeGen/SplitKit.cpp @@ -392,7 +392,7 @@ Edit->anyRematerializable(nullptr); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SplitEditor::dump() const { if (RegAssign.empty()) { dbgs() << " empty\n"; Index: lib/CodeGen/StackColoring.cpp =================================================================== --- lib/CodeGen/StackColoring.cpp +++ lib/CodeGen/StackColoring.cpp @@ -511,7 +511,7 @@ MachineFunctionPass::getAnalysisUsage(AU); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void StackColoring::dumpBV(const char *tag, const BitVector &BV) const { dbgs() << tag << " : { "; Index: lib/CodeGen/TargetRegisterInfo.cpp =================================================================== --- lib/CodeGen/TargetRegisterInfo.cpp +++ lib/CodeGen/TargetRegisterInfo.cpp @@ -424,7 +424,7 @@ return true; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void TargetRegisterInfo::dumpReg(unsigned Reg, unsigned SubRegIndex, const TargetRegisterInfo *TRI) { Index: lib/CodeGen/VirtRegMap.cpp =================================================================== --- lib/CodeGen/VirtRegMap.cpp +++ lib/CodeGen/VirtRegMap.cpp @@ -156,7 +156,7 @@ OS << '\n'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void VirtRegMap::dump() const { print(dbgs()); } Index: lib/IR/AsmWriter.cpp =================================================================== --- lib/IR/AsmWriter.cpp +++ lib/IR/AsmWriter.cpp @@ -3623,7 +3623,7 @@ printMetadataImpl(OS, *this, MST, M, /* OnlyAsOperand */ false); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // Value::dump - allow easy printing of Values from the debugger. LLVM_DUMP_METHOD void Value::dump() const { print(dbgs(), /*IsForDebug=*/true); dbgs() << '\n'; } Index: lib/IR/Attributes.cpp =================================================================== --- lib/IR/Attributes.cpp +++ lib/IR/Attributes.cpp @@ -619,7 +619,7 @@ return SetNode ? SetNode->end() : nullptr; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void AttributeSet::dump() const { dbgs() << "AS =\n"; dbgs() << " { "; @@ -830,7 +830,7 @@ ID.AddPointer(Set.SetNode); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void AttributeListImpl::dump() const { AttributeList(const_cast(this)).dump(); } @@ -1290,7 +1290,7 @@ return pImpl ? pImpl->NumAttrSets : 0; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void AttributeList::dump() const { dbgs() << "PAL[\n"; Index: lib/IR/ConstantRange.cpp =================================================================== --- lib/IR/ConstantRange.cpp +++ lib/IR/ConstantRange.cpp @@ -939,7 +939,7 @@ OS << "[" << Lower << "," << Upper << ")"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ConstantRange::dump() const { print(dbgs()); } Index: lib/IR/Core.cpp =================================================================== --- lib/IR/Core.cpp +++ lib/IR/Core.cpp @@ -358,7 +358,7 @@ return wrap(&unwrap(Ty)->getContext()); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LLVMDumpType(LLVMTypeRef Ty) { return unwrap(Ty)->dump(); } Index: lib/IR/DebugLoc.cpp =================================================================== --- lib/IR/DebugLoc.cpp +++ lib/IR/DebugLoc.cpp @@ -99,7 +99,7 @@ return Last; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DebugLoc::dump() const { if (!Loc) return; Index: lib/IR/GCOV.cpp =================================================================== --- lib/IR/GCOV.cpp +++ lib/IR/GCOV.cpp @@ -108,7 +108,7 @@ FPtr->print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// dump - Dump GCOVFile content to dbgs() for debugging purposes. LLVM_DUMP_METHOD void GCOVFile::dump() const { print(dbgs()); @@ -356,7 +356,7 @@ Block->print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// dump - Dump GCOVFunction content to dbgs() for debugging purposes. LLVM_DUMP_METHOD void GCOVFunction::dump() const { print(dbgs()); @@ -434,7 +434,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// dump - Dump GCOVBlock content to dbgs() for debugging purposes. LLVM_DUMP_METHOD void GCOVBlock::dump() const { print(dbgs()); Index: lib/IR/Pass.cpp =================================================================== --- lib/IR/Pass.cpp +++ lib/IR/Pass.cpp @@ -124,7 +124,7 @@ OS << "Pass::print not implemented for pass: '" << getPassName() << "'!\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // dump - call print(cerr); LLVM_DUMP_METHOD void Pass::dump() const { print(dbgs(), nullptr); Index: lib/IR/ValueSymbolTable.cpp =================================================================== --- lib/IR/ValueSymbolTable.cpp +++ lib/IR/ValueSymbolTable.cpp @@ -100,7 +100,7 @@ return makeUniqueName(V, UniqueName); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // dump - print out the symbol table // LLVM_DUMP_METHOD void ValueSymbolTable::dump() const { Index: lib/MC/MCExpr.cpp =================================================================== --- lib/MC/MCExpr.cpp +++ lib/MC/MCExpr.cpp @@ -136,7 +136,7 @@ llvm_unreachable("Invalid expression kind!"); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCExpr::dump() const { dbgs() << *this; dbgs() << '\n'; Index: lib/MC/MCFragment.cpp =================================================================== --- lib/MC/MCFragment.cpp +++ lib/MC/MCFragment.cpp @@ -306,7 +306,7 @@ } // end namespace llvm -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCFragment::dump() const { raw_ostream &OS = errs(); Index: lib/MC/MCInst.cpp =================================================================== --- lib/MC/MCInst.cpp +++ lib/MC/MCInst.cpp @@ -35,7 +35,7 @@ OS << ">"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCOperand::dump() const { print(dbgs()); dbgs() << "\n"; @@ -66,7 +66,7 @@ OS << ">"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCInst::dump() const { print(dbgs()); dbgs() << "\n"; Index: lib/MC/MCLabel.cpp =================================================================== --- lib/MC/MCLabel.cpp +++ lib/MC/MCLabel.cpp @@ -18,7 +18,7 @@ OS << '"' << getInstance() << '"'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCLabel::dump() const { print(dbgs()); } Index: lib/MC/MCParser/MCAsmParser.cpp =================================================================== --- lib/MC/MCParser/MCAsmParser.cpp +++ lib/MC/MCParser/MCAsmParser.cpp @@ -131,7 +131,7 @@ void MCParsedAsmOperand::dump() const { // Cannot completely remove virtual function even in release mode. -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP dbgs() << " " << *this; #endif } Index: lib/MC/MCSection.cpp =================================================================== --- lib/MC/MCSection.cpp +++ lib/MC/MCSection.cpp @@ -85,7 +85,7 @@ return IP; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCSection::dump() const { raw_ostream &OS = errs(); Index: lib/MC/MCSymbol.cpp =================================================================== --- lib/MC/MCSymbol.cpp +++ lib/MC/MCSymbol.cpp @@ -81,7 +81,7 @@ OS << '"'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCSymbol::dump() const { dbgs() << *this; } Index: lib/MC/MCValue.cpp =================================================================== --- lib/MC/MCValue.cpp +++ lib/MC/MCValue.cpp @@ -37,7 +37,7 @@ OS << " + " << getConstant(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCValue::dump() const { print(dbgs()); } Index: lib/MC/SubtargetFeature.cpp =================================================================== --- lib/MC/SubtargetFeature.cpp +++ lib/MC/SubtargetFeature.cpp @@ -256,7 +256,7 @@ OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SubtargetFeatures::dump() const { print(dbgs()); } Index: lib/MC/WasmObjectWriter.cpp =================================================================== --- lib/MC/WasmObjectWriter.cpp +++ lib/MC/WasmObjectWriter.cpp @@ -168,7 +168,7 @@ << ", FixupSection=" << FixupSection->getSectionName(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; Index: lib/Option/Arg.cpp =================================================================== --- lib/Option/Arg.cpp +++ lib/Option/Arg.cpp @@ -61,7 +61,7 @@ O << "]>\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Arg::dump() const { print(dbgs()); } #endif Index: lib/Option/ArgList.cpp =================================================================== --- lib/Option/ArgList.cpp +++ lib/Option/ArgList.cpp @@ -204,7 +204,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ArgList::dump() const { print(dbgs()); } #endif Index: lib/Option/Option.cpp =================================================================== --- lib/Option/Option.cpp +++ lib/Option/Option.cpp @@ -86,7 +86,7 @@ O << ">\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Option::dump() const { print(dbgs()); } #endif Index: lib/ProfileData/SampleProf.cpp =================================================================== --- lib/ProfileData/SampleProf.cpp +++ lib/ProfileData/SampleProf.cpp @@ -82,7 +82,7 @@ return OS; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LineLocation::dump() const { print(dbgs()); } #endif @@ -97,7 +97,7 @@ OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SampleRecord::dump() const { print(dbgs(), 0); } #endif @@ -150,6 +150,6 @@ return OS; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void FunctionSamples::dump() const { print(dbgs(), 0); } #endif Index: lib/Support/APFloat.cpp =================================================================== --- lib/Support/APFloat.cpp +++ lib/Support/APFloat.cpp @@ -4486,7 +4486,7 @@ OS << Buffer << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void APFloat::dump() const { print(dbgs()); } #endif Index: lib/Support/APInt.cpp =================================================================== --- lib/Support/APInt.cpp +++ lib/Support/APInt.cpp @@ -2120,7 +2120,7 @@ return S.str(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void APInt::dump() const { SmallString<40> S, U; this->toStringUnsigned(U); Index: lib/Support/BranchProbability.cpp =================================================================== --- lib/Support/BranchProbability.cpp +++ lib/Support/BranchProbability.cpp @@ -32,7 +32,7 @@ Percent); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void BranchProbability::dump() const { print(dbgs()) << '\n'; } #endif Index: lib/Support/Twine.cpp =================================================================== --- lib/Support/Twine.cpp +++ lib/Support/Twine.cpp @@ -173,7 +173,7 @@ OS << ")"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Twine::dump() const { print(dbgs()); } Index: lib/TableGen/Record.cpp =================================================================== --- lib/TableGen/Record.cpp +++ lib/TableGen/Record.cpp @@ -48,7 +48,7 @@ StringRecTy StringRecTy::Shared; DagRecTy DagRecTy::Shared; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RecTy::dump() const { print(errs()); } #endif @@ -172,7 +172,7 @@ void Init::anchor() {} -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Init::dump() const { return print(errs()); } #endif @@ -1581,7 +1581,7 @@ return cast(getNameInit())->getValue(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RecordVal::dump() const { errs() << *this; } #endif @@ -1660,7 +1660,7 @@ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Record::dump() const { errs() << *this; } #endif @@ -1854,7 +1854,7 @@ FieldName + "' does not have a dag initializer!"); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MultiClass::dump() const { errs() << "Record:\n"; Rec.dump(); Index: lib/TableGen/TGParser.cpp =================================================================== --- lib/TableGen/TGParser.cpp +++ lib/TableGen/TGParser.cpp @@ -54,7 +54,7 @@ void dump() const; }; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SubMultiClassReference::dump() const { errs() << "Multiclass:\n"; Index: lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp +++ lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp @@ -261,7 +261,7 @@ return phiInfoElementGetSources(findPHIInfoElement(DestReg)).size(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void PHILinearize::dump(MachineRegisterInfo *MRI) { const TargetRegisterInfo *TRI = MRI->getTargetRegisterInfo(); dbgs() << "=PHIInfo Start=\n"; Index: lib/Target/AMDGPU/GCNIterativeScheduler.cpp =================================================================== --- lib/Target/AMDGPU/GCNIterativeScheduler.cpp +++ lib/Target/AMDGPU/GCNIterativeScheduler.cpp @@ -52,7 +52,7 @@ return SU.getInstr(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD static void printRegion(raw_ostream &OS, MachineBasicBlock::iterator Begin, Index: lib/Target/AMDGPU/GCNRegPressure.cpp =================================================================== --- lib/Target/AMDGPU/GCNRegPressure.cpp +++ lib/Target/AMDGPU/GCNRegPressure.cpp @@ -31,7 +31,7 @@ #define DEBUG_TYPE "machine-scheduler" -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void llvm::printLivesAt(SlotIndex SI, const LiveIntervals &LIS, @@ -175,7 +175,7 @@ (getVGPRNum() < O.getVGPRNum()); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void GCNRegPressure::print(raw_ostream &OS, const SISubtarget *ST) const { OS << "VGPRs: " << getVGPRNum(); @@ -433,7 +433,7 @@ return advance(End); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD static void reportMismatch(const GCNRPTracker::LiveRegSet &LISLR, const GCNRPTracker::LiveRegSet &TrackedLR, Index: lib/Target/ARM/ARMConstantIslandPass.cpp =================================================================== --- lib/Target/ARM/ARMConstantIslandPass.cpp +++ lib/Target/ARM/ARMConstantIslandPass.cpp @@ -320,7 +320,7 @@ #endif } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// print block size and offset information - debugging LLVM_DUMP_METHOD void ARMConstantIslands::dumpBBs() { DEBUG({ Index: lib/Target/ARM/ARMConstantPoolValue.cpp =================================================================== --- lib/Target/ARM/ARMConstantPoolValue.cpp +++ lib/Target/ARM/ARMConstantPoolValue.cpp @@ -97,7 +97,7 @@ return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ARMConstantPoolValue::dump() const { errs() << " " << *this; } Index: lib/Target/Hexagon/HexagonSplitDouble.cpp =================================================================== --- lib/Target/Hexagon/HexagonSplitDouble.cpp +++ lib/Target/Hexagon/HexagonSplitDouble.cpp @@ -131,7 +131,7 @@ INITIALIZE_PASS(HexagonSplitDoubleRegs, "hexagon-split-double", "Hexagon Split Double Registers", false, false) -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void HexagonSplitDoubleRegs::dump_partition(raw_ostream &os, const USet &Part, const TargetRegisterInfo &TRI) { dbgs() << '{'; Index: lib/Target/MSP430/MSP430ISelDAGToDAG.cpp =================================================================== --- lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -61,7 +61,7 @@ return GV != nullptr || CP != nullptr || ES != nullptr || JT != -1; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() { errs() << "MSP430ISelAddressMode " << this << '\n'; if (BaseType == RegBase && Base.Reg.getNode() != nullptr) { Index: lib/Target/Mips/MipsConstantIslandPass.cpp =================================================================== --- lib/Target/Mips/MipsConstantIslandPass.cpp +++ lib/Target/Mips/MipsConstantIslandPass.cpp @@ -425,7 +425,7 @@ U.getMaxDisp(), U.NegOk); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// print block size and offset information - debugging LLVM_DUMP_METHOD void MipsConstantIslands::dumpBBs() { for (unsigned J = 0, E = BBInfo.size(); J !=E; ++J) { Index: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp =================================================================== --- lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -953,7 +953,7 @@ return Changed; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP // For debug purposes, dump the contents of the swap vector. LLVM_DUMP_METHOD void PPCVSXSwapRemoval::dumpSwapVector() { Index: lib/Target/X86/X86FloatingPoint.cpp =================================================================== --- lib/Target/X86/X86FloatingPoint.cpp +++ lib/Target/X86/X86FloatingPoint.cpp @@ -169,7 +169,7 @@ // Shuffle live registers to match the expectations of successor blocks. void finishBlockStack(); -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dumpStack() const { dbgs() << "Stack contents:"; for (unsigned i = 0; i != StackTop; ++i) { Index: lib/Target/X86/X86ISelDAGToDAG.cpp =================================================================== --- lib/Target/X86/X86ISelDAGToDAG.cpp +++ lib/Target/X86/X86ISelDAGToDAG.cpp @@ -102,7 +102,7 @@ Base_Reg = Reg; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() { dbgs() << "X86ISelAddressMode " << this << '\n'; dbgs() << "Base_Reg "; Index: lib/Transforms/Coroutines/CoroFrame.cpp =================================================================== --- lib/Transforms/Coroutines/CoroFrame.cpp +++ lib/Transforms/Coroutines/CoroFrame.cpp @@ -133,7 +133,7 @@ }; } // end anonymous namespace -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SuspendCrossingInfo::dump(StringRef Label, BitVector const &BV) const { dbgs() << Label << ":"; Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -645,7 +645,7 @@ return PA; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void GVN::dump(DenseMap& d) const { errs() << "{\n"; for (DenseMap::iterator I = d.begin(), Index: lib/Transforms/Scalar/LoopStrengthReduce.cpp =================================================================== --- lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -195,7 +195,7 @@ } // end anonymous namespace -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void RegSortData::print(raw_ostream &OS) const { OS << "[NumUses=" << UsedByIndices.count() << ']'; } @@ -562,7 +562,7 @@ return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void Formula::print(raw_ostream &OS) const { bool First = true; if (BaseGV) { @@ -1357,7 +1357,7 @@ return TTI.isLSRCostLess(C, Other.C); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void Cost::print(raw_ostream &OS) const { if (InsnsCost) OS << C.Insns << " instruction" << (C.Insns == 1 ? " " : "s "); @@ -1401,7 +1401,7 @@ return !L->contains(UserInst); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void LSRFixup::print(raw_ostream &OS) const { OS << "UserInst="; // Store is common and interesting enough to be worth special-casing. @@ -1507,7 +1507,7 @@ RegUses.dropRegister(S, LUIdx); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void LSRUse::print(raw_ostream &OS) const { OS << "LSR Use: Kind="; switch (Kind) { @@ -3880,7 +3880,7 @@ } // end anonymous namespace -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void WorkItem::print(raw_ostream &OS) const { OS << "in formulae referencing " << *OrigReg << " in use " << LUIdx << " , add offset " << Imm; @@ -5341,7 +5341,7 @@ ImplementSolution(Solution); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void LSRInstance::print_factors_and_types(raw_ostream &OS) const { if (Factors.empty() && Types.empty()) return; Index: lib/Transforms/Scalar/SROA.cpp =================================================================== --- lib/Transforms/Scalar/SROA.cpp +++ lib/Transforms/Scalar/SROA.cpp @@ -292,7 +292,7 @@ /// need to replace with undef. ArrayRef getDeadOperands() const { return DeadOperands; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void print(raw_ostream &OS, const_iterator I, StringRef Indent = " ") const; void printSlice(raw_ostream &OS, const_iterator I, StringRef Indent = " ") const; @@ -309,7 +309,7 @@ friend class AllocaSlices::SliceBuilder; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP /// \brief Handle to alloca instruction to simplify method interfaces. AllocaInst &AI; #endif @@ -1027,7 +1027,7 @@ AllocaSlices::AllocaSlices(const DataLayout &DL, AllocaInst &AI) : -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP AI(AI), #endif PointerEscapingInstr(nullptr) { @@ -1059,7 +1059,7 @@ std::sort(Slices.begin(), Slices.end()); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void AllocaSlices::print(raw_ostream &OS, const_iterator I, StringRef Indent) const { @@ -1098,7 +1098,7 @@ } LLVM_DUMP_METHOD void AllocaSlices::dump() const { print(dbgs()); } -#endif // !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#endif // LLVM_ENABLE_DUMP /// Walk the range of a partitioning looking for a common type to cover this /// sequence of slices. Index: utils/TableGen/AsmMatcherEmitter.cpp =================================================================== --- utils/TableGen/AsmMatcherEmitter.cpp +++ utils/TableGen/AsmMatcherEmitter.cpp @@ -763,7 +763,7 @@ } // end anonymous namespace -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MatchableInfo::dump() const { errs() << TheDef->getName() << " -- " << "flattened:\"" << AsmString <<"\"\n"; Index: utils/TableGen/SubtargetEmitter.cpp =================================================================== --- utils/TableGen/SubtargetEmitter.cpp +++ utils/TableGen/SubtargetEmitter.cpp @@ -1237,7 +1237,7 @@ OS << "#ifdef DBGFIELD\n" << "#error \"GenSubtargetInfo.inc requires a DBGFIELD macro\"\n" << "#endif\n" - << "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)\n" + << "#ifdef LLVM_ENABLE_DUMP\n" << "#define DBGFIELD(x) x,\n" << "#else\n" << "#define DBGFIELD(x)\n" Index: utils/TableGen/SubtargetFeatureInfo.cpp =================================================================== --- utils/TableGen/SubtargetFeatureInfo.cpp +++ utils/TableGen/SubtargetFeatureInfo.cpp @@ -16,7 +16,7 @@ using namespace llvm; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SubtargetFeatureInfo::dump() const { errs() << getEnumName() << " " << Index << "\n" << *TheDef; }