r236848 - Fix for bug 23429.
Nemanja Ivanovic
nemanja.i.ibm at gmail.com
Fri May 8 06:07:49 PDT 2015
Author: nemanjai
Date: Fri May 8 08:07:48 2015
New Revision: 236848
URL: http://llvm.org/viewvc/llvm-project?rev=236848&view=rev
Log:
Fix for bug 23429.
The macros for gcc atomic compare and swaps are defined for Power8 CPU's since
the functionality is provided in the back end.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=236848&r1=236847&r2=236848&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri May 8 08:07:48 2015
@@ -1207,6 +1207,14 @@ void PPCTargetInfo::getTargetDefines(con
Builder.defineMacro("__CRYPTO__");
if (HasHTM)
Builder.defineMacro("__HTM__");
+ if (getTriple().getArch() == llvm::Triple::ppc64le ||
+ (defs & ArchDefinePwr8)) {
+ 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 (PointerWidth == 64)
+ Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+ }
// FIXME: The following are not yet generated here by Clang, but are
// generated by GCC:
More information about the cfe-commits
mailing list