Go to file
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
clang Do not register incompatible C++ destructors with __cxa_atexit 2016-05-10 17:44:46 +00:00
clang-tools-extra [clang-tidy] Lift parsing of sequence of names functions to utils. 2016-05-10 15:31:15 +00:00
compiler-rt tsan: fix another crash due to processors 2016-05-10 11:19:50 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Add erf ported from amd-builtins 2016-05-06 18:02:30 +00:00
libcxx [libcxx] Prefer C++14 over C++11 when building libc++experimental. 2016-05-10 16:17:43 +00:00
libcxxabi libc++abi: fix visibility of personalities 2016-05-04 04:22:29 +00:00
libunwind unwind: remove last instance of -Wexpansion-to-defined 2016-04-26 01:11:29 +00:00
lld Fix typo. 2016-05-10 16:23:46 +00:00
lldb Fix logging in Listener.cpp 2016-05-10 13:46:25 +00:00
llgo [llgo] llgoi: separate evaluation from printing 2016-04-25 01:18:20 +00:00
llvm Enable loopreroll for sext of loop control only IV 2016-05-10 17:42:27 +00:00
openmp Fine tuning of TC* macros 2016-05-07 00:00:00 +00:00
polly Invalidate unprofitable SCoPs after creation 2016-05-10 16:38:09 +00:00