llvm-project/llvm/unittests/ADT
Reid Kleckner 53f51da09e [ADT] Allow K to be incomplete during DenseMap<K*, V> instantiation
DenseMap requires two sentinel values for keys: empty and tombstone
values. To avoid undefined behavior, LLVM aligns the two sentinel
pointers to alignof(T). This requires T to be complete, which is
needlessly restrictive.

Instead, assume that DenseMap pointer keys have a maximum alignment of
4096, and use the same sentinel values for all pointer keys. The new
sentinels are:
  empty:     static_cast<uintptr_t>(-1) << 12
  tombstone: static_cast<uintptr_t>(-2) << 12

These correspond to the addresses of -4096 and -8192. Hopefully, such a
key is never inserted into a DenseMap.

I encountered this while looking at making clang's SourceManager not
require FileManager.h, but it has several maps keyed on classes defined
in FileManager.h. FileManager depends on various LLVM FS headers, which
cumulatively take ~200ms to parse, and are generally not needed.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D75301
2020-02-28 14:24:04 -08:00
..
APFloatTest.cpp [APFloat] Fix FP remainder operation 2020-02-12 10:42:55 +02:00
APIntTest.cpp [APInt] byteSwap - handle any whole byte bitwidth greater than 16-bits 2020-02-15 13:27:06 +00:00
APSIntTest.cpp Fix build when both gtest death tests and LLVM_NODISCARD are available. 2019-07-31 23:37:24 +00:00
AnyTest.cpp
ArrayRefTest.cpp [ADR] ArrayRefTest: disable SizeTSizedOperations test - it's UB. 2019-10-10 12:22:33 +00:00
BitVectorTest.cpp Fix compilation breakage introduced by 8404aeb56a. 2020-02-14 11:17:18 -05:00
BitmaskEnumTest.cpp
BreadthFirstIteratorTest.cpp
BumpPtrListTest.cpp
CMakeLists.txt [ADT] Add CoalescingBitVector, implemented using IntervalMap [1/3] 2020-02-27 12:39:46 -08:00
CoalescingBitVectorTest.cpp unittest: Convert EXPECT_EQ iterator checks to use EXPECT_TRUE instead 2020-02-27 14:19:45 -08:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp [ADT] Allow K to be incomplete during DenseMap<K*, V> instantiation 2020-02-28 14:24:04 -08:00
DenseSetTest.cpp Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
DepthFirstIteratorTest.cpp
DirectedGraphTest.cpp [DDG] DirectedGraph as a base class for various dependence graphs such 2019-07-25 18:23:22 +00:00
EnumeratedArrayTest.cpp [DDG] Data Dependence Graph - Pi Block 2019-11-08 15:46:08 -05:00
EquivalenceClassesTest.cpp
FallibleIteratorTest.cpp
FloatingPointMode.cpp Separately track input and output denormal mode 2020-02-04 12:59:21 -05:00
FoldingSet.cpp
FunctionExtrasTest.cpp
FunctionRefTest.cpp [ADT] Remove more llvm::make_unique 2020-01-28 08:48:50 -07:00
HashingTest.cpp
IListBaseTest.cpp
IListIteratorTest.cpp
IListNodeBaseTest.cpp
IListNodeTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableListTest.cpp
ImmutableMapTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp [ADT] Add CoalescingBitVector, implemented using IntervalMap [1/3] 2020-02-27 12:39:46 -08:00
IntrusiveRefCntPtrTest.cpp
IteratorTest.cpp [ADT] Move drop_begin from iterator_range.h into STLExtras. 2019-11-14 08:10:59 -08:00
MapVectorTest.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MappedIteratorTest.cpp
OptionalTest.cpp Revert "Unconditionally enable lvalue function designators; NFC" 2020-01-22 12:40:39 -05:00
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp PointerLikeTypeTraits: Standardize NumLowBitsAvailable on static constexpr rather than anonymous enum 2020-01-16 15:30:50 -08:00
PointerIntPairTest.cpp PointerLikeTypeTraits: Standardize NumLowBitsAvailable on static constexpr rather than anonymous enum 2020-01-16 15:30:50 -08:00
PointerSumTypeTest.cpp
PointerUnionTest.cpp Removed PointerUnion3 and PointerUnion4 aliases in favor of the variadic template 2020-01-14 18:56:29 +01:00
PostOrderIteratorTest.cpp
PriorityWorklistTest.cpp
RangeAdapterTest.cpp
SCCIteratorTest.cpp
STLExtrasTest.cpp Use C++14-style return type deduction in LLVM. 2020-02-11 07:38:42 -08:00
ScopeExitTest.cpp
SequenceTest.cpp
SetVectorTest.cpp
SimpleIListTest.cpp
SmallPtrSetTest.cpp [ADT] Add equality operator for SmallPtrSet 2019-11-06 11:17:51 +07:00
SmallSetTest.cpp [ADT] add equality operator for SmallSet 2019-10-29 17:33:57 -07:00
SmallStringTest.cpp [SmallString] Add explicit conversion to std::string 2020-01-29 10:17:10 -08:00
SmallVectorTest.cpp
SparseBitVectorTest.cpp
SparseMultiSetTest.cpp
SparseSetTest.cpp
StatisticTest.cpp [ADT][Statistics] Fix test after rL374490 2019-10-11 07:19:54 +00:00
StringExtrasTest.cpp Print quoted backslashes in LLVM IR as \\ instead of \5C 2019-10-10 18:31:57 +00:00
StringMapTest.cpp [ADT] Add StringMap::insert_or_assign 2019-09-25 04:58:02 +00:00
StringRefTest.cpp [ADT] Implicitly convert between StringRef and std::string_view when we have C++17 2020-01-28 13:56:12 +01:00
StringSetTest.cpp [ADT] Enable set_difference() to be used on StringSet 2019-06-07 20:23:03 +00:00
StringSwitchTest.cpp
TestGraph.h [ADT] Fixed -Wdeprecated-copy warning. NFCI 2019-11-28 00:49:42 +01:00
TinyPtrVectorTest.cpp Add TinyPtrVector support for general pointer-like things. 2019-08-20 23:29:28 +00:00
TripleTest.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TwineTest.cpp