From: Reid Kleckner Date: Wed, 6 May 2015 15:31:46 +0000 (+0000) Subject: [AArch64] Advertise that the __sync_*_compare_and_swap_1/2/4/8 builtins work X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=780713ef9c7dc529beaa76e8cb33cbc35b696f44;p=clang [AArch64] Advertise that the __sync_*_compare_and_swap_1/2/4/8 builtins work Fixes PR23428, where std::thread in libstdc++ would go haywire without these defines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236605 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 91babd3d14..283d1d2ae2 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4926,6 +4926,12 @@ public: if (Crypto) Builder.defineMacro("__ARM_FEATURE_CRYPTO"); + + // All of the __sync_(bool|val)_compare_and_swap_(1|2|4|8) builtins work. + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); } void getTargetBuiltins(const Builtin::Info *&Records,