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 111 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 189 of file FoldingSet.cpp.
References Buckets, llvm::Intrinsic::memset, NumBuckets, and NumNodes.
Referenced by FoldingSetImpl().
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 291 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 >, llvm::FoldingSet< llvm::LoopDependenceAnalysis::DependencePair >, llvm::FoldingSet< llvm::DIEValue >, llvm::FoldingSet< llvm::SCEV >, llvm::FoldingSet< llvm::ImmutableListImpl >, llvm::FoldingSet< llvm::DIEAbbrev >, and llvm::FoldingSet< llvm::DIE >.
Definition at line 332 of file FoldingSet.cpp.
References E, FindNodeOrInsertPos(), GetNodeProfile(), and InsertNode().
Referenced by llvm::FoldingSet< llvm::DIE >::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 >, llvm::FoldingSet< llvm::LoopDependenceAnalysis::DependencePair >, llvm::FoldingSet< llvm::DIEValue >, llvm::FoldingSet< llvm::SCEV >, llvm::FoldingSet< llvm::ImmutableListImpl >, llvm::FoldingSet< llvm::DIEAbbrev >, and llvm::FoldingSet< llvm::DIE >.
Definition at line 235 of file FoldingSet.cpp.
References Buckets, llvm::FoldingSetNodeID::clear(), GetBucketFor(), GetNextPtr(), GetNodeProfile(), and NumBuckets.
Referenced by llvm::FoldingSet< llvm::DIE >::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 261 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 170 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 173 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 115 of file FoldingSet.h.
Referenced by llvm::FoldingSet< llvm::DIE >::begin(), llvm::FoldingSet< llvm::DIE >::bucket_begin(), llvm::FoldingSet< llvm::DIE >::bucket_end(), clear(), llvm::FoldingSet< llvm::DIE >::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 119 of file FoldingSet.h.
Referenced by llvm::FoldingSet< llvm::DIE >::bucket_begin(), llvm::FoldingSet< llvm::DIE >::bucket_end(), clear(), llvm::FoldingSet< llvm::DIE >::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 123 of file FoldingSet.h.
Referenced by clear(), empty(), InsertNode(), RemoveNode(), and size().