[llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.h llvmc.cpp
Reid Spencer
reid at x10sys.com
Tue Aug 10 09:29:29 PDT 2004
Changes in directory llvm/tools/llvmc:
CompilerDriver.h added (r1.1)
llvmc.cpp updated: 1.1 -> 1.2
---
Log message:
Move CompilerDriver.h here.
---
Diffs of the changes: (+76 -1)
Index: llvm/tools/llvmc/CompilerDriver.h
diff -c /dev/null llvm/tools/llvmc/CompilerDriver.h:1.1
*** /dev/null Tue Aug 10 11:29:28 2004
--- llvm/tools/llvmc/CompilerDriver.h Tue Aug 10 11:29:18 2004
***************
*** 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;
+
+ /// @}
+
+ };
+ }
Index: llvm/tools/llvmc/llvmc.cpp
diff -u llvm/tools/llvmc/llvmc.cpp:1.1 llvm/tools/llvmc/llvmc.cpp:1.2
--- llvm/tools/llvmc/llvmc.cpp:1.1 Tue Aug 10 11:26:01 2004
+++ llvm/tools/llvmc/llvmc.cpp Tue Aug 10 11:29:18 2004
@@ -14,7 +14,7 @@
//
//===------------------------------------------------------------------------===
-#include "llvm/Driver/CompilerDriver.h"
+#include "CompilerDriver.h"
#include "llvm/System/Signals.h"
#include "Support/CommandLine.h"
#include <iostream>
More information about the llvm-commits
mailing list