llvm::ImmutableSetRef

A factory-backed mutable view of an immutable set.

Synopsis

Declared in <llvm/ADT/ImmutableSet.h>

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

Description

Add and remove go through the associated factory without canonicalizing after each operation.

Type Aliases

NameDescription
FactoryTy The factory type used to allocate and update tree nodes.
TreeTy The underlying AVL tree type.
iterator Iterator yielding stored set elements in in-order.
value_type The type of a stored set element.
value_type_ref A reference to a stored set element.

Member Functions

NameDescription
ImmutableSetRef [constructor]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.
Profile Profiles this set for folding-set hashing.
add Returns a new set containing all elements of this set plus V.
asImmutableSet Converts this mutable view to an ImmutableSet, canonicalizing the root when Canonicalize is true.
begin Returns an iterator to the first element in in-order traversal.
contains Returns true if the set contains the specified value.
end Returns the end iterator for in-order traversal.
getHeight Returns the height of the AVL tree (0 if empty).
getRootWithoutRetain Returns the tree root without changing its reference count.
isEmpty Return true if the set contains no elements.
isSingleton Return true if the set contains exactly one element. This method runs in constant time.
remove Returns a new set containing all elements of this set except V.
validateTree Checks that the AVL balancing and ordering invariants hold for this set.
operator== Compares two sets for structural equality (contents, not pointer identity).
operator!= Compares two sets for structural inequality.

Static Member Functions

NameDescription
Profile Profiles S for folding-set hashing (hashes the root pointer).
getEmptySet Returns an empty set reference backed by factory F.