From 4f279fe18b749c432eb4a51b79a1112e9fb63e60 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 20 Aug 2025 21:38:13 -0700 Subject: [PATCH] [clang-tidy] Use SmallPtrSet directly instead of SmallSet (NFC) I'm trying to remove the redirection in SmallSet.h: template class SmallSet : public SmallPtrSet {}; 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. --- .../clang-tidy/bugprone/EasilySwappableParametersCheck.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp index 3cacb90cace52..7f1eeef8ea0fd 100644 --- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp @@ -1575,6 +1575,10 @@ template using ParamToSmallSetMap = llvm::DenseMap>; +template +using ParamToSmallPtrSetMap = + llvm::DenseMap>; + /// Returns whether the sets mapped to the two elements in the map have at /// least one element in common. template @@ -1699,7 +1703,7 @@ class PassedToSameFunction { /// 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 AccessedMembers; + ParamToSmallPtrSetMap AccessedMembers; public: void setup(const FunctionDecl *FD) {