14 #ifndef LLVM_ADT_IMMUTABLEMAP_H
15 #define LLVM_ADT_IMMUTABLEMAP_H
24 template <
typename T,
typename S>
59 template <
typename KeyT,
typename ValT,
60 typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
99 const bool Canonicalize;
103 : Canonicalize(canonicalize) {}
106 : F(Alloc), Canonicalize(canonicalize) {}
165 template <
typename Callback>
171 template <
typename Callback>
172 struct CBWrapperRef {
174 CBWrapperRef(Callback& c) :
C(c) {}
180 template <
typename Callback>
181 void foreach(Callback&
C) {
183 CBWrapperRef<Callback> CB(C);
188 template <
typename Callback>
191 CBWrapper<Callback> CB;
236 iterator
end()
const {
return iterator(); }
241 if (T)
return &T->
getValue().second;
270 template <
typename KeyT,
typename ValT,
271 typename ValInfo = ImutKeyValueInfo<KeyT,ValT> >
300 :
Root(X.getRootWithoutRetain()),
409 if (T)
return &T->
getValue().second;
iterator::pointer operator->() const
unsigned getHeight() const
void AddPointer(const void *Ptr)
TreeTy::Factory FactoryTy
void Profile(FoldingSetNodeID &ID) const
ValInfo::key_type key_type
ImmutableMap & operator=(const ImmutableMap &X)
ImmutableMap< KeyT, ValT > asImmutableMap() const
TreeTy * add(TreeTy *T, value_type_ref V)
static key_type_ref KeyOfValue(value_type_ref V)
ImutAVLTree< ValInfo > TreeTy
ImmutableMap< KeyT, ValT, ValInfo >::value_type_ref reference
bool isNotEqual(const ImutAVLTree &RHS) const
ValInfo::key_type key_type
ImmutableMap(const TreeTy *R)
ValInfo::data_type data_type
data_type_ref getData() const
ImutAVLTree * getMaxElement()
key_type_ref getKey() const
bool operator!=(const iterator &RHS) const
bool contains(key_type_ref K) const
data_type * lookup(key_type_ref K) const
ID
LLVM Calling Convention Representation.
bool contains(key_type_ref K) const
const std::pair< T, S > value_type
ValInfo::data_type_ref data_type_ref
ImmutableMap getEmptyMap()
bool operator!=(const iterator &RHS) const
const value_type & value_type_ref
ImmutableMap< KeyT, ValT, ValInfo >::value_type value_type
void foreach(Callback &C)
ImmutableMapRef add(key_type_ref K, data_type_ref D) const
iterator::value_type * pointer
value_type_ref operator*() const
TreeTy * getEmptyTree() const
TreeTy * remove(TreeTy *T, key_type_ref V)
ValInfo::key_type_ref key_type_ref
ValInfo::value_type_ref value_type_ref
ImutAVLTree * find(key_type_ref K)
static ImmutableMapRef getEmptyMap(FactoryTy *F)
value_type * getMaxElement() const
static bool isEqual(key_type_ref LHS, key_type_ref RHS)
data_type_ref getData() const
ptrdiff_t difference_type
iterator::reference operator*() const
ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D)
TreeTy::Factory * getTreeFactory() const
bool contains(key_type_ref K)
bool operator==(const ImmutableMapRef &RHS) const
static void Profile(FoldingSetNodeID &ID, value_type_ref V)
value_type * operator->() const
ValInfo::data_type data_type
ValInfo::key_type_ref key_type_ref
std::bidirectional_iterator_tag iterator_category
ImmutableMap(const ImmutableMap &X)
ImutAVLTree< ValInfo > TreeTy
#define LLVM_DELETED_FUNCTION
ImmutableMapRef(const ImmutableMapRef &X)
TreeTy * getCanonicalTree(TreeTy *TNew)
ValInfo::value_type_ref value_type_ref
ImmutableMapRef(const TreeTy *R, FactoryTy *F)
Factory(bool canonicalize=true)
data_type * lookup(key_type_ref K) const
bool operator==(const ImmutableMap &RHS) const
static void Profile(FoldingSetNodeID &ID, const ImmutableMapRef &M)
unsigned getHeight() const
const value_type & getValue() const
getValue - Returns the data value associated with the tree node.
ValInfo::value_type value_type
ImmutableMapRef(const ImmutableMap< KeyT, ValT > &X, typename ImmutableMap< KeyT, ValT >::Factory &F)
static bool isDataEqual(data_type_ref L, data_type_ref R)
void Profile(FoldingSetNodeID &ID) const
static bool isLess(key_type_ref L, key_type_ref R)
static bool isLess(key_type_ref LHS, key_type_ref RHS)
unsigned getHeight() const
static void Profile(FoldingSetNodeID &ID, value_type_ref X)
ImmutableMapRef & operator=(const ImmutableMapRef &X)
bool operator==(const iterator &RHS) const
ValInfo::value_type value_type
static void Profile(FoldingSetNodeID &ID, const ImmutableMap &M)
bool isEqual(const ImutAVLTree &RHS) const
TreeTy * getRootWithoutRetain() const
value_type * getMaxElement() const
Factory(BumpPtrAllocator &Alloc, bool canonicalize=true)
key_type_ref getKey() const
bool operator!=(const ImmutableMapRef &RHS) const
bool operator==(const iterator &RHS) const
static data_type_ref DataOfValue(value_type_ref V)
ValInfo::data_type_ref data_type_ref
static bool isEqual(key_type_ref L, key_type_ref R)
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
bool operator!=(const ImmutableMap &RHS) const