From 170c48af5a7d760631cf897944a9833a74ac22dd Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 5 Jan 2010 01:30:02 +0000 Subject: [PATCH] Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92660 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/PassManager.cpp | 59 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index d6883858402..1d461c3d4b3 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -15,6 +15,7 @@ #include "llvm/PassManagers.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" @@ -132,7 +133,7 @@ public: // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { - llvm::errs() << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; + llvm::dbgs() << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { BasicBlockPass *BP = getContainedPass(Index); BP->dumpPassStructure(Offset + 1); @@ -272,7 +273,7 @@ public: // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { - llvm::errs() << std::string(Offset*2, ' ') << "ModulePass Manager\n"; + llvm::dbgs() << std::string(Offset*2, ' ') << "ModulePass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { ModulePass *MP = getContainedPass(Index); MP->dumpPassStructure(Offset + 1); @@ -595,11 +596,11 @@ void PMTopLevelManager::dumpArguments() const { if (PassDebugging < Arguments) return; - errs() << "Pass Arguments: "; + dbgs() << "Pass Arguments: "; for (SmallVector::const_iterator I = PassManagers.begin(), E = PassManagers.end(); I != E; ++I) (*I)->dumpPassArguments(); - errs() << "\n"; + dbgs() << "\n"; } void PMTopLevelManager::initializeAllAnalysisInfo() { @@ -718,8 +719,8 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) { // Remove this analysis if (PassDebugging >= Details) { Pass *S = Info->second; - errs() << " -- '" << P->getPassName() << "' is not preserving '"; - errs() << S->getPassName() << "'\n"; + dbgs() << " -- '" << P->getPassName() << "' is not preserving '"; + dbgs() << S->getPassName() << "'\n"; } AvailableAnalysis.erase(Info); } @@ -742,8 +743,8 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) { // Remove this analysis if (PassDebugging >= Details) { Pass *S = Info->second; - errs() << " -- '" << P->getPassName() << "' is not preserving '"; - errs() << S->getPassName() << "'\n"; + dbgs() << " -- '" << P->getPassName() << "' is not preserving '"; + dbgs() << S->getPassName() << "'\n"; } InheritedAnalysis[Index]->erase(Info); } @@ -764,9 +765,9 @@ void PMDataManager::removeDeadPasses(Pass *P, StringRef Msg, TPM->collectLastUses(DeadPasses, P); if (PassDebugging >= Details && !DeadPasses.empty()) { - errs() << " -*- '" << P->getPassName(); - errs() << "' is the last user of following pass instances."; - errs() << " Free these instances\n"; + dbgs() << " -*- '" << P->getPassName(); + dbgs() << "' is the last user of following pass instances."; + dbgs() << " Free these instances\n"; } for (SmallVector::iterator I = DeadPasses.begin(), @@ -959,7 +960,7 @@ void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{ for (SmallVector::iterator I = LUses.begin(), E = LUses.end(); I != E; ++I) { - llvm::errs() << "--" << std::string(Offset*2, ' '); + llvm::dbgs() << "--" << std::string(Offset*2, ' '); (*I)->dumpPassStructure(0); } } @@ -972,7 +973,7 @@ void PMDataManager::dumpPassArguments() const { else if (const PassInfo *PI = (*I)->getPassInfo()) if (!PI->isAnalysisGroup()) - errs() << " -" << PI->getPassArgument(); + dbgs() << " -" << PI->getPassArgument(); } } @@ -981,35 +982,35 @@ void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1, StringRef Msg) { if (PassDebugging < Executions) return; - errs() << (void*)this << std::string(getDepth()*2+1, ' '); + dbgs() << (void*)this << std::string(getDepth()*2+1, ' '); switch (S1) { case EXECUTION_MSG: - errs() << "Executing Pass '" << P->getPassName(); + dbgs() << "Executing Pass '" << P->getPassName(); break; case MODIFICATION_MSG: - errs() << "Made Modification '" << P->getPassName(); + dbgs() << "Made Modification '" << P->getPassName(); break; case FREEING_MSG: - errs() << " Freeing Pass '" << P->getPassName(); + dbgs() << " Freeing Pass '" << P->getPassName(); break; default: break; } switch (S2) { case ON_BASICBLOCK_MSG: - errs() << "' on BasicBlock '" << Msg << "'...\n"; + dbgs() << "' on BasicBlock '" << Msg << "'...\n"; break; case ON_FUNCTION_MSG: - errs() << "' on Function '" << Msg << "'...\n"; + dbgs() << "' on Function '" << Msg << "'...\n"; break; case ON_MODULE_MSG: - errs() << "' on Module '" << Msg << "'...\n"; + dbgs() << "' on Module '" << Msg << "'...\n"; break; case ON_LOOP_MSG: - errs() << "' on Loop '" << Msg << "'...\n"; + dbgs() << "' on Loop '" << Msg << "'...\n"; break; case ON_CG_MSG: - errs() << "' on Call Graph Nodes '" << Msg << "'...\n"; + dbgs() << "' on Call Graph Nodes '" << Msg << "'...\n"; break; default: break; @@ -1039,12 +1040,12 @@ void PMDataManager::dumpAnalysisUsage(StringRef Msg, const Pass *P, assert(PassDebugging >= Details); if (Set.empty()) return; - errs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; + dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { - if (i) errs() << ','; - errs() << ' ' << Set[i]->getPassName(); + if (i) dbgs() << ','; + dbgs() << ' ' << Set[i]->getPassName(); } - errs() << '\n'; + dbgs() << '\n'; } /// Add RequiredPass into list of lower level passes required by pass P. @@ -1067,8 +1068,8 @@ void PMDataManager::addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) { // checks whether any lower level manager will be able to provide this // analysis info on demand or not. #ifndef NDEBUG - errs() << "Unable to schedule '" << RequiredPass->getPassName(); - errs() << "' required by '" << P->getPassName() << "'\n"; + dbgs() << "Unable to schedule '" << RequiredPass->getPassName(); + dbgs() << "' required by '" << P->getPassName() << "'\n"; #endif llvm_unreachable("Unable to schedule pass"); } @@ -1300,7 +1301,7 @@ bool FunctionPassManagerImpl::run(Function &F) { char FPPassManager::ID = 0; /// Print passes managed by this manager void FPPassManager::dumpPassStructure(unsigned Offset) { - llvm::errs() << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; + llvm::dbgs() << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); FP->dumpPassStructure(Offset + 1);