[clang-tidy] Use SmallPtrSet directly instead of SmallSet (NFC) (#154679)

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-21 15:03:16 -07:00 committed by GitHub
parent f5f6613af6
commit ec07d8e941
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1575,6 +1575,10 @@ template <typename T, std::size_t N = SmallDataStructureSize>
using ParamToSmallSetMap =
llvm::DenseMap<const ParmVarDecl *, llvm::SmallSet<T, N>>;
template <typename T, std::size_t N = SmallDataStructureSize>
using ParamToSmallPtrSetMap =
llvm::DenseMap<const ParmVarDecl *, llvm::SmallPtrSet<T, N>>;
/// Returns whether the sets mapped to the two elements in the map have at
/// least one element in common.
template <typename MapTy, typename ElemTy>
@ -1699,7 +1703,7 @@ public:
/// Implements the heuristic that marks two parameters related if the same
/// member is accessed (referred to) inside the current function's body.
class AccessedSameMemberOf {
ParamToSmallSetMap<const Decl *> AccessedMembers;
ParamToSmallPtrSetMap<const Decl *> AccessedMembers;
public:
void setup(const FunctionDecl *FD) {