Merging r326173:

------------------------------------------------------------------------
r326173 | mstorsjo | 2018-02-26 22:27:06 -0800 (Mon, 26 Feb 2018) | 17 lines

[RecordLayout] Don't align to non-power-of-2 sizes when using -mms-bitfields

When targeting GNU/MinGW for i386, the size of the "long double" data
type is 12 bytes (while it is 8 bytes in MSVC). When building
with -mms-bitfields to have struct layouts match MSVC, data types
are laid out in a struct with alignment according to their size.
However, this doesn't make sense for the long double type, since
it doesn't match MSVC at all, and aligning to a non-power-of-2
size triggers other asserts later.

This matches what GCC does, aligning a long double to 4 bytes
in structs on i386 even when -mms-bitfields is specified.

This fixes asserts when using the max_align_t data type when
building for MinGW/i386 with the -mms-bitfields flag.

Differential Revision: https://reviews.llvm.org/D43734
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_60@333569 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed