MS ABI: Consider alignment attributes on typedefs for layout
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 30 Jul 2014 01:30:47 +0000 (01:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 30 Jul 2014 01:30:47 +0000 (01:30 +0000)
commit34b5749989062e3049296cf656cc3551ebe47e65
treeb909046d61f66d0a403d635856ead8c437d42457
parent9dcc254a47256162dbd616fc34c9dac774969306
MS ABI: Consider alignment attributes on typedefs for layout

The MS ABI has a notion of 'required alignment' for fields; this
alignment supercedes pragma pack directives.

MSVC takes into account alignment attributes on typedefs when
determining whether or not a field has a certain required alignment.

Do the same in clang by tracking whether or not we saw such an attribute
when calculating the type's bitwidth and alignment.

This fixes PR20418.

Reviewers: rnk

Differential Revision: http://reviews.llvm.org/D4714

llvm-svn: 214274
clang/include/clang/AST/ASTContext.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/RecordLayoutBuilder.cpp
clang/lib/CodeGen/CGAtomic.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/Sema/SemaDeclObjC.cpp
clang/test/Layout/ms-x86-pack-and-align.cpp