From 5298935fe70370278f9b4adb7462cf6b15d513df Mon Sep 17 00:00:00 2001 From: Don Hinton Date: Thu, 12 Oct 2017 16:16:06 +0000 Subject: [PATCH] [dump] Remove NDEBUG from test to enable dump methods [NFC] Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315590 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 6 +++--- bindings/ocaml/llvm/llvm_ocaml.c | 2 +- include/llvm/Analysis/DominanceFrontier.h | 2 +- include/llvm/Analysis/DominanceFrontierImpl.h | 2 +- include/llvm/Analysis/RegionInfo.h | 4 ++-- include/llvm/Analysis/RegionInfoImpl.h | 4 ++-- include/llvm/CodeGen/TargetSchedule.h | 2 +- include/llvm/Config/config.h.cmake | 3 --- include/llvm/Config/llvm-config.h.cmake | 4 ++++ include/llvm/IR/Attributes.h | 2 +- include/llvm/MC/MCSchedule.h | 4 ++-- include/llvm/Object/Wasm.h | 2 +- include/llvm/Support/Compiler.h | 6 +++--- lib/Analysis/AliasSetTracker.cpp | 2 +- lib/Analysis/BlockFrequencyInfoImpl.cpp | 2 +- lib/Analysis/CallGraph.cpp | 6 +++--- lib/Analysis/DependenceAnalysis.cpp | 2 +- lib/Analysis/DominanceFrontier.cpp | 2 +- lib/Analysis/IVUsers.cpp | 2 +- lib/Analysis/InlineCost.cpp | 2 +- lib/Analysis/LazyCallGraph.cpp | 6 +++--- lib/Analysis/LoopInfo.cpp | 2 +- lib/Analysis/MemorySSA.cpp | 4 ++-- lib/Analysis/PHITransAddr.cpp | 2 +- lib/Analysis/RegionInfo.cpp | 2 +- lib/Analysis/ScalarEvolution.cpp | 2 +- lib/Analysis/Trace.cpp | 2 +- lib/Bitcode/Writer/ValueEnumerator.cpp | 2 +- lib/CodeGen/AsmPrinter/DIE.cpp | 6 +++--- lib/CodeGen/AsmPrinter/DebugLocEntry.h | 2 +- lib/CodeGen/BranchRelaxation.cpp | 2 +- lib/CodeGen/CodeGenPrepare.cpp | 2 +- lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 +- lib/CodeGen/GlobalISel/RegisterBank.cpp | 2 +- lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 8 ++++---- lib/CodeGen/InlineSpiller.cpp | 2 +- lib/CodeGen/LexicalScopes.cpp | 2 +- lib/CodeGen/LiveDebugValues.cpp | 2 +- lib/CodeGen/LiveDebugVariables.cpp | 4 ++-- lib/CodeGen/LiveInterval.cpp | 6 +++--- lib/CodeGen/LiveIntervalAnalysis.cpp | 2 +- lib/CodeGen/LivePhysRegs.cpp | 2 +- lib/CodeGen/LiveVariables.cpp | 2 +- lib/CodeGen/MachineBasicBlock.cpp | 2 +- lib/CodeGen/MachineFrameInfo.cpp | 2 +- lib/CodeGen/MachineFunction.cpp | 6 +++--- lib/CodeGen/MachineInstr.cpp | 4 ++-- lib/CodeGen/MachineLoopInfo.cpp | 2 +- lib/CodeGen/MachinePipeliner.cpp | 4 ++-- lib/CodeGen/MachineRegionInfo.cpp | 2 +- lib/CodeGen/MachineRegisterInfo.cpp | 2 +- lib/CodeGen/MachineScheduler.cpp | 8 ++++---- lib/CodeGen/PostRASchedulerList.cpp | 2 +- lib/CodeGen/RegAllocPBQP.cpp | 2 +- lib/CodeGen/RegisterPressure.cpp | 2 +- lib/CodeGen/SafeStackColoring.cpp | 2 +- lib/CodeGen/ScheduleDAG.cpp | 2 +- lib/CodeGen/ScheduleDAGInstrs.cpp | 6 +++--- lib/CodeGen/ScoreboardHazardRecognizer.cpp | 2 +- lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 4 ++-- lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 4 ++-- lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 8 ++++---- lib/CodeGen/SlotIndexes.cpp | 4 ++-- lib/CodeGen/SplitKit.cpp | 2 +- lib/CodeGen/StackColoring.cpp | 2 +- lib/CodeGen/TargetRegisterInfo.cpp | 2 +- lib/CodeGen/VirtRegMap.cpp | 2 +- lib/IR/AsmWriter.cpp | 2 +- lib/IR/Attributes.cpp | 6 +++--- lib/IR/ConstantRange.cpp | 2 +- lib/IR/Core.cpp | 2 +- lib/IR/DebugLoc.cpp | 2 +- lib/IR/GCOV.cpp | 6 +++--- lib/IR/Pass.cpp | 2 +- lib/IR/ValueSymbolTable.cpp | 2 +- lib/MC/MCExpr.cpp | 2 +- lib/MC/MCFragment.cpp | 2 +- lib/MC/MCInst.cpp | 4 ++-- lib/MC/MCLabel.cpp | 2 +- lib/MC/MCParser/MCAsmParser.cpp | 2 +- lib/MC/MCSection.cpp | 2 +- lib/MC/MCSymbol.cpp | 2 +- lib/MC/MCValue.cpp | 2 +- lib/MC/SubtargetFeature.cpp | 2 +- lib/MC/WasmObjectWriter.cpp | 2 +- lib/Option/Arg.cpp | 2 +- lib/Option/ArgList.cpp | 2 +- lib/Option/Option.cpp | 2 +- lib/ProfileData/SampleProf.cpp | 6 +++--- lib/Support/APFloat.cpp | 2 +- lib/Support/APInt.cpp | 2 +- lib/Support/BranchProbability.cpp | 2 +- lib/Support/Twine.cpp | 2 +- lib/TableGen/Record.cpp | 10 +++++----- lib/TableGen/TGParser.cpp | 2 +- lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp | 2 +- lib/Target/AMDGPU/GCNIterativeScheduler.cpp | 2 +- lib/Target/AMDGPU/GCNRegPressure.cpp | 6 +++--- lib/Target/ARM/ARMConstantIslandPass.cpp | 2 +- lib/Target/ARM/ARMConstantPoolValue.cpp | 2 +- lib/Target/Hexagon/HexagonSplitDouble.cpp | 2 +- lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 2 +- lib/Target/Mips/MipsConstantIslandPass.cpp | 2 +- lib/Target/PowerPC/PPCVSXSwapRemoval.cpp | 2 +- lib/Target/X86/X86FloatingPoint.cpp | 2 +- lib/Target/X86/X86ISelDAGToDAG.cpp | 2 +- lib/Transforms/Coroutines/CoroFrame.cpp | 2 +- lib/Transforms/Scalar/GVN.cpp | 2 +- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 14 +++++++------- lib/Transforms/Scalar/SROA.cpp | 10 +++++----- utils/TableGen/AsmMatcherEmitter.cpp | 2 +- utils/TableGen/SubtargetEmitter.cpp | 2 +- utils/TableGen/SubtargetFeatureInfo.cpp | 2 +- 113 files changed, 173 insertions(+), 172 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2e548df3f..47c15e73ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,15 +388,15 @@ option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF) 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() diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 137b17f26bf..f089bb7dc7e 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -336,7 +336,7 @@ CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) { /* 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"), diff --git a/include/llvm/Analysis/DominanceFrontier.h b/include/llvm/Analysis/DominanceFrontier.h index a304dff18c7..a725d42edba 100644 --- a/include/llvm/Analysis/DominanceFrontier.h +++ b/include/llvm/Analysis/DominanceFrontier.h @@ -109,7 +109,7 @@ public: 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 }; diff --git a/include/llvm/Analysis/DominanceFrontierImpl.h b/include/llvm/Analysis/DominanceFrontierImpl.h index dffb2e02b62..f97eb425c67 100644 --- a/include/llvm/Analysis/DominanceFrontierImpl.h +++ b/include/llvm/Analysis/DominanceFrontierImpl.h @@ -148,7 +148,7 @@ void DominanceFrontierBase::print(raw_ostream &OS) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP template void DominanceFrontierBase::dump() const { print(dbgs()); diff --git a/include/llvm/Analysis/RegionInfo.h b/include/llvm/Analysis/RegionInfo.h index 71962235994..6bf8675609b 100644 --- a/include/llvm/Analysis/RegionInfo.h +++ b/include/llvm/Analysis/RegionInfo.h @@ -437,7 +437,7 @@ public: 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 @@ public: 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 diff --git a/include/llvm/Analysis/RegionInfoImpl.h b/include/llvm/Analysis/RegionInfoImpl.h index 6e522354dd9..ee819d7d961 100644 --- a/include/llvm/Analysis/RegionInfoImpl.h +++ b/include/llvm/Analysis/RegionInfoImpl.h @@ -521,7 +521,7 @@ void RegionBase::print(raw_ostream &OS, bool print_tree, unsigned level, 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 @@ void RegionInfoBase::print(raw_ostream &OS) const { OS << "End region tree\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP template void RegionInfoBase::dump() const { print(dbgs()); } #endif diff --git a/include/llvm/CodeGen/TargetSchedule.h b/include/llvm/CodeGen/TargetSchedule.h index 733693e1b58..6138bc952af 100644 --- a/include/llvm/CodeGen/TargetSchedule.h +++ b/include/llvm/CodeGen/TargetSchedule.h @@ -116,7 +116,7 @@ public: 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"; diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake index d67148f6aa3..2c5bdb9d088 100644 --- a/include/llvm/Config/config.h.cmake +++ b/include/llvm/Config/config.h.cmake @@ -353,9 +353,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}" diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake index 4b0c5946061..6a5c63d8d74 100644 --- a/include/llvm/Config/llvm-config.h.cmake +++ b/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 diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 0cab8bbb8ea..7be482bab23 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -283,7 +283,7 @@ public: iterator begin() const; iterator end() const; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() const; #endif }; diff --git a/include/llvm/MC/MCSchedule.h b/include/llvm/MC/MCSchedule.h index a79afe163e6..acdb6c53ac0 100644 --- a/include/llvm/MC/MCSchedule.h +++ b/include/llvm/MC/MCSchedule.h @@ -24,7 +24,7 @@ struct InstrItinerary; /// 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 @@ struct MCSchedClassDesc { 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; diff --git a/include/llvm/Object/Wasm.h b/include/llvm/Object/Wasm.h index e138faeed34..f219934d728 100644 --- a/include/llvm/Object/Wasm.h +++ b/include/llvm/Object/Wasm.h @@ -87,7 +87,7 @@ public: << ", ImportIndex=" << ImportIndex; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index b19e37235df..90ab942736c 100644 --- a/include/llvm/Support/Compiler.h +++ b/include/llvm/Support/Compiler.h @@ -442,10 +442,10 @@ void AnnotateIgnoreWritesEnd(const char *file, int line); /// \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 diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 025e8119deb..c5ac848bac2 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -648,7 +648,7 @@ void AliasSetTracker::print(raw_ostream &OS) const { 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 diff --git a/lib/Analysis/BlockFrequencyInfoImpl.cpp b/lib/Analysis/BlockFrequencyInfoImpl.cpp index 1030407b766..1f00510e5e1 100644 --- a/lib/Analysis/BlockFrequencyInfoImpl.cpp +++ b/lib/Analysis/BlockFrequencyInfoImpl.cpp @@ -46,7 +46,7 @@ ScaledNumber BlockMass::toScaled() const { 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 diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp index ac3ea2b73fe..ebefbedbc8a 100644 --- a/lib/Analysis/CallGraph.cpp +++ b/lib/Analysis/CallGraph.cpp @@ -109,7 +109,7 @@ void CallGraph::print(raw_ostream &OS) const { 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 @@ void CallGraphNode::print(raw_ostream &OS) const { 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 @@ void CallGraphWrapperPass::print(raw_ostream &OS, const Module *) const { 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 diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp index 34eccc07f26..6c34f51a077 100644 --- a/lib/Analysis/DependenceAnalysis.cpp +++ b/lib/Analysis/DependenceAnalysis.cpp @@ -385,7 +385,7 @@ void DependenceInfo::Constraint::setAny(ScalarEvolution *NewSE) { 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()) diff --git a/lib/Analysis/DominanceFrontier.cpp b/lib/Analysis/DominanceFrontier.cpp index bb8caf4a517..d713ae44772 100644 --- a/lib/Analysis/DominanceFrontier.cpp +++ b/lib/Analysis/DominanceFrontier.cpp @@ -59,7 +59,7 @@ void DominanceFrontierWrapperPass::print(raw_ostream &OS, const Module *) const DF.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const { print(dbgs()); } diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index c30feb973e6..56791546671 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -340,7 +340,7 @@ void IVUsers::print(raw_ostream &OS, const Module *M) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void IVUsers::dump() const { print(dbgs()); } #endif diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index b7fe884cc22..411185fd6e8 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -1698,7 +1698,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) { 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" diff --git a/lib/Analysis/LazyCallGraph.cpp b/lib/Analysis/LazyCallGraph.cpp index 54299d078be..ded094089fe 100644 --- a/lib/Analysis/LazyCallGraph.cpp +++ b/lib/Analysis/LazyCallGraph.cpp @@ -137,7 +137,7 @@ void LazyCallGraph::Node::replaceFunction(Function &NewF) { 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 @@ LazyCallGraph &LazyCallGraph::operator=(LazyCallGraph &&G) { 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 @@ bool LazyCallGraph::SCC::isAncestorOf(const SCC &TargetC) const { 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'; } diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 0471213b69c..30d497bc1b6 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -407,7 +407,7 @@ BasicBlock *Loop::getUniqueExitBlock() const { 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 { diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index a0fb534a6c2..b6c6649577d 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/lib/Analysis/MemorySSA.cpp @@ -1622,7 +1622,7 @@ void MemorySSA::print(raw_ostream &OS) const { 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 MemoryUse::print(raw_ostream &OS) const { 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 diff --git a/lib/Analysis/PHITransAddr.cpp b/lib/Analysis/PHITransAddr.cpp index 682af4dc708..ba2698514a3 100644 --- a/lib/Analysis/PHITransAddr.cpp +++ b/lib/Analysis/PHITransAddr.cpp @@ -41,7 +41,7 @@ static bool CanPHITrans(Instruction *Inst) { 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"; diff --git a/lib/Analysis/RegionInfo.cpp b/lib/Analysis/RegionInfo.cpp index 90048732300..afec9b9a5d2 100644 --- a/lib/Analysis/RegionInfo.cpp +++ b/lib/Analysis/RegionInfo.cpp @@ -152,7 +152,7 @@ void RegionInfoPass::print(raw_ostream &OS, const Module *) const { RI.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void RegionInfoPass::dump() const { RI.dump(); } diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 54a4b60e703..c294f612342 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -212,7 +212,7 @@ static cl::opt // 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'; diff --git a/lib/Analysis/Trace.cpp b/lib/Analysis/Trace.cpp index 34c998501a6..bd2f2024410 100644 --- a/lib/Analysis/Trace.cpp +++ b/lib/Analysis/Trace.cpp @@ -44,7 +44,7 @@ void Trace::print(raw_ostream &O) const { 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 { diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index d99befcdaea..4f2c16e6b8d 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -465,7 +465,7 @@ unsigned ValueEnumerator::getValueID(const Value *V) const { 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'; diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index 886e6e264b3..166064d251d 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -127,7 +127,7 @@ void DIEAbbrev::print(raw_ostream &O) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DIEAbbrev::dump() const { print(dbgs()); } @@ -267,7 +267,7 @@ void DIE::print(raw_ostream &O, unsigned IndentCount) const { 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 @@ void DIEValue::print(raw_ostream &O) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DIEValue::dump() const { print(dbgs()); } diff --git a/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/lib/CodeGen/AsmPrinter/DebugLocEntry.h index 3d6d8a76529..49236583248 100644 --- a/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -76,7 +76,7 @@ public: 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() << " "; diff --git a/lib/CodeGen/BranchRelaxation.cpp b/lib/CodeGen/BranchRelaxation.cpp index 2d21fbeea39..6fb34fb9ab5 100644 --- a/lib/CodeGen/BranchRelaxation.cpp +++ b/lib/CodeGen/BranchRelaxation.cpp @@ -138,7 +138,7 @@ void BranchRelaxation::verify() { #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) { diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp index 9f0c1f7fb1a..6b60517cd66 100644 --- a/lib/CodeGen/CodeGenPrepare.cpp +++ b/lib/CodeGen/CodeGenPrepare.cpp @@ -2750,7 +2750,7 @@ static inline raw_ostream &operator<<(raw_ostream &OS, const ExtAddrMode &AM) { } #endif -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void ExtAddrMode::print(raw_ostream &OS) const { bool NeedPlus = false; OS << "["; diff --git a/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 677941dbbf6..f2eb217c0b8 100644 --- a/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -987,7 +987,7 @@ bool RegBankSelect::MappingCost::operator==(const MappingCost &Cost) const { 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'; diff --git a/lib/CodeGen/GlobalISel/RegisterBank.cpp b/lib/CodeGen/GlobalISel/RegisterBank.cpp index 83b21e63709..4d2bfad3466 100644 --- a/lib/CodeGen/GlobalISel/RegisterBank.cpp +++ b/lib/CodeGen/GlobalISel/RegisterBank.cpp @@ -76,7 +76,7 @@ bool RegisterBank::operator==(const RegisterBank &OtherRB) const { 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); } diff --git a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index 632d9fd767c..3d7132717cc 100644 --- a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -465,7 +465,7 @@ unsigned RegisterBankInfo::getSizeInBits(unsigned Reg, //------------------------------------------------------------------------------ // 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 @@ bool RegisterBankInfo::ValueMapping::verify(unsigned MeaningfulBitWidth) const { 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 @@ bool RegisterBankInfo::InstructionMapping::verify( 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 @@ RegisterBankInfo::OperandsMapper::getVRegs(unsigned OpIdx, 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'; diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp index 2e991de6221..6b4f27df9e4 100644 --- a/lib/CodeGen/InlineSpiller.cpp +++ b/lib/CodeGen/InlineSpiller.cpp @@ -706,7 +706,7 @@ bool InlineSpiller::coalesceStackAccess(MachineInstr *MI, unsigned Reg) { 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, diff --git a/lib/CodeGen/LexicalScopes.cpp b/lib/CodeGen/LexicalScopes.cpp index 47ab4ef65c7..47c1128a492 100644 --- a/lib/CodeGen/LexicalScopes.cpp +++ b/lib/CodeGen/LexicalScopes.cpp @@ -317,7 +317,7 @@ bool LexicalScopes::dominates(const DILocation *DL, MachineBasicBlock *MBB) { 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); diff --git a/lib/CodeGen/LiveDebugValues.cpp b/lib/CodeGen/LiveDebugValues.cpp index a45b1e39fee..37ad6e42c62 100644 --- a/lib/CodeGen/LiveDebugValues.cpp +++ b/lib/CodeGen/LiveDebugValues.cpp @@ -160,7 +160,7 @@ private: /// 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 diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index 0c81306a9a5..05cbd1eb745 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -398,7 +398,7 @@ public: } // 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) @@ -1218,7 +1218,7 @@ bool LiveDebugVariables::doInitialization(Module &M) { 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()); diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index ac19d7b0139..09672dde305 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -944,7 +944,7 @@ raw_ostream& llvm::operator<<(raw_ostream& OS, const LiveRange::Segment &S) { 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 @@ void LiveInterval::print(raw_ostream &OS) const { 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 @@ void LiveInterval::verify(const MachineRegisterInfo *MRI) const { // 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) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 0e240f482a1..1f23d241e79 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -179,7 +179,7 @@ void LiveIntervals::printInstrs(raw_ostream &OS) const { MF->print(OS, Indexes); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LiveIntervals::dumpInstrs() const { printInstrs(dbgs()); } diff --git a/lib/CodeGen/LivePhysRegs.cpp b/lib/CodeGen/LivePhysRegs.cpp index 779f601e402..b7a795a5454 100644 --- a/lib/CodeGen/LivePhysRegs.cpp +++ b/lib/CodeGen/LivePhysRegs.cpp @@ -130,7 +130,7 @@ void LivePhysRegs::print(raw_ostream &OS) const { OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void LivePhysRegs::dump() const { dbgs() << " " << *this; } diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index a9aec926115..9f850bc00d3 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -64,7 +64,7 @@ LiveVariables::VarInfo::findKill(const MachineBasicBlock *MBB) const { 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(), diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index d5758da0464..7fdf23051aa 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -222,7 +222,7 @@ bool MachineBasicBlock::hasEHPadSuccessor() const { return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineBasicBlock::dump() const { print(dbgs()); } diff --git a/lib/CodeGen/MachineFrameInfo.cpp b/lib/CodeGen/MachineFrameInfo.cpp index be8adf75fb7..8c979556102 100644 --- a/lib/CodeGen/MachineFrameInfo.cpp +++ b/lib/CodeGen/MachineFrameInfo.cpp @@ -242,7 +242,7 @@ void MachineFrameInfo::print(const MachineFunction &MF, raw_ostream &OS) const{ } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineFrameInfo::dump(const MachineFunction &MF) const { print(MF, dbgs()); } diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 250a10c7d07..b341992155e 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -478,7 +478,7 @@ const char *MachineFunction::createExternalSymbolName(StringRef Name) { return Dest; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineFunction::dump() const { print(dbgs()); } @@ -914,7 +914,7 @@ void MachineJumpTableInfo::print(raw_ostream &OS) const { OS << '\n'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineJumpTableInfo::dump() const { print(dbgs()); } #endif @@ -1069,6 +1069,6 @@ void MachineConstantPool::print(raw_ostream &OS) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineConstantPool::dump() const { print(dbgs()); } #endif diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index bb2dda980e4..8012376d498 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -566,7 +566,7 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << "[TF=" << TF << ']'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineOperand::dump() const { dbgs() << *this << '\n'; } @@ -1873,7 +1873,7 @@ void MachineInstr::copyImplicitOps(MachineFunction &MF, } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineInstr::dump() const { dbgs() << " "; print(dbgs()); diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp index a9aa1d954e7..283324a5425 100644 --- a/lib/CodeGen/MachineLoopInfo.cpp +++ b/lib/CodeGen/MachineLoopInfo.cpp @@ -138,7 +138,7 @@ MachineLoopInfo::findLoopPreheader(MachineLoop *L, return Preheader; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineLoop::dump() const { print(dbgs()); } diff --git a/lib/CodeGen/MachinePipeliner.cpp b/lib/CodeGen/MachinePipeliner.cpp index c852c2e1564..bd1d813dfff 100644 --- a/lib/CodeGen/MachinePipeliner.cpp +++ b/lib/CodeGen/MachinePipeliner.cpp @@ -558,7 +558,7 @@ public: os << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; @@ -4010,7 +4010,7 @@ void SMSchedule::finalizeSchedule(SwingSchedulerDAG *SSD) { 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. diff --git a/lib/CodeGen/MachineRegionInfo.cpp b/lib/CodeGen/MachineRegionInfo.cpp index 1e74104e89e..fa72de73618 100644 --- a/lib/CodeGen/MachineRegionInfo.cpp +++ b/lib/CodeGen/MachineRegionInfo.cpp @@ -118,7 +118,7 @@ void MachineRegionInfoPass::print(raw_ostream &OS, const Module *) const { RI.print(OS); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MachineRegionInfoPass::dump() const { RI.dump(); } diff --git a/lib/CodeGen/MachineRegisterInfo.cpp b/lib/CodeGen/MachineRegisterInfo.cpp index be06053f004..1249e24a62f 100644 --- a/lib/CodeGen/MachineRegisterInfo.cpp +++ b/lib/CodeGen/MachineRegisterInfo.cpp @@ -458,7 +458,7 @@ LaneBitmask MachineRegisterInfo::getMaxLaneMaskForVReg(unsigned Reg) const { 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(); diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index 674e83cf808..73eea42618e 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -581,7 +581,7 @@ void MachineSchedulerBase::print(raw_ostream &O, const Module* m) const { // 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 @@ void ScheduleDAGMI::placeDebugValues() { 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))) @@ -2354,7 +2354,7 @@ SUnit *SchedBoundary::pickOnlyChoice() { 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 { @@ -2698,7 +2698,7 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin, 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 diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp index f2249f9e37e..205aefb9227 100644 --- a/lib/CodeGen/PostRASchedulerList.cpp +++ b/lib/CodeGen/PostRASchedulerList.cpp @@ -251,7 +251,7 @@ void SchedulePostRATDList::exitRegion() { 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++) { diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp index 9778103575f..7cd9828eca5 100644 --- a/lib/CodeGen/RegAllocPBQP.cpp +++ b/lib/CodeGen/RegAllocPBQP.cpp @@ -868,7 +868,7 @@ static Printable PrintNodeInfo(PBQP::RegAlloc::PBQPRAGraph::NodeId NId, }); } -#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); diff --git a/lib/CodeGen/RegisterPressure.cpp b/lib/CodeGen/RegisterPressure.cpp index 88e0a3b5894..cd52a79d613 100644 --- a/lib/CodeGen/RegisterPressure.cpp +++ b/lib/CodeGen/RegisterPressure.cpp @@ -76,7 +76,7 @@ static void decreaseSetPressure(std::vector &CurrSetPressure, } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void llvm::dumpRegSetPressure(ArrayRef SetPressure, const TargetRegisterInfo *TRI) { diff --git a/lib/CodeGen/SafeStackColoring.cpp b/lib/CodeGen/SafeStackColoring.cpp index 072e6e090e1..3938723a677 100644 --- a/lib/CodeGen/SafeStackColoring.cpp +++ b/lib/CodeGen/SafeStackColoring.cpp @@ -250,7 +250,7 @@ void StackColoring::calculateLiveIntervals() { } } -#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) diff --git a/lib/CodeGen/ScheduleDAG.cpp b/lib/CodeGen/ScheduleDAG.cpp index 5e95f760aaa..53c57e371b4 100644 --- a/lib/CodeGen/ScheduleDAG.cpp +++ b/lib/CodeGen/ScheduleDAG.cpp @@ -335,7 +335,7 @@ void SUnit::biasCriticalPath() { 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 { diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index be129b8766a..72033661c57 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -97,7 +97,7 @@ static unsigned getReductionSize() { } 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 << ")"; @@ -1096,7 +1096,7 @@ void ScheduleDAGInstrs::fixupKills(MachineBasicBlock &MBB) { 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 } @@ -1408,7 +1408,7 @@ void SchedDFSResult::scheduleTree(unsigned SubtreeID) { } } -#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) diff --git a/lib/CodeGen/ScoreboardHazardRecognizer.cpp b/lib/CodeGen/ScoreboardHazardRecognizer.cpp index e2cb8cad6e1..0e9b4e95a4a 100644 --- a/lib/CodeGen/ScoreboardHazardRecognizer.cpp +++ b/lib/CodeGen/ScoreboardHazardRecognizer.cpp @@ -83,7 +83,7 @@ void ScoreboardHazardRecognizer::Reset() { ReservedScoreboard.reset(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ScoreboardHazardRecognizer::Scoreboard::dump() const { dbgs() << "Scoreboard:\n"; diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index 98202925629..4e86e63a5e7 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1855,7 +1855,7 @@ public: 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; @@ -2026,7 +2026,7 @@ unsigned RegReductionPQBase::getNodePriority(const SUnit *SU) const { // 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(); diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index 6eebba19e5c..b6d3f8cce00 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -651,7 +651,7 @@ void ScheduleDAGSDNodes::computeOperandLatency(SDNode *Def, SDNode *Use, 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 @@ void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const { #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]) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index 362ecab7320..0094ba4cc69 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -401,7 +401,7 @@ static Printable PrintNodeId(const SDNode &Node) { }); } -#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 { @@ -604,7 +604,7 @@ static bool shouldPrintInline(const SDNode &Node) { 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())) @@ -658,7 +658,7 @@ static bool printOperand(raw_ostream &OS, const SelectionDAG *G, } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP using VisitedSDNodeSet = SmallPtrSet; static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, @@ -731,7 +731,7 @@ void SDNode::printrFull(raw_ostream &OS, const SelectionDAG *G) const { 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); diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp index 3656832a7f1..ef5c38da34a 100644 --- a/lib/CodeGen/SlotIndexes.cpp +++ b/lib/CodeGen/SlotIndexes.cpp @@ -250,7 +250,7 @@ void SlotIndexes::repairIndexesInRange(MachineBasicBlock *MBB, } } -#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 @@ void SlotIndex::print(raw_ostream &os) const { 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()); diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp index 1467179b7a3..dbafe6f36c5 100644 --- a/lib/CodeGen/SplitKit.cpp +++ b/lib/CodeGen/SplitKit.cpp @@ -392,7 +392,7 @@ void SplitEditor::reset(LiveRangeEdit &LRE, ComplementSpillMode SM) { 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"; diff --git a/lib/CodeGen/StackColoring.cpp b/lib/CodeGen/StackColoring.cpp index b9ddd96d404..bb0b614bad6 100644 --- a/lib/CodeGen/StackColoring.cpp +++ b/lib/CodeGen/StackColoring.cpp @@ -533,7 +533,7 @@ void StackColoring::getAnalysisUsage(AnalysisUsage &AU) const { 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 << " : { "; diff --git a/lib/CodeGen/TargetRegisterInfo.cpp b/lib/CodeGen/TargetRegisterInfo.cpp index 55318237e95..9d021afa238 100644 --- a/lib/CodeGen/TargetRegisterInfo.cpp +++ b/lib/CodeGen/TargetRegisterInfo.cpp @@ -424,7 +424,7 @@ bool TargetRegisterInfo::regmaskSubsetEqual(const uint32_t *mask0, 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) { diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index 65c62b16719..30e7d6b6571 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -156,7 +156,7 @@ void VirtRegMap::print(raw_ostream &OS, const Module*) const { OS << '\n'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void VirtRegMap::dump() const { print(dbgs()); } diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index f6ed6a2116b..683c92266be 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -3623,7 +3623,7 @@ void Metadata::print(raw_ostream &OS, ModuleSlotTracker &MST, 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'; } diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index c8f1aaaccee..23d8228cc1a 100644 --- a/lib/IR/Attributes.cpp +++ b/lib/IR/Attributes.cpp @@ -619,7 +619,7 @@ AttributeSet::iterator AttributeSet::end() const { 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() << " { "; @@ -828,7 +828,7 @@ void AttributeListImpl::Profile(FoldingSetNodeID &ID, 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(); } @@ -1288,7 +1288,7 @@ unsigned AttributeList::getNumAttrSets() const { 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"; diff --git a/lib/IR/ConstantRange.cpp b/lib/IR/ConstantRange.cpp index 4bd17257016..dc6fe317717 100644 --- a/lib/IR/ConstantRange.cpp +++ b/lib/IR/ConstantRange.cpp @@ -939,7 +939,7 @@ void ConstantRange::print(raw_ostream &OS) const { OS << "[" << Lower << "," << Upper << ")"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ConstantRange::dump() const { print(dbgs()); } diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index abb83e01e0c..b62ffa5ec7f 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -358,7 +358,7 @@ LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty) { 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(); } diff --git a/lib/IR/DebugLoc.cpp b/lib/IR/DebugLoc.cpp index 6297395b4c0..19056433f9f 100644 --- a/lib/IR/DebugLoc.cpp +++ b/lib/IR/DebugLoc.cpp @@ -99,7 +99,7 @@ DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt, return Last; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void DebugLoc::dump() const { if (!Loc) return; diff --git a/lib/IR/GCOV.cpp b/lib/IR/GCOV.cpp index d4b45522822..8e1309500bb 100644 --- a/lib/IR/GCOV.cpp +++ b/lib/IR/GCOV.cpp @@ -108,7 +108,7 @@ void GCOVFile::print(raw_ostream &OS) const { 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 @@ void GCOVFunction::print(raw_ostream &OS) const { 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 @@ void GCOVBlock::print(raw_ostream &OS) const { } } -#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()); diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp index 5e0b59476c4..61dec3c95d4 100644 --- a/lib/IR/Pass.cpp +++ b/lib/IR/Pass.cpp @@ -124,7 +124,7 @@ void Pass::print(raw_ostream &OS, const Module *) const { 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); diff --git a/lib/IR/ValueSymbolTable.cpp b/lib/IR/ValueSymbolTable.cpp index ccdabe0817b..5ce8b84c56c 100644 --- a/lib/IR/ValueSymbolTable.cpp +++ b/lib/IR/ValueSymbolTable.cpp @@ -100,7 +100,7 @@ ValueName *ValueSymbolTable::createValueName(StringRef Name, Value *V) { 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 { diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 38a8af49c19..53b8e788b05 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -136,7 +136,7 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI, bool InParens) const { 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'; diff --git a/lib/MC/MCFragment.cpp b/lib/MC/MCFragment.cpp index 31acca01bed..cca04404284 100644 --- a/lib/MC/MCFragment.cpp +++ b/lib/MC/MCFragment.cpp @@ -306,7 +306,7 @@ raw_ostream &operator<<(raw_ostream &OS, const MCFixup &AF) { } // 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(); diff --git a/lib/MC/MCInst.cpp b/lib/MC/MCInst.cpp index f6d1d3cffca..c0c7e41c3da 100644 --- a/lib/MC/MCInst.cpp +++ b/lib/MC/MCInst.cpp @@ -35,7 +35,7 @@ void MCOperand::print(raw_ostream &OS) const { 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 @@ void MCInst::dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer, OS << ">"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCInst::dump() const { print(dbgs()); dbgs() << "\n"; diff --git a/lib/MC/MCLabel.cpp b/lib/MC/MCLabel.cpp index db25a46fce1..1f460e76340 100644 --- a/lib/MC/MCLabel.cpp +++ b/lib/MC/MCLabel.cpp @@ -18,7 +18,7 @@ void MCLabel::print(raw_ostream &OS) const { OS << '"' << getInstance() << '"'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCLabel::dump() const { print(dbgs()); } diff --git a/lib/MC/MCParser/MCAsmParser.cpp b/lib/MC/MCParser/MCAsmParser.cpp index 6a4c74cd57f..adf447749b5 100644 --- a/lib/MC/MCParser/MCAsmParser.cpp +++ b/lib/MC/MCParser/MCAsmParser.cpp @@ -131,7 +131,7 @@ bool MCAsmParser::parseExpression(const MCExpr *&Res) { 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 } diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index d141dd6627c..c4bde2f3808 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -85,7 +85,7 @@ MCSection::getSubsectionInsertionPoint(unsigned Subsection) { return IP; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCSection::dump() const { raw_ostream &OS = errs(); diff --git a/lib/MC/MCSymbol.cpp b/lib/MC/MCSymbol.cpp index 9abaaef2fe8..23537ce58a9 100644 --- a/lib/MC/MCSymbol.cpp +++ b/lib/MC/MCSymbol.cpp @@ -81,7 +81,7 @@ void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const { OS << '"'; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCSymbol::dump() const { dbgs() << *this; } diff --git a/lib/MC/MCValue.cpp b/lib/MC/MCValue.cpp index 32a6adbf224..03b08529b4b 100644 --- a/lib/MC/MCValue.cpp +++ b/lib/MC/MCValue.cpp @@ -37,7 +37,7 @@ void MCValue::print(raw_ostream &OS) const { OS << " + " << getConstant(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void MCValue::dump() const { print(dbgs()); } diff --git a/lib/MC/SubtargetFeature.cpp b/lib/MC/SubtargetFeature.cpp index b68e88ca572..b67ee7d4a7f 100644 --- a/lib/MC/SubtargetFeature.cpp +++ b/lib/MC/SubtargetFeature.cpp @@ -256,7 +256,7 @@ void SubtargetFeatures::print(raw_ostream &OS) const { OS << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SubtargetFeatures::dump() const { print(dbgs()); } diff --git a/lib/MC/WasmObjectWriter.cpp b/lib/MC/WasmObjectWriter.cpp index 55e7c93c87e..1aa2bd76db4 100644 --- a/lib/MC/WasmObjectWriter.cpp +++ b/lib/MC/WasmObjectWriter.cpp @@ -170,7 +170,7 @@ struct WasmRelocationEntry { << ", FixupSection=" << FixupSection->getSectionName(); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void dump() const { print(dbgs()); } #endif }; diff --git a/lib/Option/Arg.cpp b/lib/Option/Arg.cpp index e581fee8bf3..17597f6a4fe 100644 --- a/lib/Option/Arg.cpp +++ b/lib/Option/Arg.cpp @@ -61,7 +61,7 @@ void Arg::print(raw_ostream& O) const { O << "]>\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Arg::dump() const { print(dbgs()); } #endif diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp index cbccc1935d3..db12d1c2fc0 100644 --- a/lib/Option/ArgList.cpp +++ b/lib/Option/ArgList.cpp @@ -204,7 +204,7 @@ void ArgList::print(raw_ostream &O) const { } } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ArgList::dump() const { print(dbgs()); } #endif diff --git a/lib/Option/Option.cpp b/lib/Option/Option.cpp index bf9f040bde5..45ee8b959c3 100644 --- a/lib/Option/Option.cpp +++ b/lib/Option/Option.cpp @@ -86,7 +86,7 @@ void Option::print(raw_ostream &O) const { O << ">\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Option::dump() const { print(dbgs()); } #endif diff --git a/lib/ProfileData/SampleProf.cpp b/lib/ProfileData/SampleProf.cpp index eafdd2154b7..a684948f044 100644 --- a/lib/ProfileData/SampleProf.cpp +++ b/lib/ProfileData/SampleProf.cpp @@ -82,7 +82,7 @@ raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS, 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 @@ void SampleRecord::print(raw_ostream &OS, unsigned Indent) const { 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 @@ raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS, return OS; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void FunctionSamples::dump() const { print(dbgs(), 0); } #endif diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index f835bd1fbd2..3a13ac506aa 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -4486,7 +4486,7 @@ void APFloat::print(raw_ostream &OS) const { OS << Buffer << "\n"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void APFloat::dump() const { print(dbgs()); } #endif diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index c558ddd8216..cd6c653e18e 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -2120,7 +2120,7 @@ std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { 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); diff --git a/lib/Support/BranchProbability.cpp b/lib/Support/BranchProbability.cpp index 44ad110d456..862f910a514 100644 --- a/lib/Support/BranchProbability.cpp +++ b/lib/Support/BranchProbability.cpp @@ -32,7 +32,7 @@ raw_ostream &BranchProbability::print(raw_ostream &OS) const { Percent); } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void BranchProbability::dump() const { print(dbgs()) << '\n'; } #endif diff --git a/lib/Support/Twine.cpp b/lib/Support/Twine.cpp index d17cd4e6643..caaddd17b23 100644 --- a/lib/Support/Twine.cpp +++ b/lib/Support/Twine.cpp @@ -173,7 +173,7 @@ void Twine::printRepr(raw_ostream &OS) const { OS << ")"; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void Twine::dump() const { print(dbgs()); } diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 2c5b745433b..b167947749f 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -48,7 +48,7 @@ IntRecTy IntRecTy::Shared; 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 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { 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 @@ StringRef RecordVal::getName() const { 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 @@ void Record::resolveReferencesTo(const RecordVal *RV) { } } -#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 @@ DagInit *Record::getValueAsDag(StringRef FieldName) const { 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(); diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index b492cf9495c..580a73aa5d3 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -54,7 +54,7 @@ struct SubMultiClassReference { void dump() const; }; -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void SubMultiClassReference::dump() const { errs() << "Multiclass:\n"; diff --git a/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp b/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp index 646303d51a4..18f342d325e 100644 --- a/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp +++ b/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp @@ -261,7 +261,7 @@ unsigned PHILinearize::getNumSources(unsigned DestReg) { 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"; diff --git a/lib/Target/AMDGPU/GCNIterativeScheduler.cpp b/lib/Target/AMDGPU/GCNIterativeScheduler.cpp index 9e743850f9a..f1e0a157556 100644 --- a/lib/Target/AMDGPU/GCNIterativeScheduler.cpp +++ b/lib/Target/AMDGPU/GCNIterativeScheduler.cpp @@ -52,7 +52,7 @@ static inline MachineInstr *getMachineInstr(const SUnit &SU) { 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, diff --git a/lib/Target/AMDGPU/GCNRegPressure.cpp b/lib/Target/AMDGPU/GCNRegPressure.cpp index f8d0acb3df9..cc8511d3b7e 100644 --- a/lib/Target/AMDGPU/GCNRegPressure.cpp +++ b/lib/Target/AMDGPU/GCNRegPressure.cpp @@ -31,7 +31,7 @@ using namespace llvm; #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 @@ bool GCNRegPressure::less(const SISubtarget &ST, (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 @@ bool GCNDownwardRPTracker::advance(MachineBasicBlock::const_iterator Begin, 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, diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index 68d00e28f9d..9d15cfdf143 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -320,7 +320,7 @@ void ARMConstantIslands::verify() { #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({ diff --git a/lib/Target/ARM/ARMConstantPoolValue.cpp b/lib/Target/ARM/ARMConstantPoolValue.cpp index 38ea835fbe2..7b5441adfa7 100644 --- a/lib/Target/ARM/ARMConstantPoolValue.cpp +++ b/lib/Target/ARM/ARMConstantPoolValue.cpp @@ -97,7 +97,7 @@ ARMConstantPoolValue::hasSameValue(ARMConstantPoolValue *ACPV) { return false; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP LLVM_DUMP_METHOD void ARMConstantPoolValue::dump() const { errs() << " " << *this; } diff --git a/lib/Target/Hexagon/HexagonSplitDouble.cpp b/lib/Target/Hexagon/HexagonSplitDouble.cpp index 0d97df776e6..d56a77baf58 100644 --- a/lib/Target/Hexagon/HexagonSplitDouble.cpp +++ b/lib/Target/Hexagon/HexagonSplitDouble.cpp @@ -131,7 +131,7 @@ const TargetRegisterClass *const HexagonSplitDoubleRegs::DoubleRC = 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() << '{'; diff --git a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp index 0b02f79f472..45d493fe701 100644 --- a/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp +++ b/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp @@ -61,7 +61,7 @@ namespace { 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) { diff --git a/lib/Target/Mips/MipsConstantIslandPass.cpp b/lib/Target/Mips/MipsConstantIslandPass.cpp index 257e8f45a70..0f8c5fc1964 100644 --- a/lib/Target/Mips/MipsConstantIslandPass.cpp +++ b/lib/Target/Mips/MipsConstantIslandPass.cpp @@ -425,7 +425,7 @@ bool MipsConstantIslands::isOffsetInRange 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) { diff --git a/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp b/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp index 7d34efd4af3..2da82e0627b 100644 --- a/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ b/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -953,7 +953,7 @@ bool PPCVSXSwapRemoval::removeSwaps() { 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() { diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index 5582526541b..6344ba02fa8 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -169,7 +169,7 @@ namespace { // 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) { diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 3aa3244a706..707ce24295b 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -102,7 +102,7 @@ namespace { Base_Reg = Reg; } -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +#ifdef LLVM_ENABLE_DUMP void dump() { dbgs() << "X86ISelAddressMode " << this << '\n'; dbgs() << "Base_Reg "; diff --git a/lib/Transforms/Coroutines/CoroFrame.cpp b/lib/Transforms/Coroutines/CoroFrame.cpp index d192fa699f3..23e8b197422 100644 --- a/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/lib/Transforms/Coroutines/CoroFrame.cpp @@ -133,7 +133,7 @@ struct SuspendCrossingInfo { }; } // 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 << ":"; diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index a642eecf84d..1ac2bea66b0 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -646,7 +646,7 @@ PreservedAnalyses GVN::run(Function &F, FunctionAnalysisManager &AM) { 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(), diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 6462e3fb856..97785b0a356 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -195,7 +195,7 @@ public: } // 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 @@ bool Formula::hasRegsUsedByUsesOtherThan(size_t LUIdx, 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 @@ bool Cost::isLess(Cost &Other, const TargetTransformInfo &TTI) { 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 @@ bool LSRFixup::isUseFullyOutsideLoop(const Loop *L) const { 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 @@ void LSRUse::RecomputeRegs(size_t LUIdx, RegUseTracker &RegUses) { 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 @@ struct WorkItem { } // 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 @@ LSRInstance::LSRInstance(Loop *L, IVUsers &IU, ScalarEvolution &SE, 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; diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index b968cb8c892..d139684bdd8 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -292,7 +292,7 @@ public: /// 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 @@ private: 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 @@ private: 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 @@ AllocaSlices::AllocaSlices(const DataLayout &DL, AllocaInst &AI) 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_iterator I) const { } 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. diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index fd1d7e0dba4..7b26a0a1dfd 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -766,7 +766,7 @@ public: } // 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"; diff --git a/utils/TableGen/SubtargetEmitter.cpp b/utils/TableGen/SubtargetEmitter.cpp index d1e78389d2a..9c62734777d 100644 --- a/utils/TableGen/SubtargetEmitter.cpp +++ b/utils/TableGen/SubtargetEmitter.cpp @@ -1233,7 +1233,7 @@ void SubtargetEmitter::EmitSchedModel(raw_ostream &OS) { 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" diff --git a/utils/TableGen/SubtargetFeatureInfo.cpp b/utils/TableGen/SubtargetFeatureInfo.cpp index 5153c35b126..f842d266dea 100644 --- a/utils/TableGen/SubtargetFeatureInfo.cpp +++ b/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; } -- 2.40.0