diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-04 04:07:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-04 04:07:39 +0000 |
commit | b2cd4bac87b7d5514101660507ffac34370b7a3a (patch) | |
tree | 1596f31930bf29f3ba79849eaa7b1ee25ea3f93c /lib/VMCore/Pass.cpp | |
parent | 3199af2874ac10b534b0306fe4e57d20a5c6b028 (diff) | |
download | external_llvm-b2cd4bac87b7d5514101660507ffac34370b7a3a.zip external_llvm-b2cd4bac87b7d5514101660507ffac34370b7a3a.tar.gz external_llvm-b2cd4bac87b7d5514101660507ffac34370b7a3a.tar.bz2 |
Add explicit doInitialization/doFinalization methods instead of making
the FunctionPassManager redo this for each function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index a06f084..cf7e1c0 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -94,13 +94,26 @@ FunctionPassManager::FunctionPassManager(ModuleProvider *P) : FunctionPassManager::~FunctionPassManager() { delete PM; } void FunctionPassManager::add(FunctionPass *P) { PM->add(P); } void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); } + +/// doInitialization - Run all of the initializers for the function passes. +/// +bool FunctionPassManager::doInitialization() { + return PM->doInitialization(*MP->getModule()); +} + bool FunctionPassManager::run(Function &F) { std::string errstr; if (MP->materializeFunction(&F, &errstr)) { std::cerr << "Error reading bytecode file: " << errstr << "\n"; abort(); } - return PM->run(F); + return PM->runOnFunction(F); +} + +/// doFinalization - Run all of the initializers for the function passes. +/// +bool FunctionPassManager::doFinalization() { + return PM->doFinalization(*MP->getModule()); } |