summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/PassManager.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:37:28 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:37:28 +0000
commit3fba7d16b41dfbefe3b1be6bc0ab94c017728f79 (patch)
treebe5a687969f682edded4aa6f13594ffd9aa9030e /lib/VMCore/PassManager.cpp
parenta16c51cee9225a354c999dd1076d5dba2aa79807 (diff)
downloadFreeBSD-src-3fba7d16b41dfbefe3b1be6bc0ab94c017728f79.zip
FreeBSD-src-3fba7d16b41dfbefe3b1be6bc0ab94c017728f79.tar.gz
Update LLVM to 93512.
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r--lib/VMCore/PassManager.cpp67
1 files changed, 34 insertions, 33 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp
index d688385..b37b2ae 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<PMDataManager *, 8>::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<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(),
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);
@@ -1698,19 +1699,19 @@ LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P) {
return wrap(new FunctionPassManager(unwrap(P)));
}
-int LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) {
+LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) {
return unwrap<PassManager>(PM)->run(*unwrap(M));
}
-int LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) {
+LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) {
return unwrap<FunctionPassManager>(FPM)->doInitialization();
}
-int LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) {
+LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) {
return unwrap<FunctionPassManager>(FPM)->run(*unwrap<Function>(F));
}
-int LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) {
+LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) {
return unwrap<FunctionPassManager>(FPM)->doFinalization();
}
OpenPOWER on IntegriCloud