15 #ifndef LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H
16 #define LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H
19 #include "llvm/ADT/SmallVector.h"
35 template <
typename Int,
typename V,
unsigned InitialCapacity>
55 bool operator ()(Int L, Int R)
const {
59 return L.first < R.first;
65 if (!Rep.empty() && Rep.back() == Val)
68 assert((Rep.empty() || Rep.back().first < Val.first) &&
69 "Must insert keys in order.");
74 iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare());
75 if (I != Rep.end() && I->first == Val.first) {
76 I->second = Val.second;
92 iterator I = std::upper_bound(Rep.begin(), Rep.end(), K, Compare());
119 std::sort(Self.Rep.begin(), Self.Rep.end(), Compare());
120 std::unique(Self.Rep.begin(), Self.Rep.end(),
124 assert((A == B || A.first != B.first) &&
125 "ContinuousRangeMap::Builder given non-unique keys");
131 Self.Rep.push_back(Val);
void insert(const value_type &Val)
std::pair< Int, V > value_type
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
detail::InMemoryDirectory::const_iterator I
const_iterator end() const
void insertOrReplace(const value_type &Val)
Builder(ContinuousRangeMap &Self)
Representation::const_iterator const_iterator
Representation::iterator iterator
const TemplateArgument * iterator
An object that helps properly build a continuous range map from a set of values.
const value_type & const_reference
const value_type * const_pointer
A map from continuous integer ranges to some value, with a very specialized interface.
void insert(const value_type &Val)
const_iterator find(Int K) const
const_reference back() const
const_iterator begin() const