Try to appease MSVC even more elaborately in the alignment hacking space.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 24 Aug 2012 09:53:43 +0000 (09:53 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 24 Aug 2012 09:53:43 +0000 (09:53 +0000)
commitbe06428ba3d954662b58d204486771c71c816b94
tree17fd08fbe962ff69dbe0a26387b7e1273cb2716b
parent0e292376d09223d791ed2ccc8935e98cbd36f1f8
Try to appease MSVC even more elaborately in the alignment hacking space.

MSVC doesn't support passing by-value parameters with alignment of
16-bytes or higher apparantly. What is deeply confusing is that it seems
to *sometimes* (but not always) apply this to any type whose alignment
is set using __declspec(align(...)). This caused lots of errors when we switch
SmallVector over to use the automatically aligned character array
utilities as they used __declspec(align(...)) heavily.

As a pretty horrible but effective work-around, we instead cherry pick
the smallest alignment sizes with specific types that happen to have the
correct alignment, and then fall back to the attribute solution past
them. This should resolve the MSVC build errors folks have been hitting.
Sorry for that. In good news, it will do this without introducing other
UB I hope. =]

Thanks to Timur Iskhodzhanov for helping me test this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162549 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/AlignOf.h