[llvm-commits] [PATCH] delete ManagedStatics

Devang Patel dpatel at apple.com
Mon Jan 15 14:58:06 PST 2007


Right now, ManagedStatics are not deleted (through llvm_shutdown) by  
llvm-gcc.
Here is the patch.

OK to install?
Thanks,
-
Devang

Index: llvm-backend.cpp
===================================================================
--- llvm-backend.cpp    (revision 122487)
+++ llvm-backend.cpp    (working copy)
@@ -45,6 +45,7 @@ Software Foundation, 59 Temple Place - S
  #include "llvm/Transforms/IPO.h"
  #include "llvm/ADT/StringExtras.h"
  #include "llvm/Support/Streams.h"
+#include "llvm/Support/ManagedStatic.h"
  #include <cassert>
  #undef VISIBILITY_HIDDEN
  extern "C" {
@@ -358,6 +359,7 @@ static void CreateStructorsList(std::vec
  // 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.

    // Add an llvm.global_ctors global if needed.
    if (!StaticCtors.empty())




More information about the llvm-commits mailing list