llvm-6502/unittests
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
..
ADT We really want to hash pairs of directly-hashable data as directly 2012-03-02 09:26:36 +00:00
Analysis The product of two chrec's can always be represented as a chrec. 2011-10-04 06:51:26 +00:00
Bitcode Bitcode: Don't expose WriteBitcodeToStream to clients. 2012-02-29 20:30:56 +00:00
ExecutionEngine MCJIT support for non-function sections. 2012-01-16 22:26:39 +00:00
Support BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size. 2012-03-01 22:10:16 +00:00
Transforms Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch 2011-12-20 02:50:00 +00:00
VMCore Undo the hack in r147427 and move this unittest to a better home. This 2012-01-02 09:19:48 +00:00
CMakeLists.txt Add a Briggs and Torczon sparse set implementation. 2012-02-22 00:56:08 +00:00
Makefile Undo the hack in r147427 and move this unittest to a better home. This 2012-01-02 09:19:48 +00:00
Makefile.unittest build/unittests: Fix llvm-config names for gtest libraries, and bring Makefile 2011-12-15 23:35:08 +00:00