From 6806f5614d2ec260fda954c951d33f58e77ed610 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 1 Aug 2003 22:15:03 +0000 Subject: [PATCH] DEBUG got moved to Support/Debug.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../DataStructure/BottomUpClosure.cpp | 1 + lib/Analysis/DataStructure/DataStructure.cpp | 1 + lib/Analysis/DataStructure/Local.cpp | 4 ++-- lib/Analysis/DataStructure/Steensgaard.cpp | 2 +- lib/Analysis/DataStructure/TopDownClosure.cpp | 1 + lib/Analysis/InductionVariable.cpp | 2 +- lib/Transforms/ExprTypeConvert.cpp | 2 +- .../IPO/DeadArgumentElimination.cpp | 1 + lib/Transforms/IPO/InlineSimple.cpp | 3 ++- lib/Transforms/IPO/Internalize.cpp | 3 ++- lib/Transforms/IPO/MutateStructTypes.cpp | 2 +- lib/Transforms/IPO/PoolAllocate.cpp | 2 +- .../Instrumentation/ProfilePaths/Graph.cpp | 2 +- .../ProfilePaths/GraphAuxiliary.cpp | 2 +- .../ProfilePaths/GraphAuxillary.cpp | 2 +- lib/Transforms/LevelRaise.cpp | 24 ++++++++++--------- lib/Transforms/Scalar/ADCE.cpp | 3 ++- lib/Transforms/Scalar/CorrelatedExprs.cpp | 1 + lib/Transforms/Scalar/IndVarSimplify.cpp | 3 ++- lib/Transforms/Scalar/LICM.cpp | 3 ++- lib/Transforms/Scalar/PRE.cpp | 1 + lib/Transforms/Scalar/Reassociate.cpp | 1 + lib/Transforms/Scalar/SCCP.cpp | 3 ++- .../Scalar/ScalarReplAggregates.cpp | 3 ++- lib/Transforms/Scalar/TailDuplication.cpp | 1 + 25 files changed, 45 insertions(+), 28 deletions(-) diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index aff74ac9206..dd141f2daf6 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -10,6 +10,7 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Module.h" #include "Support/Statistic.h" +#include "Support/Debug.h" #include "DSCallSiteIterator.h" namespace { diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index a3fecec69cc..c25256a4fed 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -10,6 +10,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Target/TargetData.h" #include "llvm/Assembly/Writer.h" +#include "Support/Debug.h" #include "Support/STLExtras.h" #include "Support/Statistic.h" #include "Support/Timer.h" diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 641c2e0a1eb..a03354d466e 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -17,9 +17,9 @@ #include "llvm/GlobalVariable.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Target/TargetData.h" -#include "Support/Statistic.h" -#include "Support/Timer.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Timer.h" // FIXME: This should eventually be a FunctionPass that is automatically // aggregated into a Pass. diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp index 82266578470..a3034ddeac2 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/lib/Analysis/DataStructure/Steensgaard.cpp @@ -11,7 +11,7 @@ #include "llvm/Analysis/DSGraph.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Module.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" namespace { class Steens : public Pass, public AliasAnalysis { diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp index 1eeb6907894..92a03ee2f40 100644 --- a/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -10,6 +10,7 @@ #include "llvm/Analysis/DataStructure.h" #include "llvm/Module.h" #include "llvm/DerivedTypes.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "DSCallSiteIterator.h" diff --git a/lib/Analysis/InductionVariable.cpp b/lib/Analysis/InductionVariable.cpp index cdcc42f8712..3ac934e42b1 100644 --- a/lib/Analysis/InductionVariable.cpp +++ b/lib/Analysis/InductionVariable.cpp @@ -27,7 +27,7 @@ #include "llvm/Constants.h" #include "llvm/Support/CFG.h" #include "llvm/Assembly/Writer.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" static bool isLoopInvariant(const Value *V, const Loop *L) { if (isa(V) || isa(V) || isa(V)) diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index c10797615ee..070396847e7 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -13,7 +13,7 @@ #include "llvm/ConstantHandling.h" #include "llvm/Analysis/Expressions.h" #include "Support/STLExtras.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include using std::cerr; diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 568fe47d0fb..c4e73af7e83 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -17,6 +17,7 @@ #include "llvm/iOther.h" #include "llvm/iTerminators.h" #include "llvm/Support/CallSite.h" +#include "Support/Debug.h" #include "Support/Statistic.h" #include "Support/iterator" #include diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 4839186966e..cde2e4a729a 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -10,8 +10,9 @@ #include "llvm/Pass.h" #include "llvm/iOther.h" #include "llvm/iMemory.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include namespace { diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 0ed76aba628..7bca45970a9 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -9,8 +9,9 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Pass.h" #include "llvm/Module.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include #include diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp index 9df724ca78e..370b6be8940 100644 --- a/lib/Transforms/IPO/MutateStructTypes.cpp +++ b/lib/Transforms/IPO/MutateStructTypes.cpp @@ -18,7 +18,7 @@ #include "llvm/Instructions.h" #include "llvm/Constants.h" #include "Support/STLExtras.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include // ValuePlaceHolder - A stupid little marker value. It appears as an diff --git a/lib/Transforms/IPO/PoolAllocate.cpp b/lib/Transforms/IPO/PoolAllocate.cpp index 9f958add20d..095b03fad27 100644 --- a/lib/Transforms/IPO/PoolAllocate.cpp +++ b/lib/Transforms/IPO/PoolAllocate.cpp @@ -15,7 +15,7 @@ #include "llvm/Instructions.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include "Support/VectorExtras.h" using namespace PA; diff --git a/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp b/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp index 50497fdf10e..4f46e5b45c0 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/Graph.cpp @@ -7,7 +7,7 @@ #include "Graph.h" #include "llvm/iTerminators.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include using std::map; diff --git a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp index e910616d290..b9423519585 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxiliary.cpp @@ -10,7 +10,7 @@ #include "llvm/Pass.h" #include "llvm/Module.h" #include "llvm/iTerminators.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include #include "Graph.h" diff --git a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp index e910616d290..b9423519585 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/GraphAuxillary.cpp @@ -10,7 +10,7 @@ #include "llvm/Pass.h" #include "llvm/Module.h" #include "llvm/iTerminators.h" -#include "Support/Statistic.h" +#include "Support/Debug.h" #include #include "Graph.h" diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index 9f93c27f538..a5bdce758d3 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -16,11 +16,11 @@ #include "llvm/Analysis/Expressions.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" -#include "Support/STLExtras.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" +#include "Support/STLExtras.h" #include -using std::cerr; // StartInst - This enables the -raise-start-inst=foo option to cause the level // raising pass to start at instruction "foo", which is immensely useful for @@ -274,7 +274,7 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { if (ExpressionConvertibleToType(Src, DestTy, ConvertedTypes, TD)) { PRINT_PEEPHOLE3("CAST-SRC-EXPR-CONV:in ", Src, CI, BB->getParent()); - DEBUG(cerr << "\nCONVERTING SRC EXPR TYPE:\n"); + DEBUG(std::cerr << "\nCONVERTING SRC EXPR TYPE:\n"); { // ValueMap must be destroyed before function verified! ValueMapCache ValueMap; Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD); @@ -283,7 +283,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { CI->replaceAllUsesWith(CPV); PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", E); - DEBUG(cerr << "DONE CONVERTING SRC EXPR TYPE: \n" << BB->getParent()); + DEBUG(std::cerr << "DONE CONVERTING SRC EXPR TYPE: \n" + << BB->getParent()); } DEBUG(assert(verifyFunction(*BB->getParent()) == false && @@ -302,14 +303,14 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) { PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent()); - DEBUG(cerr << "\nCONVERTING EXPR TYPE:\n"); + DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n"); { // ValueMap must be destroyed before function verified! ValueMapCache ValueMap; ConvertValueToNewType(CI, Src, ValueMap, TD); // This will delete CI! } PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src); - DEBUG(cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent()); + DEBUG(std::cerr << "DONE CONVERTING EXPR TYPE: \n\n" << BB->getParent()); DEBUG(assert(verifyFunction(*BB->getParent()) == false && "Function broken!")); @@ -556,11 +557,11 @@ bool RPR::DoRaisePass(Function &F) { bool Changed = false; for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB) for (BasicBlock::iterator BI = BB->begin(); BI != BB->end();) { - DEBUG(cerr << "Processing: " << *BI); + DEBUG(std::cerr << "Processing: " << *BI); if (dceInstruction(BI) || doConstantPropagation(BI)) { Changed = true; ++NumDCEorCP; - DEBUG(cerr << "***\t\t^^-- Dead code eliminated!\n"); + DEBUG(std::cerr << "***\t\t^^-- Dead code eliminated!\n"); } else if (PeepholeOptimize(BB, BI)) { Changed = true; } else { @@ -574,7 +575,8 @@ bool RPR::DoRaisePass(Function &F) { // runOnFunction - Raise a function representation to a higher level. bool RPR::runOnFunction(Function &F) { - DEBUG(cerr << "\n\n\nStarting to work on Function '" << F.getName() << "'\n"); + DEBUG(std::cerr << "\n\n\nStarting to work on Function '" << F.getName() + << "'\n"); // Insert casts for all incoming pointer pointer values that are treated as // arrays... @@ -596,7 +598,7 @@ bool RPR::runOnFunction(Function &F) { } do { - DEBUG(cerr << "Looping: \n" << F); + DEBUG(std::cerr << "Looping: \n" << F); // Iterate over the function, refining it, until it converges on a stable // state diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index 6b838ba1862..27623fbacb9 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -15,9 +15,10 @@ #include "llvm/iPHINode.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/DepthFirstIterator.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" #include namespace { diff --git a/lib/Transforms/Scalar/CorrelatedExprs.cpp b/lib/Transforms/Scalar/CorrelatedExprs.cpp index 26bdfda6318..3e8dc0ce5da 100644 --- a/lib/Transforms/Scalar/CorrelatedExprs.cpp +++ b/lib/Transforms/Scalar/CorrelatedExprs.cpp @@ -31,6 +31,7 @@ #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/CFG.h" +#include "Support/Debug.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" #include diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 993e533abc7..4203818baaf 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -13,8 +13,9 @@ #include "llvm/Type.h" #include "llvm/Constants.h" #include "llvm/Support/CFG.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" namespace { Statistic<> NumRemoved ("indvars", "Number of aux indvars removed"); diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 9069338e323..2ac0a4466c4 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -31,8 +31,9 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Support/CFG.h" -#include "Support/Statistic.h" #include "Support/CommandLine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" #include "llvm/Assembly/Writer.h" #include diff --git a/lib/Transforms/Scalar/PRE.cpp b/lib/Transforms/Scalar/PRE.cpp index 3a1239f4e67..a97654556ca 100644 --- a/lib/Transforms/Scalar/PRE.cpp +++ b/lib/Transforms/Scalar/PRE.cpp @@ -23,6 +23,7 @@ #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/ValueNumbering.h" #include "llvm/Transforms/Scalar.h" +#include "Support/Debug.h" #include "Support/DepthFirstIterator.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 82ae37a53c1..c4f5fb1848c 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -26,6 +26,7 @@ #include "llvm/Pass.h" #include "llvm/Constant.h" #include "llvm/Support/CFG.h" +#include "Support/Debug.h" #include "Support/PostOrderIterator.h" #include "Support/Statistic.h" diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index df55037c520..c0ff2fae74c 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -20,8 +20,9 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/InstVisitor.h" -#include "Support/STLExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/STLExtras.h" #include #include diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index fceaccc89a5..e59a6e58ef0 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -13,8 +13,9 @@ #include "llvm/iMemory.h" #include "llvm/DerivedTypes.h" #include "llvm/Constants.h" -#include "Support/StringExtras.h" +#include "Support/Debug.h" #include "Support/Statistic.h" +#include "Support/StringExtras.h" namespace { Statistic<> NumReplaced("scalarrepl", "Number of alloca's broken up"); diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index eea2096a9ef..d13affceb27 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -19,6 +19,7 @@ #include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "llvm/Transforms/Utils/Local.h" +#include "Support/Debug.h" #include "Support/Statistic.h" namespace { -- 2.34.1