1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/unittests/ADT
Sam McCall c06d4974d8 [ADT] llvm::bsearch, binary search for mere mortals
Summary:
Add to STLExtras a binary search function with a simple mental model:
You provide a range and a predicate which is true above a certain point.
bsearch() tells you that point.
Overloads are provided for integers, iterators, and containers.

This is more suitable than std:: alternatives in many cases:
 - std::binary_search only indicates presence/absence
 - upper_bound/lower_bound give you the opportunity to pick the wrong one
 - all of the options have confusing names and definitions when your predicate
   doesn't have simple "less than" semantics
 - all of the options require iterators
 - we plumb around a useless `value` parameter that should be a lambda capture

The API is inspired by Go's standard library, but we add an extra parameter as
well as some overloads and templates to show how clever C++ is.

Reviewers: ilya-biryukov, gribozavr

Subscribers: dexonsmith, kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60779

llvm-svn: 358540
2019-04-16 23:53:28 +00:00
..
AnyTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APFloatTest.cpp [MC] Fix floating-point literal lexing. 2019-03-28 21:12:28 +00:00
APIntTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APSIntTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ArrayRefTest.cpp [ADT] Fix OwningArrayRef's move ctor 2019-04-13 13:52:11 +00:00
BitmaskEnumTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BitVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BreadthFirstIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BumpPtrListTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [ADT] Add a fallible_iterator wrapper. 2019-02-05 23:17:11 +00:00
DAGDeltaAlgorithmTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeltaAlgorithmTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseMapTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DepthFirstIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EquivalenceClassesTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FallibleIteratorTest.cpp [ADT] Add a fallible_iterator wrapper. 2019-02-05 23:17:11 +00:00
FoldingSet.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionExtrasTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionRefTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
HashingTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListBaseTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListNodeBaseTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListNodeTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListSentinelTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IListTest.cpp [ADT] Notify ilist traits about in-list transfers 2019-01-23 22:59:52 +00:00
ImmutableListTest.cpp Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
ImmutableMapTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImmutableSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntEqClassesTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntervalMapTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntrusiveRefCntPtrTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MakeUniqueTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MappedIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MapVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
OptionalTest.cpp [NFC] Make Optional<T> trivially copyable when T is trivially copyable 2019-02-18 12:07:12 +00:00
PackedVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerEmbeddedIntTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerIntPairTest.cpp Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
PointerSumTypeTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerUnionTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PostOrderIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PriorityWorklistTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RangeAdapterTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SCCIteratorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScopeExitTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SequenceTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SetVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SimpleIListTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallPtrSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallStringTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallVectorTest.cpp [ADT] Update SmallVectorTest.EmplaceBack tests after rL356312 2019-03-26 05:33:52 +00:00
SparseBitVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseMultiSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseSetTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StatisticTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
STLExtrasTest.cpp [ADT] llvm::bsearch, binary search for mere mortals 2019-04-16 23:53:28 +00:00
StringExtrasTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringMapTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringRefTest.cpp Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
StringSwitchTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TestGraph.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TinyPtrVectorTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TripleTest.cpp Add XCOFF triple object format type for AIX 2019-03-12 22:01:10 +00:00
TwineTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VariadicFunctionTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00