History log of /external/llvm/unittests/Support/AlignOfTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cbeb8d9869aafec3c2c1ee0922f0a4d5bb4a916a 17-Aug-2012 Chandler Carruth <chandlerc@gmail.com> Flatten the aligned-char-array utility template to be a directly
templated union at the request of Richard Smith. This makes it
substantially easier to type. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
bd9060c5c028486d1af59edd5ba5bd1217e6af8e 21-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Add a pragma to supress an MSVC warning on some of the absurd code I'm
using to test the alignment support library.

Patch from Nikola on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
3967f503f4ea623d3300a785f5f1c333230f24a9 17-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Disable a particular assertion on MSVC... I'm deeply disturbed by its
implementation of the class layout for the V8 type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
f445be8958014c85eb39e07b1e0a389ea9522230 17-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Add some somewhat exhaustive tests of sizeof properties of this horrible
construct just for my sanity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
fd2b40efd7687621a7c849556a089ce4a610aafd 16-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Relax one assertion -- long double has strange alignments on lots of
platforms.

Also, remove one assertion on MSVC because it produces a completely
preposterous result, claiming something needs 12-byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
9755cd600f7a1bbdc080bbfcbd2529a54e1b3aab 16-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Try to reduce the size of the array used for compile-time testing by
making the bounds all '1', and chunking it a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp
585de7a1b1a51fa29b53bbc8faf3cc07e43bd993 16-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Add support to the alignment support header for conjuring a character
array of a suitable size and alignment for any of a number of different
types to be stored into the character array.

The mechanisms for producing an explicitly aligned type are fairly
complex because this operation is poorly supported on all compilers.
We've spent a fairly significant amount of time experimenting with
different implementations inside of Google, and the one using explicitly
expanded templates has been the most robust.

Credit goes to Nick Lewycky for writing the first 20 versions or so of
this logic we had inside of Google. I based this on the only one to
actually survive. In case anyone is worried, yes we are both explicitly
re-contributing and re-licensing it for LLVM. =]

Once the issues with actually specifying the alignment are finished, it
turns out that most compilers don't in turn align anything the way they
are instructed. Testing of this logic against both Clang and GCC
indicate that the alignment constraints are largely ignored by both
compilers! I've come up with and used a work-around by wrapping each
alignment-hinted type directly in a struct, and using that struct to
align the character array through a union. This elaborate hackery is
terrifying, but I've included testing that caught a terrifying number of
bugs in every other technique I've tried.

All of this in order to implement a poor C++98 programmers emulation of
C++11 unrestricted unions in classes such as SmallDenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/unittests/Support/AlignOfTest.cpp