LLVM 22.0.0git
llvm::ImutAVLFactory< ImutInfo > Class Template Reference

#include "llvm/ADT/ImmutableSet.h"

Public Member Functions

 ImutAVLFactory ()
 ImutAVLFactory (BumpPtrAllocator &Alloc)
 ~ImutAVLFactory ()
TreeTyadd (TreeTy *T, value_type_ref V)
TreeTyremove (TreeTy *T, key_type_ref V)
TreeTygetEmptyTree () const
TreeTygetCanonicalTree (TreeTy *TNew)

Protected Member Functions

bool isEmpty (TreeTy *T) const
unsigned getHeight (TreeTy *T) const
TreeTygetLeft (TreeTy *T) const
TreeTygetRight (TreeTy *T) const
value_type_ref getValue (TreeTy *T) const
unsigned incrementHeight (TreeTy *L, TreeTy *R) const
TreeTycreateNode (TreeTy *L, value_type_ref V, TreeTy *R)
TreeTycreateNode (TreeTy *newLeft, TreeTy *oldTree, TreeTy *newRight)
void recoverNodes ()
TreeTybalanceTree (TreeTy *L, value_type_ref V, TreeTy *R)
 balanceTree - Used by add_internal and remove_internal to balance a newly created tree.
TreeTyadd_internal (value_type_ref V, TreeTy *T)
 add_internal - Creates a new tree that includes the specified data and the data from the original tree.
TreeTyremove_internal (key_type_ref K, TreeTy *T)
 remove_internal - Creates a new tree that includes all the data from the original tree except the specified data.
TreeTycombineTrees (TreeTy *L, TreeTy *R)
TreeTyremoveMinBinding (TreeTy *T, TreeTy *&Noderemoved)
void markImmutable (TreeTy *T)
 markImmutable - Clears the mutable bits of a root and all of its descendants.

Static Protected Member Functions

static unsigned maskCacheIndex (unsigned I)
static bool compareTreeWithSection (TreeTy *T, typename TreeTy::iterator &TI, typename TreeTy::iterator &TE)

Friends

class ImutAVLTree< ImutInfo >

Detailed Description

template<typename ImutInfo>
class llvm::ImutAVLFactory< ImutInfo >

Definition at line 363 of file ImmutableSet.h.

Constructor & Destructor Documentation

◆ ImutAVLFactory() [1/2]

template<typename ImutInfo>
llvm::ImutAVLFactory< ImutInfo >::ImutAVLFactory ( )
inline

Definition at line 389 of file ImmutableSet.h.

◆ ImutAVLFactory() [2/2]

template<typename ImutInfo>
llvm::ImutAVLFactory< ImutInfo >::ImutAVLFactory ( BumpPtrAllocator & Alloc)
inline

Definition at line 392 of file ImmutableSet.h.

References llvm::Alloc.

◆ ~ImutAVLFactory()

template<typename ImutInfo>
llvm::ImutAVLFactory< ImutInfo >::~ImutAVLFactory ( )
inline

Definition at line 395 of file ImmutableSet.h.

Member Function Documentation

◆ add()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::add ( TreeTy * T,
value_type_ref V )
inline

Definition at line 399 of file ImmutableSet.h.

References add_internal(), markImmutable(), recoverNodes(), and T.

◆ add_internal()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::add_internal ( value_type_ref V,
TreeTy * T )
inlineprotected

add_internal - Creates a new tree that includes the specified data and the data from the original tree.

If the original tree already contained the data item, the original tree is returned.

Definition at line 534 of file ImmutableSet.h.

References add_internal(), assert(), balanceTree(), createNode(), getLeft(), getRight(), getValue(), isEmpty(), and T.

Referenced by add(), and add_internal().

◆ balanceTree()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::balanceTree ( TreeTy * L,
value_type_ref V,
TreeTy * R )
inlineprotected

balanceTree - Used by add_internal and remove_internal to balance a newly created tree.

Definition at line 490 of file ImmutableSet.h.

References assert(), createNode(), getHeight(), getLeft(), getRight(), and isEmpty().

Referenced by add_internal(), combineTrees(), remove_internal(), and removeMinBinding().

◆ combineTrees()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::combineTrees ( TreeTy * L,
TreeTy * R )
inlineprotected

Definition at line 594 of file ImmutableSet.h.

References balanceTree(), getValue(), isEmpty(), and removeMinBinding().

Referenced by remove_internal().

◆ compareTreeWithSection()

template<typename ImutInfo>
bool llvm::ImutAVLFactory< ImutInfo >::compareTreeWithSection ( TreeTy * T,
typename TreeTy::iterator & TI,
typename TreeTy::iterator & TE )
inlinestaticprotected

Definition at line 438 of file ImmutableSet.h.

