llvm-6502/unittests/ADT
Chandler Carruth dd9d38d57b Introduce a SmallDenseMap container that re-uses the existing DenseMap
implementation.

This type includes an inline bucket array which is used initially. Once
it is exceeded, an array of 64 buckets is allocated on the heap. The
bucket count grows from there as needed. Some highlights of this
implementation:

- The inline buffer is very carefully aligned, and so supports types
  with alignment constraints.
- It works hard to avoid aliasing issues.
- Supports types with non-trivial constructors, destructors, copy
  constructions, etc. It works reasonably hard to minimize copies and
  unnecessary initialization. The most common initialization is to set
  keys to the empty key, and so that should be fast if at all possible.

This class has a performance / space trade-off. It tries to optimize for
relatively small maps, and so packs the inline bucket array densely into
the object. It will be marginally slower than a normal DenseMap in a few
use patterns, so it isn't appropriate everywhere.

The unit tests for DenseMap have been generalized a bit to support
running over different map implementations in addition to different
key/value types. They've then been automatically extended to cover the
new container through the magic of GoogleTest's typed tests.

All of this is still a bit rough though. I'm going to be cleaning up
some aspects of the implementation, documenting things better, and
adding tests which include non-trivial types. As soon as I'm comfortable
with the correctness, I plan to switch existing users of SmallMap over
to this class as it is already more correct w.r.t. construction and
destruction of objects iin the map.

Thanks to Benjamin Kramer for all the reviews of this and the lead-up
patches. That said, more review on this would really be appreciated. As
I've noted a few times, I'm quite surprised how hard it is to get the
semantics for a hashtable-based map container with a small buffer
optimization correct. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158638 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-17 09:05:09 +00:00
..
APFloatTest.cpp
APIntTest.cpp fix the quotient returned by sdivrem() for the case when LHS is negative and RHS is positive 2012-05-22 01:09:48 +00:00
BitVectorTest.cpp Merge the SmallBitVector and BitVector unit tests with gtest's typed test magic and bring SmallBitVector up to date. 2012-06-16 10:51:07 +00:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp Define the new operator<< for sets into namespace std, so that 2009-12-24 21:11:45 +00:00
DenseMapTest.cpp Introduce a SmallDenseMap container that re-uses the existing DenseMap 2012-06-17 09:05:09 +00:00
DenseSetTest.cpp
FoldingSet.cpp
HashingTest.cpp Fix typos found by http://github.com/lyda/misspell-check 2012-06-02 10:20:22 +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
SmallMapTest.cpp Remove warning about testing unsigned int with int. 2012-05-15 09:59:13 +00:00
SmallPtrSetTest.cpp SmallPtrSet: Provide a more efficient implementation of swap than the default triple-copy std::swap. 2012-03-06 20:40:02 +00:00
SmallStringTest.cpp Additional methods for SmallString. 2012-01-24 23:43:59 +00:00
SmallVectorTest.cpp SmallVector: Don't rely on having an assignment operator around in push_back for POD-like types. 2012-04-29 10:53:29 +00:00
SparseBitVectorTest.cpp
SparseSetTest.cpp SparseSet: Add support for key-derived indexes and arbitrary key types. 2012-04-20 20:05:28 +00:00
StringMapTest.cpp
StringRefTest.cpp [Support/StringRef] Add find_last_not_of and {r,l,}trim. 2012-05-11 22:08:50 +00:00
TripleTest.cpp Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +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