LLVM API Documentation
#include <FoldingSet.h>


Public Member Functions | |
| FoldingSetImpl (unsigned Log2InitSize=6) | |
| virtual | ~FoldingSetImpl () |
| void | clear () |
| clear - Remove all nodes from the folding set. | |
| bool | RemoveNode (Node *N) |
| Node * | GetOrInsertNode (Node *N) |
| Node * | FindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos) |
| void | InsertNode (Node *N, void *InsertPos) |
| unsigned | size () const |
| size - Returns the number of nodes in the folding set. | |
| bool | empty () const |
| empty - Returns true if there are no nodes in the folding set. | |
Protected Member Functions | |
| virtual void | GetNodeProfile (FoldingSetNodeID &ID, Node *N) const =0 |
Protected Attributes | |
| void ** | Buckets |
| unsigned | NumBuckets |
| unsigned | NumNodes |
Classes | |
| class | Node |
Definition at line 110 of file FoldingSet.h.
| FoldingSetImpl::FoldingSetImpl | ( | unsigned | Log2InitSize = 6 |
) | [explicit] |
| FoldingSetImpl::~FoldingSetImpl | ( | ) | [virtual] |
| void FoldingSetImpl::clear | ( | ) |
clear - Remove all nodes from the folding set.
Definition at line 223 of file FoldingSet.cpp.
References Buckets, NumBuckets, and NumNodes.
Referenced by FoldingSetImpl().
| bool FoldingSetImpl::RemoveNode | ( | Node * | N | ) |
RemoveNode - Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.
RemoveNode - Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.
Definition at line 325 of file FoldingSet.cpp.
References GetBucketPtr(), llvm::FoldingSetImpl::Node::getNextInBucket(), GetNextPtr(), NumNodes, and llvm::FoldingSetImpl::Node::SetNextInBucket().
| FoldingSetImpl::Node * FoldingSetImpl::GetOrInsertNode | ( | FoldingSetImpl::Node * | N | ) |
GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. Otherwise, insert 'N' and return it instead.
GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. Otherwise, insert 'N' and it instead.
Reimplemented in llvm::FoldingSet< T >, llvm::FoldingSet< llvm::ImutAVLTree >, llvm::FoldingSet< llvm::SDNode >, and llvm::FoldingSet< llvm::ImmutableListImpl >.
Definition at line 366 of file FoldingSet.cpp.
References E, FindNodeOrInsertPos(), GetNodeProfile(), and InsertNode().
Referenced by llvm::FoldingSet< llvm::ImmutableListImpl >::GetOrInsertNode().
| FoldingSetImpl::Node * FoldingSetImpl::FindNodeOrInsertPos | ( | const FoldingSetNodeID & | ID, | |
| void *& | InsertPos | |||
| ) |
FindNodeOrInsertPos - Look up the node specified by ID. If it exists, return it. If not, return the insertion token that will make insertion faster.
FindNodeOrInsertPos - Look up the node specified by ID. If it exists, return it. If not, return the insertion token that will make insertion faster.
Reimplemented in llvm::FoldingSet< T >, llvm::FoldingSet< llvm::ImutAVLTree >, llvm::FoldingSet< llvm::SDNode >, and llvm::FoldingSet< llvm::ImmutableListImpl >.
Definition at line 269 of file FoldingSet.cpp.
References Buckets, llvm::FoldingSetNodeID::clear(), GetBucketFor(), GetNextPtr(), GetNodeProfile(), and NumBuckets.
Referenced by llvm::FoldingSet< llvm::ImmutableListImpl >::FindNodeOrInsertPos(), and GetOrInsertNode().
| void FoldingSetImpl::InsertNode | ( | Node * | N, | |
| void * | InsertPos | |||
| ) |
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the folding set. InsertPos must be obtained from FindNodeOrInsertPos.
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the map. InsertPos must be obtained from FindNodeOrInsertPos.
The insert position is actually a bucket pointer.
Definition at line 295 of file FoldingSet.cpp.
References Buckets, GetBucketFor(), llvm::FoldingSetImpl::Node::getNextInBucket(), GetNodeProfile(), Next, NumBuckets, NumNodes, and llvm::FoldingSetImpl::Node::SetNextInBucket().
Referenced by GetOrInsertNode().
| unsigned llvm::FoldingSetImpl::size | ( | ) | const [inline] |
size - Returns the number of nodes in the folding set.
Definition at line 169 of file FoldingSet.h.
References NumNodes.
| bool llvm::FoldingSetImpl::empty | ( | ) | const [inline] |
empty - Returns true if there are no nodes in the folding set.
Definition at line 172 of file FoldingSet.h.
References NumNodes.
| virtual void llvm::FoldingSetImpl::GetNodeProfile | ( | FoldingSetNodeID & | ID, | |
| Node * | N | |||
| ) | const [protected, pure virtual] |
GetNodeProfile - Instantiations of the FoldingSet template implement this function to gather data bits for the given node.
Referenced by FindNodeOrInsertPos(), GetOrInsertNode(), and InsertNode().
void** llvm::FoldingSetImpl::Buckets [protected] |
Buckets - Array of bucket chains.
Definition at line 114 of file FoldingSet.h.
Referenced by llvm::FoldingSet< llvm::ImmutableListImpl >::begin(), llvm::FoldingSet< llvm::ImmutableListImpl >::bucket_begin(), llvm::FoldingSet< llvm::ImmutableListImpl >::bucket_end(), clear(), llvm::FoldingSet< llvm::ImmutableListImpl >::end(), FindNodeOrInsertPos(), FoldingSetImpl(), InsertNode(), and ~FoldingSetImpl().
unsigned llvm::FoldingSetImpl::NumBuckets [protected] |
NumBuckets - Length of the Buckets array. Always a power of 2.
Definition at line 118 of file FoldingSet.h.
Referenced by llvm::FoldingSet< llvm::ImmutableListImpl >::bucket_begin(), llvm::FoldingSet< llvm::ImmutableListImpl >::bucket_end(), clear(), llvm::FoldingSet< llvm::ImmutableListImpl >::end(), FindNodeOrInsertPos(), FoldingSetImpl(), and InsertNode().
unsigned llvm::FoldingSetImpl::NumNodes [protected] |
NumNodes - Number of nodes in the folding set. Growth occurs when NumNodes is greater than twice the number of buckets.
Definition at line 122 of file FoldingSet.h.
Referenced by clear(), empty(), InsertNode(), RemoveNode(), and size().
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.