mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-17 05:25:47 +00:00
Dispose the codegen even when just writing the bitcode file.
This makes it possible to add timers to the code generator and still use them with -plugin-opt=emit-llvm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191866 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -417,9 +417,11 @@ static ld_plugin_status all_symbols_read_hook(void) {
|
|||||||
bool err = lto_codegen_write_merged_modules(code_gen, path.c_str());
|
bool err = lto_codegen_write_merged_modules(code_gen, path.c_str());
|
||||||
if (err)
|
if (err)
|
||||||
(*message)(LDPL_FATAL, "Failed to write the output file.");
|
(*message)(LDPL_FATAL, "Failed to write the output file.");
|
||||||
if (options::generate_bc_file == options::BC_ONLY)
|
if (options::generate_bc_file == options::BC_ONLY) {
|
||||||
|
lto_codegen_dispose(code_gen);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const char *objPath;
|
const char *objPath;
|
||||||
if (lto_codegen_compile_to_file(code_gen, &objPath)) {
|
if (lto_codegen_compile_to_file(code_gen, &objPath)) {
|
||||||
(*message)(LDPL_ERROR, "Could not produce a combined object file\n");
|
(*message)(LDPL_ERROR, "Could not produce a combined object file\n");
|
||||||
|
Reference in New Issue
Block a user