32 #include <unordered_map>
36 std::unordered_map<llvm::Value*, llvm::Value*>
m_;
37 std::vector<llvm::Value*>
v_;
40 auto m_it =
m_.find(key);
41 if (m_it ==
m_.end()) {
48 void replace(llvm::Value* key1, llvm::Value* key2) {
52 auto m_it =
m_.find(key1);
53 if (m_it ==
m_.end()) {
56 auto v_it = std::find(
v_.begin(),
v_.end(), key1);
57 if (v_it ==
v_.end()) {
61 m_[key2] = m_it->second;
67 std::vector<llvm::Value*>::iterator
v_it_;
92 auto find(llvm::Value* key) {
94 return Iterator{
this, std::find(
v_.begin(),
v_.end(), key)};
100 std::pair<Iterator, bool>
emplace(llvm::Value* key, llvm::Value* val) {
103 return std::pair(it,
false);
105 m_.emplace(key, val);
107 return std::pair(
Iterator{
this,
v_.end() - 1},
true);
std::pair< Iterator, bool > emplace(llvm::Value *key, llvm::Value *val)
bool operator!=(const Iterator &peer)
bool operator==(const Iterator &peer)
std::vector< llvm::Value * >::iterator v_it_
InsertionOrderedMap * that_
Iterator(InsertionOrderedMap *that, std::vector< llvm::Value * >::iterator v_it)
std::vector< llvm::Value * > v_
void replace(llvm::Value *key1, llvm::Value *key2)
auto & operator[](llvm::Value *key)
auto find(llvm::Value *key)
std::unordered_map< llvm::Value *, llvm::Value * > m_