llvm-6502/include/llvm/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
..
APFloat.h
APInt.h Add r149110 back with a fix for when the vector and the int have the same 2012-01-27 23:33:07 +00:00
APSInt.h
ArrayRef.h Introduce a new MutableArrayRef class, which refers to a series of mutable 2012-01-19 06:34:52 +00:00
BitVector.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
DAGDeltaAlgorithm.h Adding missing anchor to DATDeltaAlgorithm. 2011-12-07 06:44:23 +00:00
DeltaAlgorithm.h
DenseMap.h DenseMap::find_as() and unit tests. 2012-01-30 06:55:43 +00:00
DenseMapInfo.h Fix various issues (or do cleanups) found by enabling certain MSVC warnings. 2012-02-13 06:30:56 +00:00
DenseSet.h
DepthFirstIterator.h
edit_distance.h Add function for computing the edit distance of two arrays. 2012-02-15 22:13:07 +00:00
EquivalenceClasses.h
FoldingSet.h
GraphTraits.h
Hashing.h We really want to hash pairs of directly-hashable data as directly 2012-03-02 09:26:36 +00:00
ilist_node.h
ilist.h
ImmutableIntervalMap.h
ImmutableList.h
ImmutableMap.h
ImmutableSet.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
IndexedMap.h
InMemoryStruct.h
IntEqClasses.h
IntervalMap.h Fixed typo. 2011-12-22 00:12:51 +00:00
IntrusiveRefCntPtr.h RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend, 2012-01-31 19:58:34 +00:00
NullablePtr.h
Optional.h
OwningPtr.h revert r148688 too, this isn't safe for DenseMap use. When DenseMap resizes, it will need to copy around arbitrary pointers 2012-01-23 15:10:41 +00:00
PackedVector.h
PointerIntPair.h
PointerUnion.h
PostOrderIterator.h
PriorityQueue.h
SCCIterator.h
ScopedHashTable.h
SetOperations.h
SetVector.h add a method to improve compatibility with SmallVector. 2011-12-20 00:03:41 +00:00
SmallBitVector.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
SmallPtrSet.h
SmallSet.h allow clients of SmallSet to specify their own comparison function for the set. 2012-01-05 17:35:07 +00:00
SmallString.h Additional methods for SmallString. 2012-01-24 23:43:59 +00:00
SmallVector.h Template specialize SmallVector::push_back based on POD-ness of the type. Reduces clang binary by 188KB 2012-02-16 04:58:48 +00:00
SparseBitVector.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
SparseSet.h GCC warns about a comparison between signed and unsigned values. 2012-02-23 08:23:53 +00:00
Statistic.h Silence tsan false-positives (tsan can't track things which are only safe due to 2011-12-05 23:07:05 +00:00
STLExtras.h
StringExtras.h
StringMap.h Various public StringMap methods take or return "MapEntryTy", make it public. 2012-01-23 21:42:52 +00:00
StringRef.h add ::drop_back() and ::drop_front() methods, which are like pop_front/pop_back on a vector, but a) aren't destructive to "this", and b) can take a # elements to drop. 2012-01-24 08:58:57 +00:00
StringSet.h
StringSwitch.h
TinyPtrVector.h allow TinyPtrVector to implicitly convert to ArrayRef. 2011-12-06 02:00:33 +00:00
Trie.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
Triple.h Support was removed from LLVM's MIPS backend for the PSP variant of that 2012-02-22 11:32:54 +00:00
Twine.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
UniqueVector.h
ValueMap.h
VariadicFunction.h As Doug pointed out (and I really should know), it is perfectly easy to 2011-12-17 10:20:15 +00:00