diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-26 21:05:39 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-26 21:05:39 +0000 |
commit | cd88b4171753dcb2bc0a21d78f1597c796bb8a20 (patch) | |
tree | d0992b928585b87b2a31fb30239d7406e29e6f7d /lib/AST/ASTContext.cpp | |
parent | 864c041e118155c2b1ce0ba36942a3da5a4a055e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index a31969dc90..e49bde3487 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -724,6 +724,7 @@ ASTContext::getTypeInfo(const Type *T) const { std::pair<uint64_t, unsigned> EltInfo = getTypeInfo(CAT->getElementType()); Width = EltInfo.first*CAT->getSize().getZExtValue(); Align = EltInfo.second; + Width = llvm::RoundUpToAlignment(Width, Align); break; } case Type::ExtVector: |