LLVM 24.0.0git
llvm::ImmutableMapRef< KeyT, ValT, ValInfo > Class Template Reference

#include "llvm/ADT/ImmutableMap.h"

Classes

class  iterator

Public Types

using value_type = typename ValInfo::value_type
using value_type_ref = typename ValInfo::value_type_ref
using key_type = typename ValInfo::key_type
using key_type_ref = typename ValInfo::key_type_ref
using data_type = typename ValInfo::data_type
using data_type_ref = typename ValInfo::data_type_ref
using TreeTy = ImutAVLTree<ValInfo>
using FactoryTy = typename TreeTy::Factory

Public Member Functions

 ImmutableMapRef (const TreeTy *R, FactoryTy *F)
 Constructs a map from a pointer to a tree root.
 ImmutableMapRef (const ImmutableMap< KeyT, ValT > &X, typename ImmutableMap< KeyT, ValT >::Factory &F)
void manualRetain ()
void manualRelease ()
ImmutableMapRef add (key_type_ref K, data_type_ref D) const
ImmutableMapRef remove (key_type_ref K) const
template<typename PredFn>
ImmutableMapRef filter (PredFn Pred) const
 Returns this map without the entries for which Pred is false (see ImutAVLFactory::filterTree).
bool contains (key_type_ref K) const
ImmutableMap< KeyT, ValT > asImmutableMap () const
bool operator== (const ImmutableMapRef &RHS) const
bool operator!= (const ImmutableMapRef &RHS) const
bool isEmpty () const
void verify () const
iterator begin () const
iterator end () const
data_type * lookup (key_type_ref K) const
value_type * getMaxElement () const
 Returns the <key,value> pair in the ImmutableMap for which key is the highest in the ordering of keys in the map.
unsigned getHeight () const
void Profile (FoldingSetNodeID &ID) const

Static Public Member Functions

static ImmutableMapRef getEmptyMap (FactoryTy *F)
static void Profile (FoldingSetNodeID &ID, const ImmutableMapRef &M)

Protected Attributes

IntrusiveRefCntPtr< TreeTy > Root
FactoryTy * Factory

Detailed Description

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
class llvm::ImmutableMapRef< KeyT, ValT, ValInfo >

Definition at line 254 of file ImmutableMap.h.

Member Typedef Documentation

◆ data_type

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::data_type = typename ValInfo::data_type

Definition at line 260 of file ImmutableMap.h.

◆ data_type_ref

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::data_type_ref = typename ValInfo::data_type_ref

Definition at line 261 of file ImmutableMap.h.

◆ FactoryTy

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::FactoryTy = typename TreeTy::Factory

Definition at line 263 of file ImmutableMap.h.

◆ key_type

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::key_type = typename ValInfo::key_type

Definition at line 258 of file ImmutableMap.h.

◆ key_type_ref

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::key_type_ref = typename ValInfo::key_type_ref

Definition at line 259 of file ImmutableMap.h.

◆ TreeTy

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::TreeTy = ImutAVLTree<ValInfo>

Definition at line 262 of file ImmutableMap.h.

◆ value_type

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::value_type = typename ValInfo::value_type

Definition at line 256 of file ImmutableMap.h.

◆ value_type_ref

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::value_type_ref = typename ValInfo::value_type_ref

Definition at line 257 of file ImmutableMap.h.

Constructor & Destructor Documentation

◆ ImmutableMapRef() [1/2]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::ImmutableMapRef ( const TreeTy * R,
FactoryTy * F )
inline

Constructs a map from a pointer to a tree root.

In general one should use a Factory object to create maps instead of directly invoking the constructor, but there are cases where make this constructor public is useful.

Definition at line 274 of file ImmutableMap.h.

References F, Factory, and Root.

Referenced by add(), filter(), getEmptyMap(), operator!=(), operator==(), Profile(), and remove().

◆ ImmutableMapRef() [2/2]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::ImmutableMapRef ( const ImmutableMap< KeyT, ValT > & X,
typename ImmutableMap< KeyT, ValT >::Factory & F )
inline

Definition at line 277 of file ImmutableMap.h.

References F, Factory, Root, and X.

Member Function Documentation

