14#ifndef LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H
15#define LLVM_CLANG_SERIALIZATION_CONTINUOUSRANGEMAP_H
18#include "llvm/ADT/STLExtras.h"
19#include "llvm/ADT/SmallVector.h"
36template <
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 = llvm::lower_bound(Rep, 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 = llvm::upper_bound(Rep, K, Compare());
120 llvm::sort(Self.Rep, Compare());
123 Self.Rep.begin(), Self.Rep.end(),
127 assert((A == B || A.first != B.first) &&
128 "ContinuousRangeMap::Builder given non-unique keys");
135 Self.Rep.push_back(Val);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
An object that helps properly build a continuous range map from a set of values.
Builder(const Builder &)=delete
Builder & operator=(const Builder &)=delete
Builder(ContinuousRangeMap &Self)
void insert(const value_type &Val)
A map from continuous integer ranges to some value, with a very specialized interface.
const value_type * const_pointer
void insertOrReplace(const value_type &Val)
typename Representation::const_iterator const_iterator
typename Representation::iterator iterator
const_iterator begin() const
std::pair< Int, V > value_type
void insert(const value_type &Val)
const value_type & const_reference
const_iterator end() const
const_reference back() const
const_iterator find(Int K) const
The JSON file list parser is used to communicate input to InstallAPI.