initialize and finalize function passes, pointed out by Cameron.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2011-05-22 06:44:19 +00:00
parent c4cb237ca6
commit 3e8984a0c4

View File

@ -682,9 +682,12 @@ int main(int argc, char **argv) {
if (OptLevelO3)
AddOptimizationPasses(Passes, *FPasses, 3);
if (OptLevelO1 || OptLevelO2 || OptLevelO3)
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
FPasses->doInitialization();
for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F)
FPasses->run(*F);
FPasses->doFinalization();
}
// Check that the module is well formed on completion of optimization
if (!NoVerify && !VerifyEach)