summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-15 21:13:42 +0000
committerDevang Patel <dpatel@apple.com>2008-09-15 21:13:42 +0000
commit89e9ed379569528f75a29f2367fccc06a39fe201 (patch)
treee786fa97081415526190ea4a1029ffd358769e20 /include/llvm
parentb3d72996947710d76aded92da00e895c7b37e686 (diff)
downloadllvm-89e9ed379569528f75a29f2367fccc06a39fe201.tar.gz
llvm-89e9ed379569528f75a29f2367fccc06a39fe201.tar.bz2
llvm-89e9ed379569528f75a29f2367fccc06a39fe201.tar.xz
Extract optimization pass selection code from llvm-gcc into a separate routine.
This can be used by other stand alone tools, such as 'opt'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/PassManagerUtils.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/llvm/PassManagerUtils.h b/include/llvm/PassManagerUtils.h
new file mode 100644
index 0000000000..8d34c358ef
--- /dev/null
+++ b/include/llvm/PassManagerUtils.h
@@ -0,0 +1,36 @@
+//===-- llvm/Support/PassManagerUtils.h -------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides interface to pass manager utilities.
+//
+//===----------------------------------------------------------------------===//
+
+namespace llvm {
+
+class FunctionPassManager;
+class PassManager;
+
+/// AddOptimizationPasses - This routine adds optimization passes
+/// based on selected optimization level, OptLevel. This routine is
+/// used by llvm-gcc and other tools.
+///
+/// OptLevel - Optimization Level
+/// EnableIPO - Enables IPO passes. llvm-gcc enables this when
+/// flag_unit_at_a_time is set.
+/// InlinerSelection - 1 : Add function inliner.
+/// - 2 : Add AlwaysInliner.
+/// OptLibCalls - Simplify lib calls, if set.
+/// PruneEH - Add PruneEHPass, if set.
+/// UnrollLoop - Unroll loops, if set.
+void AddOptimizationPasses(FunctionPassManager &FPM, PassManager &MPM,
+ unsigned OptLevel, bool EnableIPO,
+ unsigned InlinerSelection, bool OptLibCalls,
+ bool PruneEH, bool UnrollLoop);
+
+}