Added "bucket_iterators" to FoldingSet. Bucket iterators allow iteration

over all the nodes in a particular bucket.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek
2008-02-04 21:11:17 +00:00
parent a1e4bba98a
commit 26e3c445fc
2 changed files with 69 additions and 1 deletions
+7 -1
View File
@@ -148,7 +148,7 @@ static FoldingSetImpl::Node *GetNextPtr(void *NextInBucketPtr) {
return static_cast<FoldingSetImpl::Node*>(NextInBucketPtr);
}
/// GetBucketPtr - Provides a casting of a bucket pointer for isNode
/// testing.
static void **GetBucketPtr(void *NextInBucketPtr) {
intptr_t Ptr = reinterpret_cast<intptr_t>(NextInBucketPtr);
@@ -358,3 +358,9 @@ void FoldingSetIteratorImpl::advance() {
}
}
//===----------------------------------------------------------------------===//
// FoldingSetBucketIteratorImpl Implementation
FoldingSetBucketIteratorImpl::FoldingSetBucketIteratorImpl(void **Bucket) {
Ptr = (*Bucket == 0 || GetNextPtr(*Bucket) == 0) ? (void*) Bucket : *Bucket;
}