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.

llvm-svn: 236848
This commit is contained in:
Nemanja Ivanovic 2015-05-08 13:07:48 +00:00
parent 3e493037be
commit 531a656cf0
1 changed files with 8 additions and 0 deletions

View File

@ -1207,6 +1207,14 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
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: