diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-27 01:12:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-27 01:12:17 +0000 |
commit | a59cbb2043c08f3cfb8fb379f0d336e21e070be8 (patch) | |
tree | 19ace2fcd6b60628e49d6c65ca1015cbff960916 /lib/VMCore/Pass.cpp | |
parent | 97f51a3024a72ef8500e95b90e6361e6783160fd (diff) | |
download | external_llvm-a59cbb2043c08f3cfb8fb379f0d336e21e070be8.zip external_llvm-a59cbb2043c08f3cfb8fb379f0d336e21e070be8.tar.gz external_llvm-a59cbb2043c08f3cfb8fb379f0d336e21e070be8.tar.bz2 |
* Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID: Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
the analyses themselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index d831560..fb751b5 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -22,7 +22,7 @@ // static std::vector<AnalysisID> CFGOnlyAnalyses; - +#if 0 // Source of unique analysis ID #'s. unsigned AnalysisID::NextID = 0; @@ -35,6 +35,7 @@ AnalysisID::AnalysisID(const AnalysisID &AID, bool DependsOnlyOnCFG) { if (DependsOnlyOnCFG) CFGOnlyAnalyses.push_back(AID); } +#endif //===----------------------------------------------------------------------===// // AnalysisResolver Class Implementation @@ -190,7 +191,8 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, if (PassDebugging >= Details && !Set.empty()) { 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... + // FIXME: This can use the local pass map! + Pass *P = Set[i]->createPass(); // Good thing this is just debug code... std::cerr << " " << P->getPassName(); delete P; } @@ -217,6 +219,19 @@ void Pass::addToPassManager(PassManagerT<Module> *PM, AnalysisUsage &AU) { // const char *Pass::getPassName() const { return typeid(*this).name(); } +// print - Print out the internal state of the pass. This is called by Analyse +// to print out the contents of an analysis. Otherwise it is not neccesary to +// implement this method. +// +void Pass::print(std::ostream &O) const { + O << "Pass::print not implemented for pass: '" << getPassName() << "'!\n"; +} + +// dump - call print(std::cerr); +void Pass::dump() const { + print(std::cerr, 0); +} + //===----------------------------------------------------------------------===// // FunctionPass Implementation // |