diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2004-08-10 16:29:18 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2004-08-10 16:29:18 +0000 |
| commit | 553215934067aa705ca27be6fd52c29b87689d8c (patch) | |
| tree | 22d1a2d5a20307bb62450f1c65ee9a97f46ca69a /llvm/tools/llvmc/CompilerDriver.h | |
| parent | e70c43de8934f050eb139c14066d4c637ca21bfc (diff) | |
| download | bcm5719-llvm-553215934067aa705ca27be6fd52c29b87689d8c.tar.gz bcm5719-llvm-553215934067aa705ca27be6fd52c29b87689d8c.zip | |
Move CompilerDriver.h here.
llvm-svn: 15609
Diffstat (limited to 'llvm/tools/llvmc/CompilerDriver.h')
| -rw-r--r-- | llvm/tools/llvmc/CompilerDriver.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/CompilerDriver.h b/llvm/tools/llvmc/CompilerDriver.h new file mode 100644 index 00000000000..d56c9b5b6b4 --- /dev/null +++ b/llvm/tools/llvmc/CompilerDriver.h @@ -0,0 +1,75 @@ +//===- CompilerDriver.h - Compiler Driver ---------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the CompilerDriver class which implements the bulk of the +// LLVM Compiler Driver program (llvmc). +// +//===------------------------------------------------------------------------=== + +namespace llvm { + /// This class provides the high level interface to the LLVM Compiler Driver. + /// The driver's purpose is to make it easier for compiler writers and users + /// of LLVM to utilize the compiler toolkits and LLVM toolset by learning only + /// the interface of one program (llvmc). + /// + /// @see llvmc.cpp + /// @brief The interface to the LLVM Compiler Driver. + class CompilerDriver { + /// @name Types + /// @{ + public: + typedef unsigned OptimizationLevel; + enum Phases { + PREPROCESSING, ///< Source language combining, filtering, substitution + TRANSLATION, ///< Translate source -> LLVM bytecode/assembly + OPTIMIZATION, ///< Optimize translation result + LINKING, ///< Link bytecode and native code + ASSEMBLY, ///< Convert program to executable + }; + + enum OptimizationLevels { + OPT_NONE, + OPT_FAST_COMPILE, + OPT_SIMPLE, + OPT_AGGRESSIVE, + OPT_LINK_TIME, + OPT_AGGRESSIVE_LINK_TIME + }; + + /// @} + /// @name Constructors + /// @{ + public: + CompilerDriver(); + + /// @} + /// @name Accessors + /// @{ + public: + void execute(); ///< Execute the actions requested + + /// @} + /// @name Mutators + /// @{ + public: + /// @brief Set the optimization level for the compilation + void setOptimization( OptimizationLevel level ); + void setFinalPhase( Phases phase ); + + /// @} + /// @name Data + /// @{ + public: + Phases finalPhase; + OptimizationLevel optLevel; + + /// @} + + }; +} |

