llvm-6502/unittests/ADT
Chandler Carruth 4d628e200f We really want to hash pairs of directly-hashable data as directly
hashable data. This matters when we have pair<T*, U*> as a key, which is
quite common in DenseMap, etc. To that end, we need to detect when this
is safe. The requirements on a generic std::pair<T, U> are:

1) Both T and U must satisfy the existing is_hashable_data trait. Note
   that this includes the requirement that T and U have no internal
   padding bits or other bits not contributing directly to equality.
2) The alignment constraints of std::pair<T, U> do not require padding
   between consecutive objects.
3) The alignment constraints of U and the size of T do not conspire to
   require padding between the first and second elements.

Grow two somewhat magical traits to detect this by forming a pod
structure and inspecting offset artifacts on it. Hopefully this won't
cause any compilers to panic.

Added and adjusted tests now that pairs, even nested pairs, are treated
as just sequences of data.

Thanks to Jeffrey Yasskin for helping me sort through this and reviewing
the somewhat subtle traits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 09:26:36 +00:00
..
APFloatTest.cpp
APIntTest.cpp Add a unittest for rotating a really big APInt. 2012-02-07 16:27:39 +00:00
BitVectorTest.cpp Add portable bit mask operations to BitVector. 2012-01-17 01:24:32 +00:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp DenseMap::find_as() and unit tests. 2012-01-30 06:55:43 +00:00
DenseSetTest.cpp
FoldingSet.cpp
HashingTest.cpp We really want to hash pairs of directly-hashable data as directly 2012-03-02 09:26:36 +00:00
ilistTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp
IntrusiveRefCntPtrTest.cpp RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend, 2012-01-31 19:58:34 +00:00
Makefile
PackedVectorTest.cpp
SCCIteratorTest.cpp
SmallBitVectorTest.cpp
SmallStringTest.cpp Additional methods for SmallString. 2012-01-24 23:43:59 +00:00
SmallVectorTest.cpp
SparseBitVectorTest.cpp
SparseSetTest.cpp Fix typos. 2012-02-22 16:01:54 +00:00
StringMapTest.cpp
StringRefTest.cpp
TripleTest.cpp Support was removed from LLVM's MIPS backend for the PSP variant of that 2012-02-22 11:32:54 +00:00
TwineTest.cpp
VariadicFunctionTest.cpp As Doug pointed out (and I really should know), it is perfectly easy to 2011-12-17 10:20:15 +00:00