llvm-project/llvm/unittests/ADT
Jakub Kuderski 2981832501 [ADT] Add llvm::range_size function for generic ranges
This function follows `std::ranges::size` from C++20. It is intended
mainly for generic code that does not know the exact range type.
I did not modify the existing `llvm::size` function because it has a strict
guarantee of O(1) running time, and we cannot guarantee that when we delegate
size check to user-defined size functions.

Use `range_size` to optimize size checks in `zip`* and `enumerate`
functions. Before that, we would have to perform linear scans for ranges
without random access iterators.

This is the last change I have planned in the series that overhauls
`zip`* and `enumerate`.

Reviewed By: dblaikie, zero9178

Differential Revision: https://reviews.llvm.org/D146231
2023-03-21 12:58:18 -04:00
..
AnyTest.cpp [llvm] Make llvm::Any similar to std::any 2022-12-20 13:28:30 +01:00
APFixedPointTest.cpp
APFloatTest.cpp APFloat: Add classify 2023-03-03 18:54:58 -04:00
APIntTest.cpp Migrate away from the soft-deprecated functions in APInt.h (NFC) 2023-02-20 00:58:29 -08:00
APSIntTest.cpp [APSInt] Fix bug in APSInt mentioned in https://github.com/llvm/llvm-project/issues/59515 2023-01-20 13:25:15 -08:00
ArrayRefTest.cpp [llvm][ADT] Mark makeMutableArrayRef as deprecated 2023-01-17 13:01:11 -07:00
BitFieldsTest.cpp
BitmaskEnumTest.cpp [NFC] Make FPClassTest a bitmask enumeration 2023-02-24 15:12:16 +07:00
BitTest.cpp [ADT] Add llvm::rotl and llvm::rotr to bit.h 2023-02-13 09:40:27 -08:00
BitVectorTest.cpp
BreadthFirstIteratorTest.cpp
BumpPtrListTest.cpp
CMakeLists.txt New SetOperations and unittesting for all SetOperations 2023-02-17 07:18:32 -08:00
CoalescingBitVectorTest.cpp
CombinationGeneratorTest.cpp [llvm] Don't include STLForwardCompat.h (NFC) 2022-12-06 20:09:56 -08:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp [ADT] Implement {DenseMap,MapVector,StringMap}::contains 2023-03-13 09:13:28 -07:00
DenseSetTest.cpp
DepthFirstIteratorTest.cpp
DirectedGraphTest.cpp
EditDistanceTest.cpp Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part 2023-01-05 14:11:08 +01:00
EnumeratedArrayTest.cpp
EquivalenceClassesTest.cpp
FallibleIteratorTest.cpp
FloatingPointMode.cpp
FoldingSet.cpp
FunctionExtrasTest.cpp
FunctionRefTest.cpp
HashingTest.cpp [llvm] Add support for hashing std::optional 2022-12-02 18:53:00 -08:00
IListBaseTest.cpp
IListIteratorTest.cpp
IListNodeBaseTest.cpp
IListNodeTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableListTest.cpp
ImmutableMapTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp
IntervalTreeTest.cpp
IntrusiveRefCntPtrTest.cpp
IteratorTest.cpp [ADT] Add llvm::range_size function for generic ranges 2023-03-21 12:58:18 -04:00
MappedIteratorTest.cpp
MapVectorTest.cpp [ADT] Implement {DenseMap,MapVector,StringMap}::contains 2023-03-13 09:13:28 -07:00
MoveOnly.cpp [ADT] Move MoveOnly to a header file (NFC) 2022-12-11 00:31:46 -08:00
MoveOnly.h [ADT] Move MoveOnly to a header file (NFC) 2022-12-11 00:31:46 -08:00
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp
PointerIntPairTest.cpp Avoid strict aliasing violation on type punning inside llvm::PointerIntPair 2023-02-23 17:03:23 +00:00
PointerSumTypeTest.cpp
PointerUnionTest.cpp
PostOrderIteratorTest.cpp [Analysis] llvm::Optional => std::optional 2022-12-14 07:32:24 +00:00
PriorityWorklistTest.cpp
RangeAdapterTest.cpp [ADT][NFC] Use declval to suppress warning for nullptr use. 2023-03-07 08:12:40 +08:00
SCCIteratorTest.cpp
ScopeExitTest.cpp
SequenceTest.cpp Fix SafeIntIterator reference type 2023-03-06 15:28:25 +00:00
SetOperationsTest.cpp New SetOperations and unittesting for all SetOperations 2023-02-17 07:18:32 -08:00
SetVectorTest.cpp
SimpleIListTest.cpp
SmallPtrSetTest.cpp
SmallSetTest.cpp
SmallStringTest.cpp [ADT] Make StringRef::compare like std::string_view::compare 2023-01-15 20:59:21 +01:00
SmallVectorTest.cpp Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part 2023-01-05 14:11:08 +01:00
SparseBitVectorTest.cpp
SparseMultiSetTest.cpp
SparseSetTest.cpp
StatisticTest.cpp [Support] llvm::Optional => std::optional 2022-12-16 08:49:10 +00:00
STLExtrasTest.cpp [ADT] Add llvm::range_size function for generic ranges 2023-03-21 12:58:18 -04:00
STLForwardCompatTest.cpp [llvm] Use std::optional instead of Optional 2022-12-20 15:42:32 -08:00
StringExtrasTest.cpp
StringMapTest.cpp [ADT] Implement {DenseMap,MapVector,StringMap}::contains 2023-03-13 09:13:28 -07:00
StringRefTest.cpp [ADT] Make StringRef::compare like std::string_view::compare 2023-01-15 20:59:21 +01:00
StringSetTest.cpp [NFC][ADT] Rename StringMapEntry *Create() into StringMapEntry *create. 2022-12-25 15:26:35 +01:00
StringSwitchTest.cpp
TestGraph.h
TinyPtrVectorTest.cpp Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ part 2023-01-05 14:11:08 +01:00
TwineTest.cpp
TypeSwitchTest.cpp [llvm][ADT] Allow returning std::nullopt in TypeSwitch 2022-12-18 00:02:03 +01:00
TypeTraitsTest.cpp