[llvm-commits] [llvm-gcc-4.2] r57860 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm.h toplev.c
Dan Gohman
gohman at apple.com
Mon Oct 20 16:43:13 PDT 2008
Author: djg
Date: Mon Oct 20 18:43:13 2008
New Revision: 57860
URL: http://llvm.org/viewvc/llvm-project?rev=57860&view=rev
Log:
Don't call llvm_shutdown() in llvm_asm_file_end(), because
PCH uses llvm_asm_file_end() in a special way, such that
it's too early to destroy all of LLVM's global state.
Instead, wait until the end of compile_file() to call
llvm_shutdown().
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm.h
llvm-gcc-4.2/trunk/gcc/toplev.c
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=57860&r1=57859&r2=57860&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Oct 20 18:43:13 2008
@@ -574,7 +574,6 @@
// llvm_asm_file_end - Finish the .s file.
void llvm_asm_file_end(void) {
timevar_push(TV_LLVM_PERFILE);
- llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
performLateBackendInitialization();
createOptimizationPasses();
@@ -692,6 +691,11 @@
timevar_pop(TV_LLVM_PERFILE);
}
+// llvm_call_llvm_shutdown - Release LLVM global state.
+void llvm_call_llvm_shutdown(void) {
+ llvm_shutdown();
+}
+
// llvm_emit_code_for_current_function - Top level interface for emitting a
// function to the .s file.
void llvm_emit_code_for_current_function(tree fndecl) {
Modified: llvm-gcc-4.2/trunk/gcc/llvm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm.h?rev=57860&r1=57859&r2=57860&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm.h Mon Oct 20 18:43:13 2008
@@ -109,6 +109,9 @@
/* llvm_asm_file_end - Finish the .s file. */
void llvm_asm_file_end(void);
+/* llvm_call_llvm_shutdown - Release LLVM global state. */
+void llvm_call_llvm_shutdown(void);
+
/* refine_type_to - Cause all users of the opaque type old_type to switch
* to the more concrete type new_type.
*/
Modified: llvm-gcc-4.2/trunk/gcc/toplev.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=57860&r1=57859&r2=57860&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/toplev.c (original)
+++ llvm-gcc-4.2/trunk/gcc/toplev.c Mon Oct 20 18:43:13 2008
@@ -1184,6 +1184,8 @@
#else
if (!flag_pch_file)
llvm_asm_file_end();
+ /* Release LLVM global state. */
+ llvm_call_llvm_shutdown();
#endif
/* LLVM LOCAL end */
}
More information about the llvm-commits
mailing list