[clang] 30b7ffe - [PS5] Pack non-POD members in packed structs, matching PS4 ABI

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 2 12:26:36 PDT 2022


Author: Paul Robinson
Date: 2022-06-02T12:26:26-07:00
New Revision: 30b7ffe74e66aa0c33c689429c593f261c2c9d13

URL: https://github.com/llvm/llvm-project/commit/30b7ffe74e66aa0c33c689429c593f261c2c9d13
DIFF: https://github.com/llvm/llvm-project/commit/30b7ffe74e66aa0c33c689429c593f261c2c9d13.diff

LOG: [PS5] Pack non-POD members in packed structs, matching PS4 ABI

Added: 
    

Modified: 
    clang/lib/AST/RecordLayoutBuilder.cpp
    clang/test/SemaCXX/class-layout.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 30f9d84a9dfdd..6e775baed147f 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1891,7 +1891,7 @@ void ItaniumRecordLayoutBuilder::LayoutField(const FieldDecl *D,
   bool FieldPacked = (Packed && (!FieldClass || FieldClass->isPOD() ||
                                  Context.getLangOpts().getClangABICompat() <=
                                      LangOptions::ClangABI::Ver14 ||
-                                 Target.isPS4() || Target.isOSDarwin())) ||
+                                 Target.isPS() || Target.isOSDarwin())) ||
                      D->hasAttr<PackedAttr>();
 
   AlignRequirementKind AlignRequirement = AlignRequirementKind::None;

diff  --git a/clang/test/SemaCXX/class-layout.cpp b/clang/test/SemaCXX/class-layout.cpp
index 940966950d8be..f81e526d0e2ad 100644
--- a/clang/test/SemaCXX/class-layout.cpp
+++ b/clang/test/SemaCXX/class-layout.cpp
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base
 // RUN: %clang_cc1 -triple x86_64-apple-darwin    %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=14
 // RUN: %clang_cc1 -triple x86_64-scei-ps4        %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6
+// RUN: %clang_cc1 -triple x86_64-sie-ps5         %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=6 -DCLANG_ABI_COMPAT=6
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=14 -DCLANG_ABI_COMPAT=14
 // expected-no-diagnostics


        


More information about the cfe-commits mailing list