diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-04-04 23:53:43 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-04-04 23:53:43 +0000 |
commit | d1b33945f3254de9b02063cd203374856492ed02 (patch) | |
tree | 206926a103897f67225a0698575e73875fec2257 /lib/Basic/Targets.cpp | |
parent | 648cb71625a2ab3164b2cacac9e9cb3d22b03bd7 (diff) |
Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} on x86.
This fixes std::thread with libstdc++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index c7da36e8f7..3eda9d8c18 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -2730,6 +2730,14 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, case NoMMX3DNow: break; } + + if (CPU >= CK_i486) { + 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"); + } + if (CPU >= CK_i586) + Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"); } bool X86TargetInfo::hasFeature(StringRef Feature) const { |