1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/include/llvm/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
..
AllocatorList.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Any.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APFloat.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APInt.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
APSInt.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ArrayRef.h [ADT] Fix OwningArrayRef's move ctor 2019-04-13 13:52:11 +00:00
bit.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
BitmaskEnum.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BreadthFirstIterator.h [NFC] Fix typo in comment. 2019-04-06 22:05:24 +00:00
CachedHashString.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DAGDeltaAlgorithm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeltaAlgorithm.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseMap.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
DenseMapInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DenseSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DepthFirstIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
edit_distance.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EpochTracker.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EquivalenceClasses.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
fallible_iterator.h [ADT] Add a fallible_iterator wrapper. 2019-02-05 23:17:11 +00:00
FoldingSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FunctionExtras.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GraphTraits.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Hashing.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_base.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_iterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node_base.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node_options.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist_node.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ilist.h [ADT] Notify ilist traits about in-list transfers 2019-01-23 22:59:52 +00:00
ImmutableList.h Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
ImmutableMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ImmutableSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IndexedMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntEqClasses.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntervalMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IntrusiveRefCntPtr.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
iterator_range.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
iterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MapVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
None.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Optional.h Speculative buildfix for Mac 2019-02-20 14:56:31 +00:00
PackedVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerEmbeddedInt.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerIntPair.h Fix llvm::is_trivially_copyable portability issues 2019-01-22 13:48:55 +00:00
PointerSumType.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PointerUnion.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PostOrderIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PriorityQueue.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PriorityWorklist.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SCCIterator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScopedHashTable.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScopeExit.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sequence.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SetOperations.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SetVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
simple_ilist.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallBitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallPtrSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallString.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SmallVector.h [ADT] Make SmallVector emplace_back return a reference 2019-03-16 02:41:45 +00:00
SparseBitVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseMultiSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SparseSet.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Statistic.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
STLExtras.h [ADT] llvm::bsearch, binary search for mere mortals 2019-04-16 23:53:28 +00:00
StringExtras.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StringRef.h [ADT] Move away from __attribute__((always_inline)). 2019-01-22 22:40:35 +00:00
StringSet.h [tblgen] Track CodeInit origins when possible 2019-03-02 00:12:57 +00:00
StringSwitch.h [ADT] Move away from __attribute__((always_inline)). 2019-01-22 22:40:35 +00:00
TinyPtrVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Triple.h [WebAssembly] Add Emscripten OS definition + small_printf 2019-04-03 01:08:35 +00:00
Twine.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
UniqueVector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VariadicFunction.h Fix misspelled filenames in file headers 2019-02-07 14:38:25 +00:00