LLVM 24.0.0git
llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize > Class Template Reference

#include "llvm/ADT/ImmutableSet.h"

Public Types

using value_type = typename ValInfo::value_type
using value_type_ref = typename ValInfo::value_type_ref
using TreeTy = ImutAVLTree<ValInfo, Canonicalize>
using FactoryTy = typename TreeTy::Factory
using iterator = ImutAVLValueIterator<ImmutableSetRef>

Public Member Functions

 ImmutableSetRef (TreeTy *R, FactoryTy *F)
 Constructs a set from a pointer to a tree root.
ImmutableSetRef add (value_type_ref V)
ImmutableSetRef remove (value_type_ref V)
bool contains (value_type_ref V) const
 Returns true if the set contains the specified value.
ImmutableSet< ValT, ValInfo, Canonicalize > asImmutableSet () const
TreeTygetRootWithoutRetain () const
bool operator== (const ImmutableSetRef &RHS) const
bool operator!= (const ImmutableSetRef &RHS) const
bool isEmpty () const
 Return true if the set contains no elements.
bool isSingleton () const
 Return true if the set contains exactly one element.
iterator begin () const
iterator end () const
unsigned getHeight () const
void Profile (FoldingSetNodeID &ID) const
void validateTree () const

Static Public Member Functions

static ImmutableSetRef getEmptySet (FactoryTy *F)
static void Profile (FoldingSetNodeID &ID, const ImmutableSetRef &S)

Detailed Description

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
class llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >

Definition at line 1091 of file ImmutableSet.h.

Member Typedef Documentation

◆ FactoryTy

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
using llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::FactoryTy = typename TreeTy::Factory

Definition at line 1096 of file ImmutableSet.h.

◆ iterator

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
using llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::iterator = ImutAVLValueIterator<ImmutableSetRef>

Definition at line 1156 of file ImmutableSet.h.

◆ TreeTy

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
using llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::TreeTy = ImutAVLTree<ValInfo, Canonicalize>

Definition at line 1095 of file ImmutableSet.h.

◆ value_type

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
using llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::value_type = typename ValInfo::value_type

Definition at line 1093 of file ImmutableSet.h.

◆ value_type_ref

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
using llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::value_type_ref = typename ValInfo::value_type_ref

Definition at line 1094 of file ImmutableSet.h.

Constructor & Destructor Documentation

◆ ImmutableSetRef()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::ImmutableSetRef ( TreeTy * R,
FactoryTy * F )
inline

Constructs a set from a pointer to a tree root.

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

Definition at line 1107 of file ImmutableSet.h.

References F.

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

Member Function Documentation

◆ add()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
ImmutableSetRef llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::add ( value_type_ref V)
inline

Definition at line 1113 of file ImmutableSet.h.

References ImmutableSetRef().

◆ asImmutableSet()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
ImmutableSet< ValT, ValInfo, Canonicalize > llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::asImmutableSet ( ) const
inline

Definition at line 1126 of file ImmutableSet.h.

◆ begin()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
iterator llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::begin ( ) const
inline

Definition at line 1158 of file ImmutableSet.h.

◆ contains()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
bool llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::contains ( value_type_ref V) const
inline

Returns true if the set contains the specified value.

Definition at line 1122 of file ImmutableSet.h.

◆ end()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
iterator llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::end ( ) const
inline

Definition at line 1159 of file ImmutableSet.h.

◆ getEmptySet()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
ImmutableSetRef llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::getEmptySet ( FactoryTy * F)
inlinestatic

Definition at line 1109 of file ImmutableSet.h.

References F, and ImmutableSetRef().

◆ getHeight()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
unsigned llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::getHeight ( ) const
inline

Definition at line 1165 of file ImmutableSet.h.

Referenced by isSingleton().

◆ getRootWithoutRetain()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
TreeTy * llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::getRootWithoutRetain ( ) const
inline

Definition at line 1134 of file ImmutableSet.h.

◆ isEmpty()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
bool llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::isEmpty ( ) const
inline

Return true if the set contains no elements.

Definition at line 1146 of file ImmutableSet.h.

◆ isSingleton()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
bool llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::isSingleton ( ) const
inline

Return true if the set contains exactly one element.

This method runs in constant time.

Definition at line 1150 of file ImmutableSet.h.

References getHeight().

◆ operator!=()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
bool llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::operator!= ( const ImmutableSetRef< ValT, ValInfo, Canonicalize > & RHS) const
inline

Definition at line 1140 of file ImmutableSet.h.

References ImmutableSetRef(), and RHS.

◆ operator==()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
bool llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::operator== ( const ImmutableSetRef< ValT, ValInfo, Canonicalize > & RHS) const
inline

Definition at line 1136 of file ImmutableSet.h.

References ImmutableSetRef(), and RHS.

◆ Profile() [1/2]

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
void llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::Profile ( FoldingSetNodeID & ID) const
inline

Definition at line 1171 of file ImmutableSet.h.

References Profile().

Referenced by Profile().

◆ Profile() [2/2]

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
void llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::Profile ( FoldingSetNodeID & ID,
const ImmutableSetRef< ValT, ValInfo, Canonicalize > & S )
inlinestatic

Definition at line 1167 of file ImmutableSet.h.

References ImmutableSetRef().

◆ remove()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
ImmutableSetRef llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::remove ( value_type_ref V)
inline

Definition at line 1117 of file ImmutableSet.h.

References ImmutableSetRef().

◆ validateTree()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
void llvm::ImmutableSetRef< ValT, ValInfo, Canonicalize >::validateTree ( ) const
inline

Definition at line 1177 of file ImmutableSet.h.


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