mirror of https://github.com/microsoft/clang.git
Maintain PS4 ABI compatibility by making the fix made in r331136 not apply when the target is the PS4.
Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47084 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
746b78de78
commit
ff7fef12a4
|
@ -1178,8 +1178,10 @@ ItaniumRecordLayoutBuilder::LayoutBase(const BaseSubobjectInfo *Base) {
|
|||
// Clang <= 6 incorrectly applied the 'packed' attribute to base classes.
|
||||
// Per GCC's documentation, it only applies to non-static data members.
|
||||
CharUnits UnpackedBaseAlign = Layout.getNonVirtualAlignment();
|
||||
CharUnits BaseAlign = (Packed && Context.getLangOpts().getClangABICompat() <=
|
||||
LangOptions::ClangABI::Ver6)
|
||||
CharUnits BaseAlign =
|
||||
(Packed && ((Context.getLangOpts().getClangABICompat() <=
|
||||
LangOptions::ClangABI::Ver6) ||
|
||||
Context.getTargetInfo().getTriple().isPS4()))
|
||||
? CharUnits::One()
|
||||
: UnpackedBaseAlign;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin10 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOCOMPAT
|
||||
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-apple-darwin10 -fclang-abi-compat=6.0 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V6COMPAT
|
||||
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=x86_64-scei-ps4 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V6COMPAT
|
||||
|
||||
extern int int_source();
|
||||
extern void int_sink(int x);
|
||||
|
|
Loading…
Reference in New Issue