10 #ifndef LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H 11 #define LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H 29 using VectorTy = std::vector<std::pair<KeyT, ValueT>>;
33 #ifdef EXPENSIVE_CHECKS 38 assert(
I->second < Vector.size());
39 assert(Vector[
I->second].first ==
I->first);
41 for (
typename VectorTy::const_iterator
I = Vector.begin(),
E = Vector.end();
44 Map[
I->first] ==
size_t(
I - Vector.begin())));
57 std::pair<typename MapTy::iterator, bool> Pair =
58 Map.
insert(std::make_pair(Arg,
size_t(0)));
60 size_t Num = Vector.size();
61 Pair.first->second = Num;
62 Vector.push_back(std::make_pair(Arg,
ValueT()));
63 return Vector[Num].second;
65 return Vector[Pair.first->second].second;
68 std::pair<iterator, bool>
insert(
const std::pair<KeyT, ValueT> &InsertPair) {
69 std::pair<typename MapTy::iterator, bool> Pair =
70 Map.
insert(std::make_pair(InsertPair.first,
size_t(0)));
72 size_t Num = Vector.size();
73 Pair.first->second = Num;
74 Vector.push_back(InsertPair);
75 return std::make_pair(Vector.begin() + Num,
true);
77 return std::make_pair(Vector.begin() + Pair.first->second,
false);
84 return Vector.begin() + It->second;
91 return Vector.begin() + It->second;
101 Vector[It->second].first = KeyT();
118 #endif // LLVM_LIB_TRANSFORMS_OBJCARC_BLOTMAPVECTOR_H const_iterator end() const
This class represents lattice values for constants.
typename VectorTy::const_iterator const_iterator
ValueT & operator[](const KeyT &Arg)
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
const_iterator begin() const
iterator find(const_arg_type_t< KeyT > Val)
iterator find(const KeyT &Key)
bool erase(const KeyT &Val)
const_iterator find(const KeyT &Key) const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &InsertPair)
An associative container with fast insertion-order (deterministic) iteration over its elements...
amdgpu Simplify well known AMD library false Value Value * Arg
typename VectorTy::iterator iterator
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
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 ...