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

#include "llvm/ADT/ImmutableSet.h"

Classes

class  Factory

Public Types

using value_type = typename ValInfo::value_type
using value_type_ref = typename ValInfo::value_type_ref
using TreeTy = ImutAVLTree<ValInfo, Canonicalize>
using iterator = ImutAVLValueIterator<ImmutableSet>

Public Member Functions

 ImmutableSet (TreeTy *R)
 Constructs a set from a pointer to a tree root.
bool contains (value_type_ref V) const
 Returns true if the set contains the specified value.
bool operator== (const ImmutableSet &RHS) const
 Compares two sets for equality.
bool operator!= (const ImmutableSet &RHS) const
TreeTygetRoot ()
TreeTygetRootWithoutRetain () 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 void Profile (FoldingSetNodeID &ID, const ImmutableSet &S)

Friends

class Factory

Detailed Description

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

Definition at line 950 of file ImmutableSet.h.

Member Typedef Documentation

◆ iterator

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

Definition at line 1064 of file ImmutableSet.h.

◆ TreeTy

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

Definition at line 954 of file ImmutableSet.h.

◆ value_type

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

Definition at line 952 of file ImmutableSet.h.

◆ value_type_ref

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

Definition at line 953 of file ImmutableSet.h.

Constructor & Destructor Documentation

◆ ImmutableSet()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
llvm::ImmutableSet< ValT, ValInfo, Canonicalize >::ImmutableSet ( TreeTy * R)
inlineexplicit

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 964 of file ImmutableSet.h.

Referenced by llvm::ImmutableSet< ValT, ValInfo, Canonicalize >::Factory::add(), llvm::ImmutableSet< ValT, ValInfo, Canonicalize >::Factory::getEmptySet(), operator!=(), operator==(), Profile(), and llvm::ImmutableSet< ValT, ValInfo, Canonicalize >::Factory::remove().

Member Function Documentation

◆ begin()

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

Definition at line 1066 of file ImmutableSet.h.

◆ contains()

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

Returns true if the set contains the specified value.

Definition at line 1022 of file ImmutableSet.h.

◆ end()

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

Definition at line 1067 of file ImmutableSet.h.

◆ getHeight()

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

Definition at line 1073 of file ImmutableSet.h.

Referenced by isSingleton().

◆ getRoot()

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
TreeTy * llvm::ImmutableSet< ValT, ValInfo, Canonicalize >::getRoot ( )
inline

Definition at line 1046 of file ImmutableSet.h.

◆ getRootWithoutRetain()

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

Definition at line 1051 of file ImmutableSet.h.

◆ isEmpty()

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

Return true if the set contains no elements.

Definition at line 1054 of file ImmutableSet.h.

◆ isSingleton()

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

Return true if the set contains exactly one element.

This method runs in constant time.

Definition at line 1058 of file ImmutableSet.h.

References getHeight().

◆ operator!=()

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

Definition at line 1038 of file ImmutableSet.h.

References ImmutableSet(), and RHS.

◆ operator==()

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

Compares two sets for equality.

For a canonicalizing factory, sets with equal contents share the same tree, so this is an O(1) pointer comparison (like ImmutableList); only sets created by the same factory may be compared. Otherwise it is a structural comparison.

Definition at line 1030 of file ImmutableSet.h.

References ImmutableSet(), and RHS.

◆ Profile() [1/2]

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

Definition at line 1079 of file ImmutableSet.h.

References Profile().

Referenced by Profile().

◆ Profile() [2/2]

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

Definition at line 1075 of file ImmutableSet.h.

References ImmutableSet().

◆ validateTree()

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

Definition at line 1085 of file ImmutableSet.h.

◆ Factory

template<typename ValT, typename ValInfo = ImutContainerInfo<ValT>, bool Canonicalize = true>
friend class Factory
friend

Definition at line 1019 of file ImmutableSet.h.


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