LLVM 24.0.0git
llvm::ImutAVLFactory< ImutInfo, Canonicalize > Class Template Reference

#include "llvm/ADT/ImmutableSet.h"

Inheritance diagram for llvm::ImutAVLFactory< ImutInfo, Canonicalize >:
[legend]

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 (TreeTy *Result)
TreeTybalanceTree (TreeTy *L, value_type_ref V, TreeTy *R)
 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)

Static Protected Member Functions

static unsigned maskCacheIndex (unsigned I)

Friends

class ImutAVLTree< ImutInfo, Canonicalize >

Detailed Description

template<typename ImutInfo, bool Canonicalize>
class llvm::ImutAVLFactory< ImutInfo, Canonicalize >

Definition at line 401 of file ImmutableSet.h.

Constructor & Destructor Documentation

◆ ImutAVLFactory() [1/2]

template<typename ImutInfo, bool Canonicalize>
llvm::ImutAVLFactory< ImutInfo, Canonicalize >::ImutAVLFactory ( )
inline

Definition at line 427 of file ImmutableSet.h.

◆ ImutAVLFactory() [2/2]

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

Definition at line 430 of file ImmutableSet.h.

References llvm::Alloc.

◆ ~ImutAVLFactory()

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

Definition at line 433 of file ImmutableSet.h.

Member Function Documentation

◆ add()

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

Definition at line 437 of file ImmutableSet.h.

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

◆ add_internal()

template<typename ImutInfo, bool Canonicalize>
TreeTy * llvm::ImutAVLFactory< ImutInfo, Canonicalize >::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 567 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, bool Canonicalize>
TreeTy * llvm::ImutAVLFactory< ImutInfo, Canonicalize >::balanceTree ( TreeTy * L,
value_type_ref V,
TreeTy * R )
inlineprotected

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

Definition at line 523 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, bool Canonicalize>
TreeTy * llvm::ImutAVLFactory< ImutInfo, Canonicalize >::combineTrees ( TreeTy * L,
TreeTy * R )
inlineprotected

Definition at line 627 of file ImmutableSet.h.

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

Referenced by remove_internal().

◆ createNode() [1/2]

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

Definition at line 484 of file ImmutableSet.h.

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

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

◆ createNode() [2/2]

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

Definition at line 500 of file ImmutableSet.h.

References createNode(), and getValue().

◆ getCanonicalTree()

◆ getEmptyTree()

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

Definition at line 449 of file ImmutableSet.h.

◆ getHeight()

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

Definition at line 460 of file ImmutableSet.h.

References T.

Referenced by balanceTree(), and incrementHeight().

◆ getLeft()

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

Definition at line 461 of file ImmutableSet.h.

References T.

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

◆ getRight()

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

Definition at line 462 of file ImmutableSet.h.

References T.

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

◆ getValue()

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

Definition at line 463 of file ImmutableSet.h.

References T.

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

◆ incrementHeight()

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

Definition at line 468 of file ImmutableSet.h.

References getHeight().

Referenced by createNode().

◆ isEmpty()

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

Definition at line 459 of file ImmutableSet.h.

References T.

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

◆ maskCacheIndex()

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

Definition at line 466 of file ImmutableSet.h.

References I.

Referenced by getCanonicalTree().

◆ recoverNodes()

template<typename ImutInfo, bool Canonicalize>
void llvm::ImutAVLFactory< ImutInfo, Canonicalize >::recoverNodes ( TreeTy * Result)
inlineprotected

Definition at line 504 of file ImmutableSet.h.

References N, and llvm::reverse().

Referenced by add(), and remove().

◆ remove()

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

Definition at line 443 of file ImmutableSet.h.

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

◆ remove_internal()

template<typename ImutInfo, bool Canonicalize>
TreeTy * llvm::ImutAVLFactory< ImutInfo, Canonicalize >::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 602 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, bool Canonicalize>
TreeTy * llvm::ImutAVLFactory< ImutInfo, Canonicalize >::removeMinBinding ( TreeTy * T,
TreeTy *& Noderemoved )
inlineprotected

◆ ImutAVLTree< ImutInfo, Canonicalize >

template<typename ImutInfo, bool Canonicalize>
friend class ImutAVLTree< ImutInfo, Canonicalize >
friend

Definition at line 391 of file ImmutableSet.h.

References llvm::Tree.


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