Stop clang 13 from defining conflicting macros on PowerPC

Merge commit c9539f957f57 from llvm git (by Nemanja Ivanovic):

  [PowerPC] Define XL-compatible macros only for AIX and Linux

  Since XLC only ever shipped on PowerPC AIX and Linux, it is not
  reasonable to provide the compatibility macros on any target other
  than those two. This patch restricts those macros to AIX/Linux.

  Differential revision: https://reviews.llvm.org/D110213

PR:		258209
This commit is contained in:
Dimitry Andric 2021-10-01 21:43:21 +02:00
parent 28a41182c0
commit 39dadd0628

View File

@ -243,7 +243,10 @@ static void defineXLCompatMacros(MacroBuilder &Builder) {
void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
defineXLCompatMacros(Builder);
// We define the XLC compatibility macros only on AIX and Linux since XLC
// was never available on any other platforms.
if (getTriple().isOSAIX() || getTriple().isOSLinux())
defineXLCompatMacros(Builder);
// Target identification.
Builder.defineMacro("__ppc__");