diff options
author | John McCall <rjmccall@apple.com> | 2012-05-01 06:13:13 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-05-01 06:13:13 +0000 |
commit | 20bb175cb8ae5844034828db094fb948c0e3454a (patch) | |
tree | 47ddb10b5e232580cb19e4092b10d2b45cc46b51 /lib/CodeGen/CodeGenFunction.h | |
parent | 5729672524865f212cbadb51170dca0694e79a71 (diff) |
Abstract the emission of global destructors into ABI-specific code
and only consider using __cxa_atexit in the Itanium logic. The
default logic is to use atexit().
Emit "guarded" initializers in Microsoft mode unconditionally.
This is definitely not correct, but it's closer to correct than
just not emitting the initializer.
Based on a patch by Timur Iskhodzhanov!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 001a371002..a25b02aac8 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -2411,10 +2411,9 @@ public: void EmitCXXGlobalVarDeclInit(const VarDecl &D, llvm::Constant *DeclPtr, bool PerformInit); - /// EmitCXXGlobalDtorRegistration - Emits a call to register the global ptr - /// with the C++ runtime so that its destructor will be called at exit. - void EmitCXXGlobalDtorRegistration(llvm::Constant *DtorFn, - llvm::Constant *DeclPtr); + /// Call atexit() with a function that passes the given argument to + /// the given function. + void registerGlobalDtorWithAtExit(llvm::Constant *fn, llvm::Constant *addr); /// Emit code in this function to perform a guarded variable /// initialization. Guarded initializations are used when it's not |