llvm-project/clang/lib
Derek Schuff cc42df4a30 Do not register incompatible C++ destructors with __cxa_atexit
Summary:
For a static object with a nontrivial destructor, clang generates an
initializer function (__cxx_global_var_init) which registers that
object's destructor using __cxa_atexit. However some ABIs (ARM,
WebAssembly) use destructors that return 'this' instead of having void
return (which does not match the signature of function pointers passed
to __cxa_atexit). This results in undefined behavior when the destructors are
called. All the calling conventions I know of on ARM can tolerate this,
but WebAssembly requires the signatures of indirect calls to match the
called function.

This patch disables that direct registration of destructors for ABIs
that have this-returning destructors.

Subscribers: aemerson, jfb, cfe-commits, dschuff

Differential Revision: http://reviews.llvm.org/D19275

llvm-svn: 269085
2016-05-10 17:44:46 +00:00
..
ARCMigrate Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
AST Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
ASTMatchers [ASTMatchers] New matcher forFunction 2016-05-04 11:59:39 +00:00
Analysis Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
Basic [Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front end 2016-05-09 18:58:02 +00:00
CodeGen Do not register incompatible C++ destructors with __cxa_atexit 2016-05-10 17:44:46 +00:00
Driver [Myriad] Use Generic_ELF::addClangTargetOptions() 2016-05-09 19:09:59 +00:00
Edit Remove autoconf support 2016-01-26 21:30:40 +00:00
Format Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
Frontend [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5 2016-05-09 14:59:13 +00:00
FrontendTool Make it possible for AST plugins to enable themselves by default 2016-03-15 12:51:40 +00:00
Headers [Clang][AVX512] completing missing intrinsics [load/store] 2016-05-10 13:13:54 +00:00
Index Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
Lex Enable support for __float128 in Clang and enable it on pertinent platforms 2016-05-09 08:52:33 +00:00
Parse [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5 2016-05-09 14:59:13 +00:00
Rewrite Remove use of builtin comma operator. 2016-02-18 22:34:54 +00:00
Sema [Sema] Fix an overload resolution bug with enable_if. 2016-05-10 01:59:34 +00:00
Serialization [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5 2016-05-09 14:59:13 +00:00
StaticAnalyzer [analyzer] Add path note for localizability checker. 2016-04-28 19:44:40 +00:00
Tooling When forming a fully-qualified type name, put any qualifiers outside/before the 2016-05-09 23:06:14 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00