[llvm] r191866 - Dispose the codegen even when just writing the bitcode file.

Rafael Espindola rafael.espindola at gmail.com
Wed Oct 2 17:07:30 PDT 2013


Author: rafael
Date: Wed Oct  2 19:07:30 2013
New Revision: 191866

URL: http://llvm.org/viewvc/llvm-project?rev=191866&view=rev
Log:
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.

Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=191866&r1=191865&r2=191866&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Oct  2 19:07:30 2013
@@ -417,8 +417,10 @@ static ld_plugin_status all_symbols_read
     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)) {





More information about the llvm-commits mailing list