aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-19 05:52:45 +0000
committerChris Lattner <sabre@nondot.org>2010-06-19 05:52:45 +0000
commit810112e28dc839715d17b0a786f23aaa19600ac0 (patch)
treebe4df999eb856ce5e7be5a6d114df7e82b2533ef /lib/CodeGen/CodeGenModule.h
parentb9d5c22529c3f2bf3b03348021c0fd1c723d8516 (diff)
Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r--lib/CodeGen/CodeGenModule.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 45931ce0fd..35383301e0 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -142,7 +142,7 @@ class CodeGenModule : public BlockModule {
/// CXXGlobalDtors - Global destructor functions and arguments that need to
/// run on termination.
- std::vector<std::pair<llvm::Constant*,llvm::Constant*> > CXXGlobalDtors;
+ std::vector<std::pair<llvm::WeakVH,llvm::Constant*> > CXXGlobalDtors;
/// CFConstantStringClassRef - Cached reference to the class for constant
/// strings. This value has type int * but is actually an Obj-C class pointer.
@@ -350,7 +350,9 @@ public:
/// AddCXXDtorEntry - Add a destructor and object to add to the C++ global
/// destructor function.
- void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object);
+ void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object) {
+ CXXGlobalDtors.push_back(std::make_pair(DtorFn, Object));
+ }
/// CreateRuntimeFunction - Create a new runtime function with the specified
/// type and name.