aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Pass.cpp15
-rw-r--r--lib/VMCore/PassManagerT.h3
-rw-r--r--lib/VMCore/Verifier.cpp2
3 files changed, 15 insertions, 5 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index 0344dd6..48e608e 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -97,12 +97,12 @@ TimingInfo::~TimingInfo() {
cerr << std::string(79, '=') << "\n"
<< " ... Pass execution timing report ...\n"
<< std::string(79, '=') << "\n Total Execution Time: " << TotalTime
- << " seconds\n\n % Time: Seconds:\tPass Name (mangled):\n";
+ << " seconds\n\n % Time: Seconds:\tPass Name:\n";
// Loop through all of the timing data, printing it out...
for (unsigned i = 0, e = Data.size(); i != e; ++i) {
fprintf(stderr, " %6.2f%% %fs\t%s\n", Data[i].first*100 / TotalTime,
- Data[i].first, typeid(*Data[i].second).name());
+ Data[i].first, Data[i].second->getPassName());
}
cerr << " 100.00% " << TotalTime << "s\tTOTAL\n"
<< std::string(79, '=') << "\n";
@@ -137,7 +137,7 @@ void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
Pass *P, Annotable *V) {
if (PassDebugging >= PassExecutions) {
std::cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
- << typeid(*P).name();
+ << P->getPassName();
if (V) {
std::cerr << "' on ";
@@ -160,7 +160,7 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
std::cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:";
for (unsigned i = 0; i != Set.size(); ++i) {
Pass *P = Set[i].createPass(); // Good thing this is just debug code...
- std::cerr << " " << typeid(*P).name();
+ std::cerr << " " << P->getPassName();
delete P;
}
std::cerr << "\n";
@@ -169,7 +169,7 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
// dumpPassStructure - Implement the -debug-passes=PassStructure option
void Pass::dumpPassStructure(unsigned Offset = 0) {
- std::cerr << std::string(Offset*2, ' ') << typeid(*this).name() << "\n";
+ std::cerr << std::string(Offset*2, ' ') << getPassName() << "\n";
}
@@ -181,6 +181,11 @@ void Pass::addToPassManager(PassManagerT<Module> *PM, AnalysisUsage &AU) {
PM->addPass(this, AU);
}
+
+// getPassName - Use C++ RTTI to get a SOMEWHAT intelligable name for the pass.
+//
+const char *Pass::getPassName() const { return typeid(*this).name(); }
+
//===----------------------------------------------------------------------===//
// FunctionPass Implementation
//
diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h
index 8d1716b..c72af14 100644
--- a/lib/VMCore/PassManagerT.h
+++ b/lib/VMCore/PassManagerT.h
@@ -434,6 +434,7 @@ template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass {
// getPMName() - Return the name of the unit the PassManager operates on for
// debugging.
const char *getPMName() const { return "BasicBlock"; }
+ virtual const char *getPassName() const { return "BasicBlock Pass Manager"; }
// Implement the BasicBlockPass interface...
virtual bool doInitialization(Module *M);
@@ -477,6 +478,7 @@ template<> struct PassManagerTraits<Function> : public FunctionPass {
// getPMName() - Return the name of the unit the PassManager operates on for
// debugging.
const char *getPMName() const { return "Function"; }
+ virtual const char *getPassName() const { return "Function Pass Manager"; }
// Implement the FunctionPass interface...
virtual bool doInitialization(Module *M);
@@ -510,6 +512,7 @@ template<> struct PassManagerTraits<Module> : public Pass {
// getPMName() - Return the name of the unit the PassManager operates on for
// debugging.
const char *getPMName() const { return "Module"; }
+ virtual const char *getPassName() const { return "Module Pass Manager"; }
// TimingInformation - This data member maintains timing information for each
// of the passes that is executed.
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 8621ea7..0196a99 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -58,6 +58,8 @@ namespace { // Anonymous namespace for class
Verifier() : Broken(false) {}
+ virtual const char *getPassName() const { return "Module Verifier"; }
+
bool doInitialization(Module *M) {
verifySymbolTable(M->getSymbolTable());
return false;