15 #ifndef LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H 16 #define LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H 19 #include "llvm/ADT/STLExtras.h" 20 #include "llvm/ADT/SmallVector.h" 37 template <
typename Int,
typename V,
unsigned InitialCapacity>
58 bool operator ()(Int L, Int R)
const {
62 return L.first < R.first;
68 if (!Rep.empty() && Rep.back() == Val)
71 assert((Rep.empty() || Rep.back().first < Val.first) &&
72 "Must insert keys in order.");
77 iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare());
78 if (I != Rep.end() && I->first == Val.first) {
79 I->second = Val.second;
86 using iterator =
typename Representation::iterator;
95 iterator I = std::upper_bound(Rep.begin(), Rep.end(), K, Compare());
121 llvm::sort(Self.Rep.begin(), Self.Rep.end(), Compare());
122 std::unique(Self.Rep.begin(), Self.Rep.end(),
126 assert((A == B || A.first != B.first) &&
127 "ContinuousRangeMap::Builder given non-unique keys");
133 Self.Rep.push_back(Val);
142 #endif // LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H void insert(const value_type &Val)
const value_type & const_reference
const_iterator begin() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
const_reference back() const
typename Representation::iterator iterator
const value_type * const_pointer
void insertOrReplace(const value_type &Val)
Builder(ContinuousRangeMap &Self)
typename Representation::const_iterator const_iterator
std::pair< serialization::IdentID, ModuleFile * > value_type
An object that helps properly build a continuous range map from a set of values.
Dataflow Directional Tag Classes.
A map from continuous integer ranges to some value, with a very specialized interface.
const_iterator end() const
const_iterator find(Int K) const
void insert(const value_type &Val)