initialize and finalize function passes, pointed out by Cameron.

llvm-svn: 131843
This commit is contained in:
Chris Lattner 2011-05-22 06:44:19 +00:00
parent 9f1d2ded13
commit ef8cf6d421
1 changed files with 4 additions and 1 deletions

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)