Index: llvm/include/llvm-c/lto.h =================================================================== --- llvm/include/llvm-c/lto.h +++ llvm/include/llvm-c/lto.h @@ -548,6 +548,11 @@ const char *const *, int number); /** + * Sets the result filetype to assembly. + */ +extern void lto_codegen_emit_asm(lto_code_gen_t cg); + +/** * Initializes LLVM disassemblers. * FIXME: This doesn't really belong here. * Index: llvm/tools/lto/lto.cpp =================================================================== --- llvm/tools/lto/lto.cpp +++ llvm/tools/lto/lto.cpp @@ -490,6 +490,10 @@ unwrap(cg)->setCodeGenDebugOptions(makeArrayRef(Options)); } +void lto_codegen_emit_asm(lto_code_gen_t cg) { + unwrap(cg)->setFileType(CGFT_AssemblyFile); +} + unsigned int lto_api_version() { return LTO_API_VERSION; } void lto_codegen_set_should_internalize(lto_code_gen_t cg, Index: llvm/tools/lto/lto.exports =================================================================== --- llvm/tools/lto/lto.exports +++ llvm/tools/lto/lto.exports @@ -35,6 +35,7 @@ lto_codegen_write_merged_modules lto_codegen_debug_options lto_codegen_debug_options_array +lto_codegen_emit_asm lto_codegen_set_assembler_args lto_codegen_set_assembler_path lto_codegen_set_cpu