}
bool BackendConsumer::AddEmitPasses(std::string &Error) {
+ if (Action == Backend_EmitNothing)
+ return true;
+
if (OutputFile == "-" || (InputFile == "-" && OutputFile.empty())) {
AsmOutStream = new raw_stdout_ostream();
sys::Program::ChangeStdoutToBinary();
EmitAssembly, // Emit a .s file.
EmitLLVM, // Emit a .ll file.
EmitBC, // Emit a .bc file.
+ EmitLLVMOnly, // Generate LLVM IR, but do not
SerializeAST, // Emit a .ast file.
EmitHTML, // Translate input source into HTML.
ASTPrint, // Parse ASTs and print them.
"Build ASTs then convert to LLVM, emit .ll file"),
clEnumValN(EmitBC, "emit-llvm-bc",
"Build ASTs then convert to LLVM, emit .bc file"),
+ clEnumValN(EmitLLVMOnly, "emit-llvm-only",
+ "Build ASTs and convert to LLVM, discarding output"),
clEnumValN(SerializeAST, "serialize",
"Build ASTs and emit .ast file"),
clEnumValN(RewriteTest, "rewrite-test",
case EmitAssembly:
case EmitLLVM:
- case EmitBC: {
+ case EmitBC:
+ case EmitLLVMOnly: {
BackendAction Act;
if (ProgAction == EmitAssembly)
Act = Backend_EmitAssembly;
else if (ProgAction == EmitLLVM)
Act = Backend_EmitLL;
+ else if (ProgAction == EmitLLVMOnly)
+ Act = Backend_EmitNothing;
else
Act = Backend_EmitBC;