1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
llvm-mirror/include/llvm/ADT
Chandler Carruth 8ef1184049 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.

llvm-svn: 151883
2012-03-02 09:26:36 +00:00
..
APFloat.h Add an APFloat::convertToInt(APSInt) function that automatically manages the 2011-07-15 07:04:56 +00:00
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 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and 2010-12-07 08:25:19 +00:00
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 Fix comment. 2010-02-17 19:26:45 +00:00
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 Initialize DenseSets lazily. 2011-07-21 23:03:59 +00:00
DepthFirstIterator.h Simplify this code. 2011-03-01 22:07:32 +00:00
edit_distance.h Add function for computing the edit distance of two arrays. 2012-02-15 22:13:07 +00:00
EquivalenceClasses.h Merge System into Support. 2010-11-29 18:16:10 +00:00
FoldingSet.h Remove redundant template partial specilization. 2011-05-16 12:42:22 +00:00
GraphTraits.h Change the Dominators recalculate() function to only rely on GraphTraits 2011-12-05 19:17:04 +00:00
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 Fix const ilist_node::get{Prev,Next}Node() to actually compile. Picky, picky. 2010-05-13 18:35:02 +00:00
ilist.h Fix a ton of comment typos found by codespell. Patch by 2011-04-15 05:18:47 +00:00
ImmutableIntervalMap.h Give ImmutableIntervalMap.h an include guard. 2011-04-24 15:46:46 +00:00
ImmutableList.h Add ImmutableList::contains(). Patch by Rui Paulo! 2011-07-06 21:59:48 +00:00
ImmutableMap.h Add getTreeFactory() to ImmutableSet to allow construction of ImmutableSetRef from an ImmutableSet object. 2011-09-23 19:10:26 +00:00
ImmutableSet.h Convert assert(0) to llvm_unreachable 2012-02-05 22:14:15 +00:00
IndexedMap.h Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results 2011-01-09 21:58:20 +00:00
InMemoryStruct.h ADT/InMemoryStruct: Add an experimental helper class intended for use in 2010-11-27 08:11:02 +00:00
IntEqClasses.h Use IntEqClasses to compute connected components of live intervals. 2010-12-21 00:48:17 +00:00
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 add a new NullablePtr class which makes it more obvious in API 2010-07-24 18:47:46 +00:00
Optional.h Poison the relational operators ==, !=, <, <=, >=, > on llvm::Optional 2011-02-11 18:13:20 +00:00
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 Constify PackedVector::reference::operator T(). 2011-06-15 19:18:13 +00:00
PointerIntPair.h Allow getting the address of the value in a PointerUnion or PointerIntPair if one is 2011-02-19 03:55:58 +00:00
PointerUnion.h Fix an obscure bug in PointerUnion that would bite PointerUnion3/4. Basically, 2011-08-12 04:31:38 +00:00
PostOrderIterator.h An interface for iterating over a loop's blocks in DFS order. 2011-08-03 23:27:28 +00:00
PriorityQueue.h Make a few more LLVM headers parsable as standalone headers. 2009-11-05 23:01:30 +00:00
SCCIterator.h Avoid warnings about the parameter G being unused. 2011-10-20 08:56:41 +00:00
ScopedHashTable.h add the ability to walk the scope tree and insert at not-the-current 2011-02-27 22:51:57 +00:00
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 Prevent infinite growth of SmallPtrSet instances. 2011-03-30 18:32:48 +00:00
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 move tier out of an anonymous namespace, it doesn't make sense 2011-07-21 06:21:31 +00:00
StringExtras.h Replace (Lower|Upper)caseString in favor of StringRef's newest methods. 2011-11-06 20:37:06 +00:00
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 modernize stringset interface 2010-07-23 03:21:53 +00:00
StringSwitch.h Finish full attribute class emission for clang. 2010-08-18 23:23:09 +00:00
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 Removed trailing whitespace. 2009-01-09 19:25:42 +00:00
ValueMap.h Merge System into Support. 2010-11-29 18:16:10 +00:00
VariadicFunction.h As Doug pointed out (and I really should know), it is perfectly easy to 2011-12-17 10:20:15 +00:00