diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-04 21:11:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-04 21:11:17 +0000 |
commit | 5f12cda632d85d850758545b4430dd8667aade2d (patch) | |
tree | c6f145f1bcc7e58c24732155b47bd89e06966b7a /lib/Support | |
parent | 930a5ad6a52e36fa670e38d83e210a08ccde8d59 (diff) | |
download | external_llvm-5f12cda632d85d850758545b4430dd8667aade2d.zip external_llvm-5f12cda632d85d850758545b4430dd8667aade2d.tar.gz external_llvm-5f12cda632d85d850758545b4430dd8667aade2d.tar.bz2 |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/FoldingSet.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp index 1e8c732..774fbab 100644 --- a/lib/Support/FoldingSet.cpp +++ b/lib/Support/FoldingSet.cpp @@ -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; +} |