[clang-tools-extra] [clang-tidy] Prefer the faster LLVM ADT sets and maps over `std::` ones (PR #174357)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 07:11:56 PST 2026


================
@@ -84,12 +82,12 @@ class UnusedParametersCheck::IndexerVisitor
 public:
   IndexerVisitor(ASTContext &Ctx) { TraverseAST(Ctx); }
 
-  const std::unordered_set<const CallExpr *> &
+  const llvm::SmallPtrSetImpl<const CallExpr *> &
   getFnCalls(const FunctionDecl *Fn) {
     return Index[Fn->getCanonicalDecl()].Calls;
   }
 
-  const std::unordered_set<const DeclRefExpr *> &
+  const llvm::SmallPtrSetImpl<const DeclRefExpr *> &
----------------
localspook wrote:

Mostly to avoid repeating the "small buffer size" template parameter in the return type. It's not critical though, I can change it to `llvm::SmallPtrSet` if you feel it's more readable

https://github.com/llvm/llvm-project/pull/174357


More information about the cfe-commits mailing list