[Scalar] Use SmallPtrSet directly instead of SmallSet (NFC) (#154473)

I'm trying to remove the redirection in SmallSet.h:

template <typename PointeeType, unsigned N>
class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N>
{};

to make it clear that we are using SmallPtrSet.  There are only
handful places that rely on this redirection.

This patch replaces SmallSet to SmallPtrSet where the element type is
a pointer.
This commit is contained in:
Kazu Hirata 2025-08-20 16:30:39 -07:00 committed by GitHub
parent 7be06dbd43
commit 9aae8ef329
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2218,7 +2218,7 @@ static void relocationViaAlloca(
/// vector. Doing so has the effect of changing the output of a couple of
/// tests in ways which make them less useful in testing fused safepoints.
template <typename T> static void unique_unsorted(SmallVectorImpl<T> &Vec) {
SmallSet<T, 8> Seen;
SmallPtrSet<T, 8> Seen;
erase_if(Vec, [&](const T &V) { return !Seen.insert(V).second; });
}