[PATCH] D107825: Define __HOS_AIX__ only for AIX target
Jake Egan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 10 07:08:36 PDT 2021
Jake-Egan created this revision.
Herald added subscribers: kbarton, nemanjai.
Jake-Egan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107825
Files:
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/PPC.cpp
clang/test/Preprocessor/host-aix.c
clang/test/Preprocessor/init-ppc.c
clang/test/Preprocessor/not-host-aix.c
Index: clang/test/Preprocessor/not-host-aix.c
===================================================================
--- clang/test/Preprocessor/not-host-aix.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// UNSUPPORTED: system-aix
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX %s
-// PPC-AIX-NOT:#define __HOS_AIX__ 1
Index: clang/test/Preprocessor/init-ppc.c
===================================================================
--- clang/test/Preprocessor/init-ppc.c
+++ clang/test/Preprocessor/init-ppc.c
@@ -432,6 +432,7 @@
// PPC-AIX:#define __FLT_MIN_EXP__ (-125)
// PPC-AIX:#define __FLT_MIN__ 1.17549435e-38F
// PPC-AIX:#define __FLT_RADIX__ 2
+// PPC-AIX:#define __HOS_AIX__ 1
// PPC-AIX:#define __INT16_C_SUFFIX__
// PPC-AIX:#define __INT16_FMTd__ "hd"
// PPC-AIX:#define __INT16_FMTi__ "hi"
Index: clang/test/Preprocessor/host-aix.c
===================================================================
--- clang/test/Preprocessor/host-aix.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// REQUIRES: system-aix
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-ibm-aix7.1.0.0 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC-AIX %s
-// PPC-AIX:#define __HOS_AIX__ 1
Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -14,7 +14,6 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/MacroBuilder.h"
#include "clang/Basic/TargetBuiltins.h"
-#include "llvm/Support/Host.h"
using namespace clang;
using namespace clang::targets;
@@ -308,11 +307,6 @@
Builder.defineMacro("__LONGDOUBLE64");
}
- if (llvm::Triple(llvm::sys::getProcessTriple()).isOSAIX() &&
- getTriple().isOSAIX()) {
- Builder.defineMacro("__HOS_AIX__");
- }
-
// Define this for elfv2 (64-bit only) or 64-bit darwin.
if (ABI == "elfv2" ||
(getTriple().getOS() == llvm::Triple::Darwin && PointerWidth == 64))
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -677,6 +677,7 @@
Builder.defineMacro("_AIX");
Builder.defineMacro("__TOS_AIX__");
+ Builder.defineMacro("__HOS_AIX__");
if (Opts.C11) {
Builder.defineMacro("__STDC_NO_ATOMICS__");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107825.365467.patch
Type: text/x-patch
Size: 2478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210810/cf62790d/attachment-0001.bin>
More information about the cfe-commits
mailing list