summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-07-27 18:52:44 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-07-27 18:52:44 +0000
commitc47fcf0ae5304127f98964817a1f1fa75eec91f3 (patch)
tree9bc34e071d93f774c281af66cac6eb606b0033f7 /clang/lib/CodeGen
parent4d82e40310371ba0e3bbc73d4aeacde371b4c3d3 (diff)
downloadbcm5719-llvm-c47fcf0ae5304127f98964817a1f1fa75eec91f3.tar.gz
bcm5719-llvm-c47fcf0ae5304127f98964817a1f1fa75eec91f3.zip
Revert r264998 and r265035.
r303175 made changes to have __cxa_allocate_exception return a 16-byte aligned pointer, so it's no longer necessary to specify a lower alignment (8-bytes) for exception objects on Darwin. rdar://problem/32363695 llvm-svn: 309308
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index de9fd042a9e..c1f892a3173 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -157,9 +157,17 @@ public:
Address Ptr, QualType ElementType,
const CXXDestructorDecl *Dtor) override;
+ /// Itanium says that an _Unwind_Exception has to be "double-word"
+ /// aligned (and thus the end of it is also so-aligned), meaning 16
+ /// bytes. Of course, that was written for the actual Itanium,
+ /// which is a 64-bit platform. Classically, the ABI doesn't really
+ /// specify the alignment on other platforms, but in practice
+ /// libUnwind declares the struct with __attribute__((aligned)), so
+ /// we assume that alignment here. (It's generally 16 bytes, but
+ /// some targets overwrite it.)
CharUnits getAlignmentOfExnObject() {
- unsigned Align = CGM.getContext().getTargetInfo().getExnObjectAlignment();
- return CGM.getContext().toCharUnitsFromBits(Align);
+ auto align = CGM.getContext().getTargetDefaultAlignForAttributeAligned();
+ return CGM.getContext().toCharUnitsFromBits(align);
}
void emitRethrow(CodeGenFunction &CGF, bool isNoReturn) override;
OpenPOWER on IntegriCloud