diff options
author | Devang Patel <dpatel@apple.com> | 2006-12-08 22:57:48 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-12-08 22:57:48 +0000 |
commit | c475692c5ee2f9c0c6988b7ec28768ef6690bfb0 (patch) | |
tree | 89adc29e5af3f5860eecd3ef6307aa52d62f70cc /lib/VMCore/PassManager.cpp | |
parent | a083e94f7971ddafb817b1bcd86992d9fc4d8f9e (diff) |
Implement top level FunctionPassManager::run(Function &F)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/PassManager.cpp')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 5c9da43b86..3207ef2a3f 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -401,6 +401,7 @@ public: /// so, return true. bool runOnModule(Module &M); bool runOnFunction(Function &F); + bool run(Function &F); /// doInitialization - Run all of the initializers for the function passes. /// @@ -800,7 +801,7 @@ bool FunctionPassManager_New::run(Function &F) { cerr << "Error reading bytecode file: " << errstr << "\n"; abort(); } - return FPM->runOnFunction(F); + return FPM->run(F); } @@ -934,6 +935,19 @@ inline bool FunctionPassManagerImpl_New::doFinalization(Module &M) { return Changed; } +// Execute all the passes managed by this top level manager. +// Return true if any function is modified by a pass. +bool FunctionPassManagerImpl_New::run(Function &F) { + + bool Changed = false; + for (std::vector<Pass *>::iterator I = passManagersBegin(), + E = passManagersEnd(); I != E; ++I) { + FunctionPass *FP = dynamic_cast<FunctionPass *>(*I); + Changed |= FP->runOnFunction(F); + } + return Changed; +} + //===----------------------------------------------------------------------===// // ModulePassManager implementation |