References E(), I, and T.

Referenced by getCanonicalTree().

◆ createNode() [1/2]

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::createNode ( TreeTy * L,
value_type_ref V,
TreeTy * R )
inlineprotected

Definition at line 459 of file ImmutableSet.h.

References A(), assert(), incrementHeight(), and T.

Referenced by add_internal(), balanceTree(), and createNode().

◆ createNode() [2/2]

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::createNode ( TreeTy * newLeft,
TreeTy * oldTree,
TreeTy * newRight )
inlineprotected

Definition at line 475 of file ImmutableSet.h.

References createNode(), and getValue().

◆ getCanonicalTree()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::getCanonicalTree ( TreeTy * TNew)
inline

◆ getEmptyTree()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::getEmptyTree ( ) const
inline

Definition at line 413 of file ImmutableSet.h.

◆ getHeight()

template<typename ImutInfo>
unsigned llvm::ImutAVLFactory< ImutInfo >::getHeight ( TreeTy * T) const
inlineprotected

Definition at line 424 of file ImmutableSet.h.

References T.

Referenced by balanceTree(), and incrementHeight().

◆ getLeft()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::getLeft ( TreeTy * T) const
inlineprotected

Definition at line 425 of file ImmutableSet.h.

References T.

Referenced by add_internal(), balanceTree(), markImmutable(), remove_internal(), and removeMinBinding().

◆ getRight()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::getRight ( TreeTy * T) const
inlineprotected

Definition at line 426 of file ImmutableSet.h.

References T.

Referenced by add_internal(), balanceTree(), markImmutable(), remove_internal(), and removeMinBinding().

◆ getValue()

template<typename ImutInfo>
value_type_ref llvm::ImutAVLFactory< ImutInfo >::getValue ( TreeTy * T) const
inlineprotected

Definition at line 427 of file ImmutableSet.h.

References T.

Referenced by add_internal(), combineTrees(), createNode(), remove_internal(), and removeMinBinding().

◆ incrementHeight()

template<typename ImutInfo>
unsigned llvm::ImutAVLFactory< ImutInfo >::incrementHeight ( TreeTy * L,
TreeTy * R ) const
inlineprotected

Definition at line 432 of file ImmutableSet.h.

References getHeight().

Referenced by createNode().

◆ isEmpty()

template<typename ImutInfo>
bool llvm::ImutAVLFactory< ImutInfo >::isEmpty ( TreeTy * T) const
inlineprotected

Definition at line 423 of file ImmutableSet.h.

References T.

Referenced by add_internal(), balanceTree(), combineTrees(), remove_internal(), and removeMinBinding().

◆ markImmutable()

template<typename ImutInfo>
void llvm::ImutAVLFactory< ImutInfo >::markImmutable ( TreeTy * T)
inlineprotected

markImmutable - Clears the mutable bits of a root and all of its descendants.

Definition at line 616 of file ImmutableSet.h.

References getLeft(), getRight(), markImmutable(), and T.

Referenced by add(), markImmutable(), and remove().

◆ maskCacheIndex()

template<typename ImutInfo>
unsigned llvm::ImutAVLFactory< ImutInfo >::maskCacheIndex ( unsigned I)
inlinestaticprotected

Definition at line 430 of file ImmutableSet.h.

References I.

Referenced by getCanonicalTree().

◆ recoverNodes()

template<typename ImutInfo>
void llvm::ImutAVLFactory< ImutInfo >::recoverNodes ( )
inlineprotected

Definition at line 479 of file ImmutableSet.h.

References N.

Referenced by add(), and remove().

◆ remove()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::remove ( TreeTy * T,
key_type_ref V )
inline

Definition at line 406 of file ImmutableSet.h.

References markImmutable(), recoverNodes(), remove_internal(), and T.

◆ remove_internal()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::remove_internal ( key_type_ref K,
TreeTy * T )
inlineprotected

remove_internal - Creates a new tree that includes all the data from the original tree except the specified data.

If the specified data did not exist in the original tree, the original tree is returned.

Definition at line 569 of file ImmutableSet.h.

References assert(), balanceTree(), combineTrees(), getLeft(), getRight(), getValue(), isEmpty(), remove_internal(), and T.

Referenced by remove(), and remove_internal().

◆ removeMinBinding()

template<typename ImutInfo>
TreeTy * llvm::ImutAVLFactory< ImutInfo >::removeMinBinding ( TreeTy * T,
TreeTy *& Noderemoved )
inlineprotected

◆ ImutAVLTree< ImutInfo >

template<typename ImutInfo>
friend class ImutAVLTree< ImutInfo >
friend

Definition at line 355 of file ImmutableSet.h.

References llvm::ImutAVLTree< ImutInfo >::release().


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