From cdf8efde6ae62bdca02b088dcfdf647fce10c6f1 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 29 May 2007 23:15:21 +0000 Subject: [PATCH] Use proper debugging facilities so other people don't have to look at my commented-out debugging lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37347 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVNPRE.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 6e1cf8ec72d..7f76fa10735 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -28,10 +28,10 @@ #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" #include #include #include -#include using namespace llvm; namespace { @@ -288,11 +288,13 @@ void GVNPRE::clean(GVNPRE::ValueTable VN, std::set& set) { } void GVNPRE::dump(GVNPRE::ValueTable& VN, std::set& s) { - printf("{ "); + DOUT << "{ "; for (std::set::iterator I = s.begin(), E = s.end(); I != E; ++I) { - printf("(%d, %s, value.%d, value.%d) ", I->opcode, I->value == 0 ? "0" : I->value->getName().c_str(), I->lhs, I->rhs); + DOUT << "( " << I->opcode << ", " + << (I->value == 0 ? "0" : I->value->getName().c_str()) + << ", value." << I->lhs << ", value." << I->rhs << " ) "; } - printf("}\n\n"); + DOUT << "}\n\n"; } void GVNPRE::CalculateAvailOut(GVNPRE::ValueTable& VN, std::set& MS, @@ -439,21 +441,23 @@ bool GVNPRE::runOnFunction(Function &F) { iterations++; } - /*printf("Iterations: %d\n", iterations); + DOUT << "Iterations: " << iterations << "\n"; for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) { - printf("Name: "); - printf(I->getName().c_str()); - printf("\nTMP_GEN: "); + DOUT << "Name: " << I->getName().c_str() << "\n"; + + DOUT << "TMP_GEN: "; dump(VN, generatedTemporaries[I]); - printf("\nEXP_GEN: "); + DOUT << "\n"; + + DOUT << "EXP_GEN: "; dump(VN, generatedExpressions[I]); - //printf("\nANTIC_OUT: "); - //dump(VN, anticipatedOut[I]); - printf("\nANTIC_IN: \n"); + DOUT << "\n"; + + DOUT << "ANTIC_IN: "; dump(VN, anticipatedIn[I]); - printf("\n"); - }*/ + DOUT << "\n"; + } return false; }