diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-26 09:17:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-26 09:17:06 +0000 |
commit | 62c804a3ea537a83f307ed9c2788138cc47cc2ed (patch) | |
tree | 4fa3d0ad83de69aa3cc9edbdd65ba28b78b06680 /lib/Transforms/LevelRaise.cpp | |
parent | f525eb905614b418939b6a49f9ee57caf15cc168 (diff) |
Removed #include <iostream> and used the llvm_cerr/DOUT streams instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/LevelRaise.cpp')
-rw-r--r-- | lib/Transforms/LevelRaise.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index 4c366bdd33..7713609907 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -24,7 +24,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include <algorithm> -#include <iostream> using namespace llvm; // StartInst - This enables the -raise-start-inst=foo option to cause the level @@ -54,7 +53,7 @@ static Statistic<> NumVarargCallChanges("raise", "Number of vararg call peepholes"); #define PRINT_PEEPHOLE(ID, NUM, I) \ - DEBUG(std::cerr << "Inst P/H " << ID << "[" << NUM << "] " << I) + DOUT << "Inst P/H " << ID << "[" << NUM << "] " << I #define PRINT_PEEPHOLE1(ID, I1) do { PRINT_PEEPHOLE(ID, 0, I1); } while (0) #define PRINT_PEEPHOLE2(ID, I1, I2) \ @@ -140,7 +139,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(std::cerr << "\nCONVERTING SRC EXPR TYPE:\n"); + DOUT << "\nCONVERTING SRC EXPR TYPE:\n"; { // ValueMap must be destroyed before function verified! ValueMapCache ValueMap; Value *E = ConvertExpressionToType(Src, DestTy, ValueMap, TD); @@ -149,8 +148,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { CI->replaceAllUsesWith(CPV); PRINT_PEEPHOLE1("CAST-SRC-EXPR-CONV:out", *E); - DEBUG(std::cerr << "DONE CONVERTING SRC EXPR TYPE: \n" - << *BB->getParent()); + DOUT << "DONE CONVERTING SRC EXPR TYPE: \n" + << *BB->getParent(); } BI = BB->begin(); // Rescan basic block. BI might be invalidated. @@ -168,15 +167,14 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { //PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", *Src, *CI, // *BB->getParent()); - DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n"); + DOUT << "\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(std::cerr << "DONE CONVERTING EXPR TYPE: \n\n" << - *BB->getParent()); + DOUT << "DONE CONVERTING EXPR TYPE: \n\n" << *BB->getParent(); BI = BB->begin(); // Rescan basic block. BI might be invalidated. ++NumExprTreesConv; @@ -402,11 +400,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(std::cerr << "LevelRaising: " << *BI); + DOUT << "LevelRaising: " << *BI; if (dceInstruction(BI) || doConstantPropagation(BI)) { Changed = true; ++NumDCEorCP; - DEBUG(std::cerr << "***\t\t^^-- Dead code eliminated!\n"); + DOUT << "***\t\t^^-- Dead code eliminated!\n"; } else if (PeepholeOptimize(BB, BI)) { Changed = true; } else { @@ -420,8 +418,7 @@ bool RPR::DoRaisePass(Function &F) { // runOnFunction - Raise a function representation to a higher level. bool RPR::runOnFunction(Function &F) { - DEBUG(std::cerr << "\n\n\nStarting to work on Function '" << F.getName() - << "'\n"); + DOUT << "\n\n\nStarting to work on Function '" << F.getName() << "'\n"; // Insert casts for all incoming pointer pointer values that are treated as // arrays... @@ -443,7 +440,7 @@ bool RPR::runOnFunction(Function &F) { } do { - DEBUG(std::cerr << "Looping: \n" << F); + DOUT << "Looping: \n" << F; // Iterate over the function, refining it, until it converges on a stable // state |