[clang] 3189dd2 - [AIX] Define __THW_PPC__ macro
Jake Egan via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 6 06:52:59 PDT 2021
Author: Jake Egan
Date: 2021-08-06T09:52:26-04:00
New Revision: 3189dd205a581272b9a0cfc614e8f341495fc716
URL: https://github.com/llvm/llvm-project/commit/3189dd205a581272b9a0cfc614e8f341495fc716
DIFF: https://github.com/llvm/llvm-project/commit/3189dd205a581272b9a0cfc614e8f341495fc716.diff
LOG: [AIX] Define __THW_PPC__ macro
%%%
This patch defines the macro __THW_PPC__ for AIX.
%%%
Tested with SPEC.
Reviewed By: cebowleratibm
Differential Revision: https://reviews.llvm.org/D107243
Added:
Modified:
clang/lib/Basic/Targets/PPC.cpp
clang/test/Preprocessor/init-ppc.c
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 59656888e25f9..a888e22697de9 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -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 ||
diff --git a/clang/test/Preprocessor/init-ppc.c b/clang/test/Preprocessor/init-ppc.c
index ac72e6cb027b0..abf2e919cff68 100644
--- a/clang/test/Preprocessor/init-ppc.c
+++ b/clang/test/Preprocessor/init-ppc.c
@@ -539,6 +539,7 @@
// 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
More information about the cfe-commits
mailing list