nicolerabjohn created this revision.
nicolerabjohn added reviewers: hubert.reinterpretcast, cebowleratibm, daltenty, 
dblaikie.
Herald added a project: All.
nicolerabjohn requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

There is already a GCC compatibility gap on AIX, & GCC compatibility is not a 
concern on z/OS. GCC compatibility is not sufficient motivation for breaking 
ABI on AIX and z/OS. This opts out of changes introduced in 
https://reviews.llvm.org/D119051.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142358

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/Basic/Targets/OSTargets.h
  clang/test/SemaCXX/class-layout.cpp


Index: clang/test/SemaCXX/class-layout.cpp
===================================================================
--- clang/test/SemaCXX/class-layout.cpp
+++ clang/test/SemaCXX/class-layout.cpp
@@ -9,6 +9,8 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify 
-std=c++11 -Wno-inaccessible-base -fclang-abi-compat=16 -DCLANG_ABI_COMPAT=16
 // expected-no-diagnostics
 
+#if !defined(__MVS__) && !defined(_AIX)
+
 #define SA(n, p) int a##n[(p) ? 1 : -1]
 
 struct A {
@@ -611,6 +613,9 @@
 #pragma pack(pop)
 }
 
+// This ends the #if !defined(__MVS__) && !defined(__AIX__) block from line 12 
+#endif
+
 namespace non_pod {
 struct t1 {
 protected:
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -773,6 +773,10 @@
   }
 
   bool defaultsToAIXPowerAlignment() const override { return true; }
+
+  bool areDefaultedSMFStillPOD(const LangOptions &) const override {
+    return false;
+  }
 };
 
 // z/OS target
@@ -831,6 +835,10 @@
     this->UseLeadingZeroLengthBitfield = false;
     this->ZeroLengthBitfieldBoundary = 32;
   }
+
+  bool areDefaultedSMFStillPOD(const LangOptions &) const override {
+    return false;
+  }
 };
 
 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -819,7 +819,7 @@
   ``-fclang-abi-compat=15.0``.
 - GCC allows POD types to have defaulted special members. Clang historically
   classified such types as non-POD (for the purposes of Itanium ABI). Clang now
-  matches the gcc behavior (except on Darwin and PS4). You can switch back to
+  matches the gcc behavior (except on Darwin, PS4, AIX and z/OS). You can 
switch back to
   the old ABI behavior with the flag: ``-fclang-abi-compat=15.0``.
 
 OpenMP Support in Clang


Index: clang/test/SemaCXX/class-layout.cpp
===================================================================
--- clang/test/SemaCXX/class-layout.cpp
+++ clang/test/SemaCXX/class-layout.cpp
@@ -9,6 +9,8 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=16 -DCLANG_ABI_COMPAT=16
 // expected-no-diagnostics
 
+#if !defined(__MVS__) && !defined(_AIX)
+
 #define SA(n, p) int a##n[(p) ? 1 : -1]
 
 struct A {
@@ -611,6 +613,9 @@
 #pragma pack(pop)
 }
 
+// This ends the #if !defined(__MVS__) && !defined(__AIX__) block from line 12 
+#endif
+
 namespace non_pod {
 struct t1 {
 protected:
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -773,6 +773,10 @@
   }
 
   bool defaultsToAIXPowerAlignment() const override { return true; }
+
+  bool areDefaultedSMFStillPOD(const LangOptions &) const override {
+    return false;
+  }
 };
 
 // z/OS target
@@ -831,6 +835,10 @@
     this->UseLeadingZeroLengthBitfield = false;
     this->ZeroLengthBitfieldBoundary = 32;
   }
+
+  bool areDefaultedSMFStillPOD(const LangOptions &) const override {
+    return false;
+  }
 };
 
 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -819,7 +819,7 @@
   ``-fclang-abi-compat=15.0``.
 - GCC allows POD types to have defaulted special members. Clang historically
   classified such types as non-POD (for the purposes of Itanium ABI). Clang now
-  matches the gcc behavior (except on Darwin and PS4). You can switch back to
+  matches the gcc behavior (except on Darwin, PS4, AIX and z/OS). You can switch back to
   the old ABI behavior with the flag: ``-fclang-abi-compat=15.0``.
 
 OpenMP Support in Clang
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to