diff options
| author | Akira Hatanaka <ahatanaka@apple.com> | 2018-04-17 18:41:52 +0000 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-04-17 18:41:52 +0000 |
| commit | 617e26152dea71efc44a45f5ae034f15c92767f0 (patch) | |
| tree | 964d175311edcbfe8346fb800a3fec1461726064 /clang/lib/CodeGen/CodeGenFunction.h | |
| parent | 8fa100dfe3c36687f3ab09804657fdf4fa946bdf (diff) | |
| download | bcm5719-llvm-617e26152dea71efc44a45f5ae034f15c92767f0.tar.gz bcm5719-llvm-617e26152dea71efc44a45f5ae034f15c92767f0.zip | |
Add a command line option 'fregister_global_dtors_with_atexit' to
register destructor functions annotated with __attribute__((destructor))
using __cxa_atexit or atexit.
Register destructor functions annotated with __attribute__((destructor))
calling __cxa_atexit in a synthesized constructor function instead of
emitting references to the functions in a special section.
The primary reason for adding this option is that we are planning to
deprecate the __mod_term_funcs section on Darwin in the future. This
feature is enabled by default only on Darwin. Users who do not want this
can use command line option 'fno_register_global_dtors_with_atexit' to
disable it.
rdar://problem/33887655
Differential Revision: https://reviews.llvm.org/D45578
llvm-svn: 330199
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 27b0677d49b..84118a50c1d 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -3696,6 +3696,9 @@ public: void registerGlobalDtorWithAtExit(const VarDecl &D, llvm::Constant *fn, llvm::Constant *addr); + /// Call atexit() with function dtorStub. + void registerGlobalDtorWithAtExit(llvm::Constant *dtorStub); + /// Emit code in this function to perform a guarded variable /// initialization. Guarded initializations are used when it's not /// possible to prove that an initialization will be done exactly |

