diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-05-24 06:29:05 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-05-24 06:29:05 +0000 |
| commit | f97fe38cb554dc2c1c13d426ec5cb06cf5673072 (patch) | |
| tree | adf8048e5c8ba0da78e230f675b764af8ee6f344 /clang/Driver/clang.cpp | |
| parent | 6d4024ae6b60f97910dc75b5f6efde3caf2b89e7 (diff) | |
| download | bcm5719-llvm-f97fe38cb554dc2c1c13d426ec5cb06cf5673072.tar.gz bcm5719-llvm-f97fe38cb554dc2c1c13d426ec5cb06cf5673072.zip | |
Initial scaffolding for an -emit-llvm mode. This requires the LLVM VMCore
library to be built for the driver to link.
llvm-svn: 39495
Diffstat (limited to 'clang/Driver/clang.cpp')
| -rw-r--r-- | clang/Driver/clang.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 102b52730e0..670c3b79eea 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -52,6 +52,7 @@ static cl::opt<bool> Stats("stats", cl::desc("Print performance metrics and statistics")); enum ProgActions { + EmitLLVM, // Emit a .ll file. ParseASTPrint, // Parse ASTs and print them. ParseAST, // Parse ASTs. ParsePrintCallbacks, // Parse and print each callback. @@ -82,6 +83,8 @@ ProgAction(cl::desc("Choose output type:"), cl::ZeroOrMore, "Run parser and build ASTs"), clEnumValN(ParseASTPrint, "parse-ast-print", "Run parser, build ASTs, then print ASTs"), + clEnumValN(EmitLLVM, "emit-llvm", + "Build ASTs then convert to LLVM, emit .ll file"), clEnumValEnd)); //===----------------------------------------------------------------------===// @@ -1141,6 +1144,9 @@ static void ProcessInputFile(const std::string &InFile, case ParseASTPrint: PrintASTs(PP, MainFileID); break; + case EmitLLVM: + EmitLLVMFromASTs(PP, MainFileID, Stats); + break; } if (Stats) { |

