diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-03 00:07:30 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-03 00:07:30 +0000 |
| commit | fb7a0b8943eb9ea3e356f7c9b302ad00a23dfb2a (patch) | |
| tree | 4216aad378a7f1f9fd5847fb04cb14b8b77ce219 /llvm/tools/gold/gold-plugin.cpp | |
| parent | c80f88a94e965cc4bf52588cfc105376b2fee35a (diff) | |
| download | bcm5719-llvm-fb7a0b8943eb9ea3e356f7c9b302ad00a23dfb2a.tar.gz bcm5719-llvm-fb7a0b8943eb9ea3e356f7c9b302ad00a23dfb2a.zip | |
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.
llvm-svn: 191866
Diffstat (limited to 'llvm/tools/gold/gold-plugin.cpp')
| -rw-r--r-- | llvm/tools/gold/gold-plugin.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 77717098d61..bd11d1b5556 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -417,8 +417,10 @@ static ld_plugin_status all_symbols_read_hook(void) { bool err = lto_codegen_write_merged_modules(code_gen, path.c_str()); if (err) (*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); + } } const char *objPath; if (lto_codegen_compile_to_file(code_gen, &objPath)) { |

