15 #ifndef LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H 16 #define LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H 19 #include "llvm/ADT/SmallVector.h" 36 template <
typename Int,
typename V,
unsigned InitialCapacity>
57 bool operator ()(Int L, Int R)
const {
61 return L.first < R.first;
67 if (!Rep.empty() && Rep.back() == Val)
70 assert((Rep.empty() || Rep.back().first < Val.first) &&
71 "Must insert keys in order.");
76 iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare());
77 if (I != Rep.end() && I->first == Val.first) {
78 I->second = Val.second;
85 using iterator =
typename Representation::iterator;
94 iterator I = std::upper_bound(Rep.begin(), Rep.end(), K, Compare());
120 std::sort(Self.Rep.begin(), Self.Rep.end(), Compare());
121 std::unique(Self.Rep.begin(), Self.Rep.end(),
125 assert((A == B || A.first != B.first) &&
126 "ContinuousRangeMap::Builder given non-unique keys");
132 Self.Rep.push_back(Val);
141 #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)