summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Yung <douglas.yung@sony.com>2018-05-18 21:51:46 +0000
committerDouglas Yung <douglas.yung@sony.com>2018-05-18 21:51:46 +0000
commitd40bc5f788ac926a56daf7e5a0ce5b347f2f8993 (patch)
tree6b2dbc44f38c29d5cae90328b1d29744a2662be6 /clang
parent20e1546655849e7a952a3aefb3046fc29c22d45d (diff)
downloadbcm5719-llvm-d40bc5f788ac926a56daf7e5a0ce5b347f2f8993.tar.gz
bcm5719-llvm-d40bc5f788ac926a56daf7e5a0ce5b347f2f8993.zip
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 llvm-svn: 332773
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp10
-rw-r--r--clang/test/CodeGenCXX/alignment.cpp1
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 64c1a02cef1..988b88b39b4 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -1178,10 +1178,12 @@ 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::One()
- : UnpackedBaseAlign;
+ CharUnits BaseAlign =
+ (Packed && ((Context.getLangOpts().getClangABICompat() <=
+ LangOptions::ClangABI::Ver6) ||
+ Context.getTargetInfo().getTriple().isPS4()))
+ ? CharUnits::One()
+ : UnpackedBaseAlign;
// If we have an empty base class, try to place it at offset 0.
if (Base->Class->isEmpty() &&
diff --git a/clang/test/CodeGenCXX/alignment.cpp b/clang/test/CodeGenCXX/alignment.cpp
index 2549afda882..37509fcb4dd 100644
--- a/clang/test/CodeGenCXX/alignment.cpp
+++ b/clang/test/CodeGenCXX/alignment.cpp
@@ -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);
OpenPOWER on IntegriCloud