[AIX] Define __THW_PPC__ macro
authorJake Egan <Jake.Egan@ibm.com>
Fri, 6 Aug 2021 13:49:53 +0000 (09:49 -0400)
committerJake Egan <Jake.Egan@ibm.com>
Fri, 6 Aug 2021 13:52:26 +0000 (09:52 -0400)
%%%
This patch defines the macro __THW_PPC__ for AIX.
%%%

Tested with SPEC.

Reviewed By: cebowleratibm

Differential Revision: https://reviews.llvm.org/D107243

clang/lib/Basic/Targets/PPC.cpp
clang/test/Preprocessor/init-ppc.c

index 5965688..a888e22 100644 (file)
@@ -257,6 +257,9 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
     Builder.defineMacro("__ppc64__");
     Builder.defineMacro("__PPC64__");
   }
+  if (getTriple().isOSAIX()) {
+    Builder.defineMacro("__THW_PPC__");
+  }
 
   // Target properties.
   if (getTriple().getArch() == llvm::Triple::ppc64le ||
index ac72e6c..abf2e91 100644 (file)
 // PPC-AIX:#define __SIZE_TYPE__ long unsigned int
 // PPC-AIX:#define __SIZE_WIDTH__ 32
 // PPC-AIX:#define __THW_BIG_ENDIAN__ 1
+// PPC-AIX:#define __THW_PPC__ 1
 // PPC-AIX:#define __TOS_AIX__ 1
 // PPC-AIX:#define __UINT16_C_SUFFIX__
 // PPC-AIX:#define __UINT16_MAX__ 65535