llvm/unittests/Support
Chandler Carruth 585de7a1b1 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
2012-06-16 08:52:57 +00:00
..
AlignOfTest.cpp Add support to the alignment support header for conjuring a character 2012-06-16 08:52:57 +00:00
AllocatorTest.cpp BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size. 2012-03-01 22:10:16 +00:00
BlockFrequencyTest.cpp Implement comparison operators for BranchProbability in a way that can't overflow INT64_MAX. 2011-10-24 13:50:56 +00:00
Casting.cpp unittests/Support/Casting.cpp: [PR8226] Workaround for MSVC|Debug. 2012-01-22 12:14:35 +00:00
CommandLineTest.cpp Fix a compile failure introduced by r82675 on MinGW which doesn't have 2009-09-25 21:07:20 +00:00
ConstantRangeTest.cpp fix corner case in ConstantRange::intersectWith(). 2012-05-18 00:14:36 +00:00
DataExtractorTest.cpp unittests/Support/DataExtractorTest.cpp: Specify ULL explicitly to a few constants. 2011-09-13 23:23:49 +00:00
EndianTest.cpp Merge System into Support. 2010-11-29 18:16:10 +00:00
IntegersSubsetTest.cpp IntegersSubsetMapping: added exclude operation, that allows to exclude subset of integers from current mapping. 2012-06-05 07:57:36 +00:00
IRBuilderTest.cpp Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
LeakDetectorTest.cpp Fix death tests in -Asserts builds. 2010-03-17 01:18:45 +00:00
Makefile Minimal raw_ostream unit tests 2009-03-17 16:14:59 +00:00
ManagedStatic.cpp Fix Windows build, don't try to #include <pthread.h> when we know it's not 2011-11-14 22:10:23 +00:00
MathExtrasTest.cpp Fixes warnings emitted by Visual Studio 2010 compiler. 2011-03-01 23:11:57 +00:00
MDBuilderTest.cpp Remove support for the special 'fast' value for fpmath accuracy for the moment. 2012-04-16 19:39:33 +00:00
Path.cpp Revert r146363 to allow buildbots to make forward progress. 2011-12-12 17:58:31 +00:00
raw_ostream_test.cpp Add raw_ostream::write_escaped, for writing escaped strings. 2009-10-17 20:43:08 +00:00
RegexTest.cpp Add Regex::sub, for doing regular expression substitution with backreferences. 2010-02-17 20:08:42 +00:00
SwapByteOrderTest.cpp Merge System into Support. 2010-11-29 18:16:10 +00:00
TimeValue.cpp unittests: Merge SystemTests back into SupportTests. 2010-11-29 22:29:04 +00:00
TypeBuilderTest.cpp Round 2 of dead private variable removal. 2012-06-06 19:47:08 +00:00
ValueHandleTest.cpp Change all self assignments X=X to (void)X, so that we can turn on a 2010-12-23 00:58:24 +00:00
YAMLParserTest.cpp Add YAML parser to Support. 2012-04-03 23:09:22 +00:00