1 //===- CompilerDriver.h - Compiler Driver ---------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the CompilerDriver class which implements the bulk of the
11 // LLVM Compiler Driver program (llvmc).
13 //===------------------------------------------------------------------------===
16 /// This class provides the high level interface to the LLVM Compiler Driver.
17 /// The driver's purpose is to make it easier for compiler writers and users
18 /// of LLVM to utilize the compiler toolkits and LLVM toolset by learning only
19 /// the interface of one program (llvmc).
22 /// @brief The interface to the LLVM Compiler Driver.
23 class CompilerDriver {
27 typedef unsigned OptimizationLevel;
29 PREPROCESSING, ///< Source language combining, filtering, substitution
30 TRANSLATION, ///< Translate source -> LLVM bytecode/assembly
31 OPTIMIZATION, ///< Optimize translation result
32 LINKING, ///< Link bytecode and native code
33 ASSEMBLY, ///< Convert program to executable
36 enum OptimizationLevels {
42 OPT_AGGRESSIVE_LINK_TIME
46 /// @name Constructors
55 void execute(); ///< Execute the actions requested
61 /// @brief Set the optimization level for the compilation
62 void setOptimization( OptimizationLevel level );
63 void setFinalPhase( Phases phase );
70 OptimizationLevel optLevel;