]> granicus.if.org Git - clang/commit
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)
commit7c8f94e3d5929648f498594369d9773a60927a86
treece10fa7bfe48bd6564a0b8708cbe38e86e97844d
parent03cbfe00b66a4958b977e4fe088008770285caca
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214274 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/AST/RecordLayoutBuilder.cpp
lib/CodeGen/CGAtomic.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/Sema/SemaDeclObjC.cpp
test/Layout/ms-x86-pack-and-align.cpp