Extract optimization pass selection code from llvm-gcc into a separate routine.
[oota-llvm.git] / include / llvm / PassManagerUtils.h
1 //===-- llvm/Support/PassManagerUtils.h -------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides interface to pass manager utilities.
11 //
12 //===----------------------------------------------------------------------===//
13
14 namespace llvm {
15
16 class FunctionPassManager;
17 class PassManager;
18
19 /// AddOptimizationPasses - This routine adds optimization passes 
20 /// based on selected optimization level, OptLevel. This routine is
21 /// used by llvm-gcc and other tools.
22 ///
23 /// OptLevel - Optimization Level
24 /// EnableIPO - Enables IPO passes. llvm-gcc enables this when
25 ///             flag_unit_at_a_time is set.
26 /// InlinerSelection - 1 : Add function inliner.
27 ///                  - 2 : Add AlwaysInliner.
28 /// OptLibCalls - Simplify lib calls, if set.
29 /// PruneEH - Add PruneEHPass, if set.
30 /// UnrollLoop - Unroll loops, if set.
31 void AddOptimizationPasses(FunctionPassManager &FPM, PassManager &MPM,
32                            unsigned OptLevel, bool EnableIPO,
33                            unsigned InlinerSelection, bool OptLibCalls,
34                            bool PruneEH, bool UnrollLoop);
35
36 }