]> granicus.if.org Git - clang/commit
Add a command line option 'fregister_global_dtors_with_atexit' to
authorAkira Hatanaka <ahatanaka@apple.com>
Tue, 17 Apr 2018 18:41:52 +0000 (18:41 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Tue, 17 Apr 2018 18:41:52 +0000 (18:41 +0000)
commit941cb2aa5722c2657e009a77545c1ccdef5132d7
treee930bcd04edbf8b83ea9d48e00fbd21e7822ae90
parent752f03f59ce8911bf0dcd01349f5b7ff7ab88d17
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330199 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenFunction.h
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/CodeGen/ItaniumCXXABI.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/constructor-attribute.c
test/Driver/cxa-atexit.cpp
test/Driver/rewrite-legacy-objc.m
test/Driver/rewrite-objc.m