[PATCH] D142358: Opting out of Clang 15 ABI Changes for AIX and z/OS

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 13:07:58 PST 2023


hubert.reinterpretcast added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:817
   attribute is also specified on the member. Clang historically did perform
   such packing. Clang now matches the gcc behavior (except on Darwin and PS4).
   You can switch back to the old ABI behavior with the flag:
----------------
This line also needs update.


================
Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1972
+                                 Target.isPS() || Target.isOSDarwin() ||
+                                 Target.isOSAIX())) || 
                      D->hasAttr<PackedAttr>();
----------------
I agree we are good with z/OS having this change take effect going forward because the ABI was "stabilized" with a version where this change was effective.

I don't know if @SeanP has any comments on `-fclang-abi-compat=15` exposing the pre-stable ABI behaviour (at least with the code here). My understanding is that the Open XL product exposed the "Clang 16" behaviour with `-fclang-abi-compat=n` for some `n` less than 16.


================
Comment at: clang/test/SemaCXX/class-layout.cpp:639
 _Static_assert(_Alignof(t1) == 4, "");
 _Static_assert(_Alignof(t2) == 1, "");
 #else
----------------
I am having trouble understanding how this line is passing with
```
//RUN: %clang_cc1 -triple s390x-none-zos %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=15
```

The Clang 16 behaviour should be effective on z/OS given the state of this patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142358/new/

https://reviews.llvm.org/D142358



More information about the cfe-commits mailing list