◆ add()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
ImmutableMapRef llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::add ( key_type_ref K,
data_type_ref D ) const
inline

Definition at line 293 of file ImmutableMap.h.

References D(), Factory, ImmutableMapRef(), and Root.

◆ asImmutableMap()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
ImmutableMap< KeyT, ValT > llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::asImmutableMap ( ) const
inline

Definition at line 314 of file ImmutableMap.h.

References Factory, and Root.

◆ begin()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
iterator llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::begin ( ) const
inlinenodiscard

Definition at line 353 of file ImmutableMap.h.

References Root.

◆ contains()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::contains ( key_type_ref K) const
inlinenodiscard

Definition at line 310 of file ImmutableMap.h.

References Root.

◆ end()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
iterator llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::end ( ) const
inlinenodiscard

Definition at line 354 of file ImmutableMap.h.

◆ filter()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
template<typename PredFn>
ImmutableMapRef llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::filter ( PredFn Pred) const
inline

Returns this map without the entries for which Pred is false (see ImutAVLFactory::filterTree).

Definition at line 306 of file ImmutableMap.h.

References Factory, ImmutableMapRef(), Pred, and Root.

◆ getEmptyMap()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
ImmutableMapRef llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getEmptyMap ( FactoryTy * F)
inlinestatic

Definition at line 281 of file ImmutableMap.h.

References F, and ImmutableMapRef().

◆ getHeight()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
unsigned llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getHeight ( ) const
inlinenodiscard

Definition at line 376 of file ImmutableMap.h.

References Root.

◆ getMaxElement()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
value_type * llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::getMaxElement ( ) const
inlinenodiscard

Returns the <key,value> pair in the ImmutableMap for which key is the highest in the ordering of keys in the map.

This method returns NULL if the map is empty.

Definition at line 368 of file ImmutableMap.h.

References getValue(), and Root.

◆ isEmpty()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::isEmpty ( ) const
inlinenodiscard

Definition at line 327 of file ImmutableMap.h.

References Root.

◆ lookup()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
data_type * llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::lookup ( key_type_ref K) const
inlinenodiscard

Definition at line 356 of file ImmutableMap.h.

References Root, and T.

◆ manualRelease()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::manualRelease ( )
inline

Definition at line 289 of file ImmutableMap.h.

References Root.

◆ manualRetain()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::manualRetain ( )
inline

Definition at line 285 of file ImmutableMap.h.

References Root.

◆ operator!=()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator!= ( const ImmutableMapRef< KeyT, ValT, ValInfo > & RHS) const
inlinenodiscard

Definition at line 322 of file ImmutableMap.h.

References ImmutableMapRef(), RHS, and Root.

◆ operator==()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::operator== ( const ImmutableMapRef< KeyT, ValT, ValInfo > & RHS) const
inlinenodiscard

Definition at line 318 of file ImmutableMap.h.

References ImmutableMapRef(), RHS, and Root.

◆ Profile() [1/2]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::Profile ( FoldingSetNodeID & ID) const
inline

Definition at line 384 of file ImmutableMap.h.

References Profile().

Referenced by Profile().

◆ Profile() [2/2]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::Profile ( FoldingSetNodeID & ID,
const ImmutableMapRef< KeyT, ValT, ValInfo > & M )
inlinestatic

Definition at line 380 of file ImmutableMap.h.

References ImmutableMapRef().

◆ remove()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
ImmutableMapRef llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::remove ( key_type_ref K) const
inline

Definition at line 299 of file ImmutableMap.h.

References Factory, ImmutableMapRef(), and Root.

◆ verify()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::verify ( ) const
inline

Definition at line 333 of file ImmutableMap.h.

References Root.

Member Data Documentation

◆ Factory

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
FactoryTy* llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::Factory
protected

Definition at line 267 of file ImmutableMap.h.

Referenced by add(), asImmutableMap(), filter(), ImmutableMapRef(), ImmutableMapRef(), and remove().

◆ Root

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
IntrusiveRefCntPtr<TreeTy> llvm::ImmutableMapRef< KeyT, ValT, ValInfo >::Root
protected

The documentation for this class was generated from the following file: