22 typedef std::vector<std::pair<KeyT, ValueT>> VectorTy;
34 #ifdef EXPENSIVE_CHECKS
39 assert(
I->second < Vector.size());
40 assert(Vector[
I->second].first ==
I->first);
42 for (
typename VectorTy::const_iterator
I = Vector.begin(),
E = Vector.end();
45 Map[
I->first] == size_t(
I - Vector.begin())));
50 std::pair<typename MapTy::iterator, bool> Pair =
51 Map.
insert(std::make_pair(Arg,
size_t(0)));
53 size_t Num = Vector.size();
54 Pair.first->second = Num;
55 Vector.push_back(std::make_pair(Arg,
ValueT()));
56 return Vector[Num].second;
58 return Vector[Pair.first->second].second;
61 std::pair<iterator, bool>
insert(
const std::pair<KeyT, ValueT> &InsertPair) {
62 std::pair<typename MapTy::iterator, bool> Pair =
63 Map.
insert(std::make_pair(InsertPair.first,
size_t(0)));
65 size_t Num = Vector.size();
66 Pair.first->second = Num;
67 Vector.push_back(InsertPair);
68 return std::make_pair(Vector.begin() + Num,
true);
70 return std::make_pair(Vector.begin() + Pair.first->second,
false);
77 return Vector.begin() + It->second;
84 return Vector.begin() + It->second;
90 void blot(
const KeyT &Key) {
94 Vector[It->second].first = KeyT();
const_iterator find(const KeyT &Key) const
ValueT & operator[](const KeyT &Arg)
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
iterator find(const KeyT &Key)
bool erase(const KeyT &Val)
VectorTy::const_iterator const_iterator
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &InsertPair)
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > const_iterator
An associative container with fast insertion-order (deterministic) iteration over its elements...
const_iterator begin() const
const_iterator end() const
size_type count(const KeyT &Val) const
Return 1 if the specified key is in the map, 0 otherwise.
VectorTy::iterator iterator
iterator find(const KeyT &Val)
LLVM_NODISCARD bool empty() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void blot(const KeyT &Key)
This is similar to erase, but instead of removing the element from the vector, it just zeros out the ...