|
LLVM 24.0.0git
|
A uniquing set that compares nodes against a typed key rather than a serialized FoldingSetNodeID. More...
#include "llvm/ADT/FoldingSet.h"
Public Types | |
| using | KeyTy = typename Info::KeyTy |
| using | iterator = FoldingSetIterator<T> |
| using | const_iterator = FoldingSetIterator<const T> |
Public Member Functions | |
| UniquingSet (unsigned Log2InitSize=6) | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| T * | lookup (const KeyTy &Key, FoldingSetInsertToken &Token) |
Look up Key. | |
| void | insert (T *N, FoldingSetInsertToken Token) |
Insert N, which must key identically to the lookup that produced Token. | |
| bool | erase (T *N) |
Remove N, returning whether it was present. | |
| Public Member Functions inherited from llvm::FoldingSetBase | |
| LLVM_ABI void | clear () |
| Remove all nodes from the folding set. | |
| unsigned | size () const |
| Returns the number of nodes in the folding set. | |
| bool | empty () const |
| Returns true if there are no nodes in the folding set. | |
| LLVM_ABI void | reserve (unsigned N) |
Grow the number of buckets so that we can hold at least N nodes before rebucketing. | |
| Public Member Functions inherited from llvm::DebugEpochBase | |
| void | incrementEpoch () |
Additional Inherited Members | |
| Protected Member Functions inherited from llvm::FoldingSetBase | |
| LLVM_ABI | FoldingSetBase (unsigned Log2InitSize) |
| LLVM_ABI | FoldingSetBase (FoldingSetBase &&Arg) |
| LLVM_ABI FoldingSetBase & | operator= (FoldingSetBase &&RHS) |
| LLVM_ABI | ~FoldingSetBase () |
| LLVM_ABI bool | erase (Node *N) |
| Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set. | |
| template<typename MatchFn> | |
| Node * | probe (uint32_t Hash, FoldingSetInsertToken &Token, MatchFn IsMatch) |
Walk the probe chain for Hash, offering each node whose cached hash matches to IsMatch. | |
| LLVM_ABI void | insert (Node *N, FoldingSetInsertToken Token) |
| Insert the specified node into the folding set, knowing that it is not already in the folding set. | |
| Static Protected Member Functions inherited from llvm::FoldingSetBase | |
| static FoldingSetInsertToken | makeInsertToken (uint32_t Hash) |
Wrap Hash, which must not be NotAHash, as the token insert takes. | |
| Protected Attributes inherited from llvm::FoldingSetBase | |
| void ** | Buckets = nullptr |
| Array of node pointers; a null entry marks an empty slot. | |
| unsigned | NumBuckets = 0 |
| Length of the Buckets array. Always a power of 2. | |
| unsigned | NumNodes = 0 |
| Number of nodes in the folding set. | |
A uniquing set that compares nodes against a typed key rather than a serialized FoldingSetNodeID.
T must derive from FoldingSetNode and provide a getKey() whose result is comparable with == and for which DenseMapInfo<KeyTy>::getHashValue exists. Info overrides that:
Derive Info from UniquingSetInfo<T> to override only the hash. The default Info needs T complete wherever UniquingSet<T> is instantiated; FoldingSet does not. A key may alias storage owned by the node; it is only used within a single lookup().
Prefer FoldingSet when a key cannot be read cheaply out of a node: a FoldingSetNodeID cannot disagree with itself, whereas getKey and the code that builds a key to look up must be kept in step by hand.
Definition at line 723 of file FoldingSet.h.
| using llvm::UniquingSet< T, Info >::const_iterator = FoldingSetIterator<const T> |
Definition at line 736 of file FoldingSet.h.
| using llvm::UniquingSet< T, Info >::iterator = FoldingSetIterator<T> |
Definition at line 730 of file FoldingSet.h.
| using llvm::UniquingSet< T, Info >::KeyTy = typename Info::KeyTy |
Definition at line 725 of file FoldingSet.h.
|
inlineexplicit |
Definition at line 727 of file FoldingSet.h.
References llvm::FoldingSetBase::FoldingSetBase().
|
inline |
Definition at line 731 of file FoldingSet.h.
References llvm::FoldingSetBase::Buckets, and llvm::FoldingSetBase::NumBuckets.
|
inline |
Definition at line 737 of file FoldingSet.h.
References llvm::FoldingSetBase::Buckets, and llvm::FoldingSetBase::NumBuckets.
|
inline |
Definition at line 732 of file FoldingSet.h.
References llvm::FoldingSetBase::Buckets, and llvm::FoldingSetBase::NumBuckets.
|
inline |
Definition at line 740 of file FoldingSet.h.
References llvm::FoldingSetBase::Buckets, and llvm::FoldingSetBase::NumBuckets.
|
inline |
Remove N, returning whether it was present.
Definition at line 762 of file FoldingSet.h.
References llvm::FoldingSetBase::erase(), N, and T.
|
inline |
Insert N, which must key identically to the lookup that produced Token.
Definition at line 754 of file FoldingSet.h.
References assert(), llvm::FoldingSetBase::insert(), llvm::FoldingSetBase::makeInsertToken(), N, and T.
Referenced by llvm::BinOpInit::get(), llvm::ListInit::get(), llvm::TernOpInit::get(), and llvm::UnOpInit::get().
|
inline |
Look up Key.
On a hit Token is cleared; on a miss it receives a token for insert().
Definition at line 746 of file FoldingSet.h.
References llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, N, llvm::FoldingSetBase::probe(), and T.
Referenced by llvm::BinOpInit::get(), llvm::ListInit::get(), llvm::TernOpInit::get(), and llvm::UnOpInit::get().