Saem Ghani's PassManager Patch #8:

This fixes a "gccass" regression. The -debug-pass=Structure option now
prints all the appropriate output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-01-08 22:57:07 +00:00
parent 13a0b6b58f
commit d41c981c39

View File

@@ -288,7 +288,7 @@ public:
assert(dynamic_cast<PassClass*>(this) && assert(dynamic_cast<PassClass*>(this) &&
"It wasn't the PassClass I thought it was"); "It wasn't the PassClass I thought it was");
if (Parent == 0) if (Parent == 0)
PMDebug::PerformPassStartupStuff((dynamic_cast<PassClass*>(this))); PMDebug::PerformPassStartupStuff((dynamic_cast<PMType*>(this)));
// Run all of the passes // Run all of the passes
for (unsigned i = 0, e = Passes.size(); i < e; ++i) { for (unsigned i = 0, e = Passes.size(); i < e; ++i) {
@@ -399,8 +399,9 @@ public:
} }
// dumpPassStructure - Implement the -debug-passes=PassStructure option // dumpPassStructure - Implement the -debug-passes=PassStructure option
virtual void dumpPassStructure(unsigned Offset = 0) { inline void dumpPassStructure(unsigned Offset = 0) {
// Print out the immutable passes... // Print out the immutable passes...
for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i)
ImmutablePasses[i]->dumpPassStructure(0); ImmutablePasses[i]->dumpPassStructure(0);
@@ -653,6 +654,7 @@ private:
} }
} }
} }
public: public:
// When an ImmutablePass is added, it gets added to the top level pass // When an ImmutablePass is added, it gets added to the top level pass
// manager. // manager.
@@ -723,6 +725,10 @@ public:
virtual ~BasicBlockPassManager() {} virtual ~BasicBlockPassManager() {}
virtual void dumpPassStructure(unsigned Offset = 0) {
PassManagerT<BBTraits>::dumpPassStructure(Offset);
}
// getPMName() - Return the name of the unit the PassManager operates on for // getPMName() - Return the name of the unit the PassManager operates on for
// debugging. // debugging.
virtual const char *getPMName() const { return "BasicBlock"; } virtual const char *getPMName() const { return "BasicBlock"; }
@@ -761,6 +767,10 @@ public:
virtual ~FunctionPassManagerT() {} virtual ~FunctionPassManagerT() {}
virtual void dumpPassStructure(unsigned Offset = 0) {
PassManagerT<FTraits>::dumpPassStructure(Offset);
}
// getPMName() - Return the name of the unit the PassManager operates on for // getPMName() - Return the name of the unit the PassManager operates on for
// debugging. // debugging.
virtual const char *getPMName() const { return "Function"; } virtual const char *getPMName() const { return "Function"; }
@@ -804,6 +814,10 @@ public:
virtual ~ModulePassManager() {} virtual ~ModulePassManager() {}
virtual void dumpPassStructure(unsigned Offset = 0) {
PassManagerT<MTraits>::dumpPassStructure(Offset);
}
// getPMName() - Return the name of the unit the PassManager operates on for // getPMName() - Return the name of the unit the PassManager operates on for
// debugging. // debugging.
virtual const char *getPassName() const { return "Module Pass Manager"; } virtual const char *getPassName() const { return "Module Pass Manager"; }