diff options
author | Kazu Hirata <kazu@google.com> | 2025-09-25 08:51:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-25 08:51:39 -0700 |
commit | fddb8fe5f2be4f31c643ee6ff6f017b01465b21d (patch) | |
tree | 395199365ae1a9cedf184627f5207c8e09610670 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 5953233edeb8af419b67116cefbeee8b15940cb9 (diff) | |
download | llvm-fddb8fe5f2be4f31c643ee6ff6f017b01465b21d.zip llvm-fddb8fe5f2be4f31c643ee6ff6f017b01465b21d.tar.gz llvm-fddb8fe5f2be4f31c643ee6ff6f017b01465b21d.tar.bz2 |
[ADT] Simplify SmallPtrSetIterator with std::reverse_iterator (NFC) (#160643)
SmallPtrSetIterator has two tasks:
- iterate the buckets in the requested direction
- skip the empty and tombstone buckets
These tasks are intertwined in the current implementation. This patch
separates them.
A new private iterator type, BucketItTy, now handles the iteration
direction. This is an alias for a raw pointer for forward iteration
and std::reverse_iterator<pointer> for reverse iteration.
The user-facing iterator now focuses solely on advancing BucketItTy
while skipping invalid (empty or tombstone) buckets. AdvanceIfNotValid
now works transparently for both directions. operator++ on BucketItTy
does the right thing whether it's a raw pointer or a
std::reverse_iterator.
This simplification removes RetreatIfNotValid and the
reverse-iteration logic in operator*() and operator++().
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions