LLVM 24.0.0git
llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory Class Reference

#include "llvm/ADT/ImmutableMap.h"

Public Member Functions

 Factory ()=default
 Factory (BumpPtrAllocator &Alloc)
 Factory (const Factory &)=delete
Factoryoperator= (const Factory &)=delete
ImmutableMap getEmptyMap ()
ImmutableMap add (ImmutableMap Old, key_type_ref K, data_type_ref D)
template<typename CombineFn>
ImmutableMap mergeWith (ImmutableMap A, ImmutableMap B, CombineFn Combine, bool KeepUnmatched, bool SkipShared=false)
 Merges A and B in a single traversal (see ImutAVLFactory::mergeTrees), sharing subtrees the two maps do not overlap.
ImmutableMap remove (ImmutableMap Old, key_type_ref K)
TreeTy::FactorygetTreeFactory () const

Detailed Description

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
class llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory

Definition at line 84 of file ImmutableMap.h.

Constructor & Destructor Documentation

◆ Factory() [1/3]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::Factory ( )
default

Referenced by Factory(), and operator=().

◆ Factory() [2/3]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::Factory ( BumpPtrAllocator & Alloc)
inline

Definition at line 90 of file ImmutableMap.h.

References llvm::Alloc.

◆ Factory() [3/3]

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::Factory ( const Factory & )
delete

References Factory().

Member Function Documentation

◆ add()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
ImmutableMap llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::add ( ImmutableMap Old,
key_type_ref K,
data_type_ref D )
inlinenodiscard

◆ getEmptyMap()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
ImmutableMap llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::getEmptyMap ( )
inline

◆ getTreeFactory()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
TreeTy::Factory * llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::getTreeFactory ( ) const
inline

Definition at line 135 of file ImmutableMap.h.

◆ mergeWith()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
template<typename CombineFn>
ImmutableMap llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::mergeWith ( ImmutableMap A,
ImmutableMap B,
CombineFn Combine,
bool KeepUnmatched,
bool SkipShared = false )
inlinenodiscard

Merges A and B in a single traversal (see ImutAVLFactory::mergeTrees), sharing subtrees the two maps do not overlap.

Combine(AElem, BElem) yields the stored element for a key; KeepUnmatched governs keys unique to one side. SkipShared returns a pointer-identical subtree unchanged in O(1); only pass true when the merge is idempotent (Combine(a, a) == a, e.g. a lattice join). This is more efficient than repeatedly adding B's entries to A when B is large. Only valid for non-canonicalizing factories (the bulk path does not canonicalize the nodes it creates). Does not short-circuit equal/empty operands or reorder by size; callers wanting those apply them first.

Definition at line 118 of file ImmutableMap.h.

References A(), B(), Combine, and llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::ImmutableMap().

◆ operator=()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
Factory & llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::operator= ( const Factory & )
delete

References Factory().

◆ remove()

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT, ValT>, bool Canonicalize = true>
ImmutableMap llvm::ImmutableMap< KeyT, ValT, ValInfo, Canonicalize >::Factory::remove ( ImmutableMap Old,
key_type_ref K )
inlinenodiscard

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