]> granicus.if.org Git - clang/commit
[PowerPC] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros on all PPC cores
authorHal Finkel <hfinkel@anl.gov>
Thu, 1 Oct 2015 13:39:49 +0000 (13:39 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 1 Oct 2015 13:39:49 +0000 (13:39 +0000)
commit7f84b58de14e9218bed627b5928b3d3df82360fa
treeeaeeb81b081af297d28c926591fb0edd26e89699
parent8567fd2fe8a86e4799f27daa715adc8bc95b3282
[PowerPC] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros on all PPC cores

We support all __sync_val_compare_and_swap_* builtins (only 64-bit on 64-bit
targets) on all cores, and should define the corresponding
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros, just as GCC does. As it turns out,
this is really important because they're needed to prevent a bad ODR violation
with libstdc++'s std::shared_ptr (this is well explained in PR12730).

We were doing this only for P8, but this is necessary on all PPC systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249009 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets.cpp
test/Preprocessor/predefined-arch-macros.c