1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/unittests/ADT
Chandler Carruth 8bbd7bacc1 [ADT] Add an abstraction for embedding an integer within a pointer-like
type.

This makes it easy and safe to use a set of flags as one elmenet of
a tagged union with pointers. There is quite a bit of code that has
historically done this by casting arbitrary integers to "pointers" and
assuming that this was safe and reliable. It is neither, and has started
to rear its head by triggering safety asserts in various abstractions
like PointerLikeTypeTraits when the integers chosen are invariably poor
choices for *some* platform and *some* situation. Not to mention the
(hopefully unlikely) prospect of one of these integers actually getting
allocated!

With this, it will be straightforward to build type safe abstractions
like this without being error prone. The abstraction itself is also
remarkably simple thanks to the implicit conversion.

This use case and pattern was also independently created by the folks
working on Swift, and they're going to incrementally add any missing
functionality they find.

Differential Revision: http://reviews.llvm.org/D15844

llvm-svn: 257284
2016-01-10 09:40:13 +00:00
..
APFloatTest.cpp Add isInteger() to APFloat. 2015-11-16 21:52:48 +00:00
APIntTest.cpp Fix APInt value initialization to give a zero value as any sane integer type 2015-09-04 04:08:36 +00:00
APSIntTest.cpp ADTTests: merge #ifdef checks from r240436. 2015-06-24 17:05:04 +00:00
ArrayRefTest.cpp Add makeArrayRef() overload for ArrayRef input (no-op/identity) NFC 2015-09-10 00:05:04 +00:00
BitVectorTest.cpp Simplify SmallBitVector::applyMask by consolidating common code for 32- and 64-bit builds 2015-09-18 15:08:24 +00:00
CMakeLists.txt [ADT] Add an abstraction for embedding an integer within a pointer-like 2016-01-10 09:40:13 +00:00
DAGDeltaAlgorithmTest.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
DeltaAlgorithmTest.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
DenseMapTest.cpp Add a unittest for SmallDenseMap that tests assigning a SmallDenseMap when it is not small. 2015-10-31 05:23:53 +00:00
DenseSetTest.cpp [ADT] Add a 'find_as' operation to DenseSet. 2014-10-19 19:36:33 +00:00
FoldingSet.cpp Adding full stops to comments 2015-09-04 15:28:13 +00:00
FunctionRefTest.cpp Ensure function_refs are copyable even from non-const references 2014-11-12 02:06:08 +00:00
HashingTest.cpp Remove no-op dtor so that use of the implicit copy ctor/assignment operator are not deprecated. 2015-03-03 19:52:59 +00:00
ilistTest.cpp ADT: Avoid relying on UB in ilist_node::getNextNode() 2015-11-11 02:26:42 +00:00
ImmutableMapTest.cpp [C++11] Use 'nullptr'. 2014-06-08 22:29:17 +00:00
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp
IntrusiveRefCntPtrTest.cpp
Makefile
MakeUniqueTest.cpp
MapVectorTest.cpp [ADT] Teach MapVector to support a swap member. Will be used in 2015-03-25 00:50:21 +00:00
OptionalTest.cpp Allow Optionals to be compared to None 2015-08-19 23:07:27 +00:00
PackedVectorTest.cpp Simplify PackedVector by removing user-defined special members that aren't any different than the defaults 2015-08-12 23:26:12 +00:00
PointerEmbeddedIntTest.cpp [ADT] Add an abstraction for embedding an integer within a pointer-like 2016-01-10 09:40:13 +00:00
PointerIntPairTest.cpp [ADT] Use a nonce type with at least 4 byte alignment. 2015-12-29 00:03:24 +00:00
PointerSumTypeTest.cpp [ADT] Add a sum type abstraction for pointer-like types. 2016-01-10 08:48:23 +00:00
PointerUnionTest.cpp [C++11] Use 'nullptr'. 2014-06-08 22:29:17 +00:00
PostOrderIteratorTest.cpp Compilation test for PostOrderIterator. 2014-11-20 19:33:33 +00:00
RangeAdapterTest.cpp Reapply "Add reverse(ContainerTy) range adapter." 2015-07-29 22:19:09 +00:00
SCCIteratorTest.cpp [llvm] Replacing asserts with static_asserts where appropriate 2015-03-16 09:53:42 +00:00
SmallPtrSetTest.cpp
SmallStringTest.cpp Add SmallString test trying to exercise the realloc() code path 2015-08-11 17:35:49 +00:00
SmallVectorTest.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
SparseBitVectorTest.cpp Miscellaneous Fixes for SparseBitVector 2015-07-20 18:26:23 +00:00
SparseMultiSetTest.cpp
SparseSetTest.cpp
StringMapTest.cpp Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
StringRefTest.cpp [ADT] Fix a confusing interface spec and some annoying peculiarities 2015-09-10 07:51:37 +00:00
TinyPtrVectorTest.cpp [tinyptrvector] Add in a MutableArrayRef implicit conversion operator to complement the ArrayRef implicit conversion operator. 2015-01-19 03:25:33 +00:00
TripleTest.cpp Handle ARMv6-J as an alias, instead of fake architecture 2015-11-20 16:46:09 +00:00
TwineTest.cpp Teach Twine to support SmallString. 2015-03-17 09:51:17 +00:00
VariadicFunctionTest.cpp