Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92660 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Greene 2010-01-05 01:30:02 +00:00
parent 43078d6931
commit 170c48af5a

View File

@ -15,6 +15,7 @@
#include "llvm/PassManagers.h" #include "llvm/PassManagers.h"
#include "llvm/Assembly/Writer.h" #include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h" #include "llvm/Support/Timer.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/ModuleProvider.h" #include "llvm/ModuleProvider.h"
@ -132,7 +133,7 @@ public:
// Print passes managed by this manager // Print passes managed by this manager
void dumpPassStructure(unsigned Offset) { 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) { for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
BasicBlockPass *BP = getContainedPass(Index); BasicBlockPass *BP = getContainedPass(Index);
BP->dumpPassStructure(Offset + 1); BP->dumpPassStructure(Offset + 1);
@ -272,7 +273,7 @@ public:
// Print passes managed by this manager // Print passes managed by this manager
void dumpPassStructure(unsigned Offset) { 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) { for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index); ModulePass *MP = getContainedPass(Index);
MP->dumpPassStructure(Offset + 1); MP->dumpPassStructure(Offset + 1);
@ -595,11 +596,11 @@ void PMTopLevelManager::dumpArguments() const {
if (PassDebugging < Arguments) if (PassDebugging < Arguments)
return; return;
errs() << "Pass Arguments: "; dbgs() << "Pass Arguments: ";
for (SmallVector<PMDataManager *, 8>::const_iterator I = PassManagers.begin(), for (SmallVector<PMDataManager *, 8>::const_iterator I = PassManagers.begin(),
E = PassManagers.end(); I != E; ++I) E = PassManagers.end(); I != E; ++I)
(*I)->dumpPassArguments(); (*I)->dumpPassArguments();
errs() << "\n"; dbgs() << "\n";
} }
void PMTopLevelManager::initializeAllAnalysisInfo() { void PMTopLevelManager::initializeAllAnalysisInfo() {
@ -718,8 +719,8 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
// Remove this analysis // Remove this analysis
if (PassDebugging >= Details) { if (PassDebugging >= Details) {
Pass *S = Info->second; Pass *S = Info->second;
errs() << " -- '" << P->getPassName() << "' is not preserving '"; dbgs() << " -- '" << P->getPassName() << "' is not preserving '";
errs() << S->getPassName() << "'\n"; dbgs() << S->getPassName() << "'\n";
} }
AvailableAnalysis.erase(Info); AvailableAnalysis.erase(Info);
} }
@ -742,8 +743,8 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
// Remove this analysis // Remove this analysis
if (PassDebugging >= Details) { if (PassDebugging >= Details) {
Pass *S = Info->second; Pass *S = Info->second;
errs() << " -- '" << P->getPassName() << "' is not preserving '"; dbgs() << " -- '" << P->getPassName() << "' is not preserving '";
errs() << S->getPassName() << "'\n"; dbgs() << S->getPassName() << "'\n";
} }
InheritedAnalysis[Index]->erase(Info); InheritedAnalysis[Index]->erase(Info);
} }
@ -764,9 +765,9 @@ void PMDataManager::removeDeadPasses(Pass *P, StringRef Msg,
TPM->collectLastUses(DeadPasses, P); TPM->collectLastUses(DeadPasses, P);
if (PassDebugging >= Details && !DeadPasses.empty()) { if (PassDebugging >= Details && !DeadPasses.empty()) {
errs() << " -*- '" << P->getPassName(); dbgs() << " -*- '" << P->getPassName();
errs() << "' is the last user of following pass instances."; dbgs() << "' is the last user of following pass instances.";
errs() << " Free these instances\n"; dbgs() << " Free these instances\n";
} }
for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(), for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(),
@ -959,7 +960,7 @@ void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{
for (SmallVector<Pass *, 12>::iterator I = LUses.begin(), for (SmallVector<Pass *, 12>::iterator I = LUses.begin(),
E = LUses.end(); I != E; ++I) { E = LUses.end(); I != E; ++I) {
llvm::errs() << "--" << std::string(Offset*2, ' '); llvm::dbgs() << "--" << std::string(Offset*2, ' ');
(*I)->dumpPassStructure(0); (*I)->dumpPassStructure(0);
} }
} }
@ -972,7 +973,7 @@ void PMDataManager::dumpPassArguments() const {
else else
if (const PassInfo *PI = (*I)->getPassInfo()) if (const PassInfo *PI = (*I)->getPassInfo())
if (!PI->isAnalysisGroup()) if (!PI->isAnalysisGroup())
errs() << " -" << PI->getPassArgument(); dbgs() << " -" << PI->getPassArgument();
} }
} }
@ -981,35 +982,35 @@ void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
StringRef Msg) { StringRef Msg) {
if (PassDebugging < Executions) if (PassDebugging < Executions)
return; return;
errs() << (void*)this << std::string(getDepth()*2+1, ' '); dbgs() << (void*)this << std::string(getDepth()*2+1, ' ');
switch (S1) { switch (S1) {
case EXECUTION_MSG: case EXECUTION_MSG:
errs() << "Executing Pass '" << P->getPassName(); dbgs() << "Executing Pass '" << P->getPassName();
break; break;
case MODIFICATION_MSG: case MODIFICATION_MSG:
errs() << "Made Modification '" << P->getPassName(); dbgs() << "Made Modification '" << P->getPassName();
break; break;
case FREEING_MSG: case FREEING_MSG:
errs() << " Freeing Pass '" << P->getPassName(); dbgs() << " Freeing Pass '" << P->getPassName();
break; break;
default: default:
break; break;
} }
switch (S2) { switch (S2) {
case ON_BASICBLOCK_MSG: case ON_BASICBLOCK_MSG:
errs() << "' on BasicBlock '" << Msg << "'...\n"; dbgs() << "' on BasicBlock '" << Msg << "'...\n";
break; break;
case ON_FUNCTION_MSG: case ON_FUNCTION_MSG:
errs() << "' on Function '" << Msg << "'...\n"; dbgs() << "' on Function '" << Msg << "'...\n";
break; break;
case ON_MODULE_MSG: case ON_MODULE_MSG:
errs() << "' on Module '" << Msg << "'...\n"; dbgs() << "' on Module '" << Msg << "'...\n";
break; break;
case ON_LOOP_MSG: case ON_LOOP_MSG:
errs() << "' on Loop '" << Msg << "'...\n"; dbgs() << "' on Loop '" << Msg << "'...\n";
break; break;
case ON_CG_MSG: case ON_CG_MSG:
errs() << "' on Call Graph Nodes '" << Msg << "'...\n"; dbgs() << "' on Call Graph Nodes '" << Msg << "'...\n";
break; break;
default: default:
break; break;
@ -1039,12 +1040,12 @@ void PMDataManager::dumpAnalysisUsage(StringRef Msg, const Pass *P,
assert(PassDebugging >= Details); assert(PassDebugging >= Details);
if (Set.empty()) if (Set.empty())
return; 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) { for (unsigned i = 0; i != Set.size(); ++i) {
if (i) errs() << ','; if (i) dbgs() << ',';
errs() << ' ' << Set[i]->getPassName(); dbgs() << ' ' << Set[i]->getPassName();
} }
errs() << '\n'; dbgs() << '\n';
} }
/// Add RequiredPass into list of lower level passes required by pass P. /// 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 // checks whether any lower level manager will be able to provide this
// analysis info on demand or not. // analysis info on demand or not.
#ifndef NDEBUG #ifndef NDEBUG
errs() << "Unable to schedule '" << RequiredPass->getPassName(); dbgs() << "Unable to schedule '" << RequiredPass->getPassName();
errs() << "' required by '" << P->getPassName() << "'\n"; dbgs() << "' required by '" << P->getPassName() << "'\n";
#endif #endif
llvm_unreachable("Unable to schedule pass"); llvm_unreachable("Unable to schedule pass");
} }
@ -1300,7 +1301,7 @@ bool FunctionPassManagerImpl::run(Function &F) {
char FPPassManager::ID = 0; char FPPassManager::ID = 0;
/// Print passes managed by this manager /// Print passes managed by this manager
void FPPassManager::dumpPassStructure(unsigned Offset) { 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) { for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
FunctionPass *FP = getContainedPass(Index); FunctionPass *FP = getContainedPass(Index);
FP->dumpPassStructure(Offset + 1); FP->dumpPassStructure(Offset + 1);