Skip to content

Commit 4f279fe

Browse files
[clang-tidy] Use SmallPtrSet directly instead of SmallSet (NFC)
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.
1 parent e0acf65 commit 4f279fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,10 @@ template <typename T, std::size_t N = SmallDataStructureSize>
15751575
using ParamToSmallSetMap =
15761576
llvm::DenseMap<const ParmVarDecl *, llvm::SmallSet<T, N>>;
15771577

1578+
template <typename T, std::size_t N = SmallDataStructureSize>
1579+
using ParamToSmallPtrSetMap =
1580+
llvm::DenseMap<const ParmVarDecl *, llvm::SmallPtrSet<T, N>>;
1581+
15781582
/// Returns whether the sets mapped to the two elements in the map have at
15791583
/// least one element in common.
15801584
template <typename MapTy, typename ElemTy>
@@ -1699,7 +1703,7 @@ class PassedToSameFunction {
16991703
/// Implements the heuristic that marks two parameters related if the same
17001704
/// member is accessed (referred to) inside the current function's body.
17011705
class AccessedSameMemberOf {
1702-
ParamToSmallSetMap<const Decl *> AccessedMembers;
1706+
ParamToSmallPtrSetMap<const Decl *> AccessedMembers;
17031707

17041708
public:
17051709
void setup(const FunctionDecl *FD) {

0 commit comments

Comments
 (0)