From 3e8984a0c43b04d8a8fe88a9c187e9e338d169b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 May 2011 06:44:19 +0000 Subject: [PATCH] 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 --- tools/opt/opt.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 251edc48200..12f7fcb72bb 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -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)