Transfer the predefined macro, __TOS_AIX__, from the AIX XL C/C++ compilers.
__TOS_AIX__ indicates that the target operating system is AIX.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Please rework the test update into init-ppc.c
clang/lib/Basic/Targets/PPC.cpp | ||
---|---|---|
95 | The XL compilers define this macro for Power but GCC does not. The macro is redundant and I recommend we not carry it forward to Linux. There's probably a case to define it on AIX where the prevalent XL compilers have always defined it. | |
clang/test/Preprocessor/init-aix.c | ||
1 | There are some AIX macro tests already in init-ppc.c. Note the target triple should be specified or this test will break when run on a non AIX host. |
clang/lib/Basic/Targets/OSTargets.h | ||
---|---|---|
681 | Should set these macros in C11 and higher levels. | |
clang/test/Preprocessor/init-ppc.c | ||
544 ↗ | (On Diff #349564) | I think it's sufficient to test the STDC_NO_ATOMICS and STDC_NO_THREADS only as you've added below where the -std is explicitly controlled. I prefer to avoid expecting these macros for the -std default, which may change. |
729 ↗ | (On Diff #349564) | suggest adding the negative test for pre C11 modes. |
clang/lib/Basic/Targets/OSTargets.h | ||
---|---|---|
681 | I think LangStandard::isC11() does what you want. You wouldn't want to update this code every time a new C standard comes out. | |
clang/test/Preprocessor/init-ppc.c | ||
742 ↗ | (On Diff #349638) | I didn't mean to suggest adding all of them. One negative test on c99 would suffice. |
I think it makes sense to split the STDC macro changes and TOS_AIX__ into different patches.
clang-format: please reformat the code