summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2019-05-22 11:42:54 +0000
committerJohn Brawn <john.brawn@arm.com>2019-05-22 11:42:54 +0000
commit6c49f58a355b4ac8abb2cb2eca47eab5cfe7ce08 (patch)
tree7a95917b37acebe3a6ac7f5daab3cdd09cab0847 /clang/lib/AST/ASTContext.cpp
parentcfe6fe06abfc0517a756b82200ec64f6de4e5e11 (diff)
downloadbcm5719-llvm-6c49f58a355b4ac8abb2cb2eca47eab5cfe7ce08.tar.gz
bcm5719-llvm-6c49f58a355b4ac8abb2cb2eca47eab5cfe7ce08.zip
[ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation
Overaligned and underaligned types (i.e. types where the alignment has been increased or decreased using the aligned and packed attributes) weren't being correctly handled in all cases, as the unadjusted alignment should be used. This patch also adjusts getTypeUnadjustedAlign to correctly handle typedefs of non-aggregate types, which it appears it never had to handle before. Differential Revision: https://reviews.llvm.org/D62152 llvm-svn: 361372
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 4480b0f79e6..71745042fd8 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2130,7 +2130,7 @@ unsigned ASTContext::getTypeUnadjustedAlign(const Type *T) const {
const ASTRecordLayout &Layout = getASTObjCInterfaceLayout(ObjCI->getDecl());
UnadjustedAlign = toBits(Layout.getUnadjustedAlignment());
} else {
- UnadjustedAlign = getTypeAlign(T);
+ UnadjustedAlign = getTypeAlign(T->getUnqualifiedDesugaredType());
}
MemoizedUnadjustedAlign[T] = UnadjustedAlign;
OpenPOWER on IntegriCloud