From ae40e4e10e196abb21fc8c33d060423571618fd5 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 26 Apr 2011 21:05:39 +0000 Subject: Gcc pads the size of an array using the alignment of its elements. The size of the array may not be aligned according to alignment of its elements if an alignment attribute is specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637. llvm-svn: 130242 --- clang/lib/AST/ASTContext.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index a31969dc907..e49bde3487e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -724,6 +724,7 @@ ASTContext::getTypeInfo(const Type *T) const { std::pair EltInfo = getTypeInfo(CAT->getElementType()); Width = EltInfo.first*CAT->getSize().getZExtValue(); Align = EltInfo.second; + Width = llvm::RoundUpToAlignment(Width, Align); break; } case Type::ExtVector: -- cgit v1.2.3