diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-01-11 11:52:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-01-11 11:52:05 +0000 |
commit | b56749c3b7bd3867d5a500b9882decd957244620 (patch) | |
tree | e20a9070e3aa16ad2092503b4f51f7f5bdc48857 /include/llvm/IR/PassManager.h | |
parent | d55b5fe9920554cebf5976316915bb07165734b4 (diff) | |
download | llvm-b56749c3b7bd3867d5a500b9882decd957244620.tar.gz llvm-b56749c3b7bd3867d5a500b9882decd957244620.tar.bz2 llvm-b56749c3b7bd3867d5a500b9882decd957244620.tar.xz |
[PM] Add names to passes under the new pass manager, and a debug output
mode that can be used to debug the execution of everything.
No support for analyses here, that will come later. This already helps
show parts of the opt commandline integration that isn't working. Tests
of that will start using it as the bugs are fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/PassManager.h')
-rw-r--r-- | include/llvm/IR/PassManager.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/IR/PassManager.h b/include/llvm/IR/PassManager.h index b85f7f1762..09eb10b846 100644 --- a/include/llvm/IR/PassManager.h +++ b/include/llvm/IR/PassManager.h @@ -168,6 +168,9 @@ template <typename IRUnitT, typename AnalysisManagerT> struct PassConcept { /// desired. Also that the analysis manager may be null if there is no /// analysis manager in the pass pipeline. virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) = 0; + + /// \brief Polymorphic method to access the name of a pass. + virtual StringRef name() = 0; }; /// \brief SFINAE metafunction for computing whether \c PassT has a run method @@ -208,6 +211,7 @@ struct PassModel<IRUnitT, AnalysisManagerT, PassT, virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) { return Pass.run(IR, AM); } + virtual StringRef name() { return PassT::name(); } PassT Pass; }; @@ -221,6 +225,7 @@ struct PassModel<IRUnitT, AnalysisManagerT, PassT, virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) { return Pass.run(IR); } + virtual StringRef name() { return PassT::name(); } PassT Pass; }; @@ -403,6 +408,8 @@ public: Passes.push_back(new ModulePassModel<ModulePassT>(llvm_move(Pass))); } + static StringRef name() { return "ModulePassManager"; } + private: // Pull in the concept type and model template specialized for modules. typedef detail::PassConcept<Module *, ModuleAnalysisManager> ModulePassConcept; @@ -428,6 +435,8 @@ public: PreservedAnalyses run(Function *F, FunctionAnalysisManager *AM = 0); + static StringRef name() { return "FunctionPassManager"; } + private: // Pull in the concept type and model template specialized for functions. typedef detail::PassConcept<Function *, FunctionAnalysisManager> @@ -808,6 +817,8 @@ public: return PA; } + static StringRef name() { return "ModuleToFunctionPassAdaptor"; } + private: FunctionPassT Pass; }; |