[clang] [Clang] Optimize -Wunsafe-buffer-usage. (PR #125492)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 28 06:55:31 PST 2025


================
@@ -1986,112 +2360,119 @@ class DerefSimplePtrArithFixableGadget : public FixableGadget {
   }
 };
 
-/// Scan the function and return a list of gadgets found with provided kits.
-static void findGadgets(const Stmt *S, ASTContext &Ctx,
-                        const UnsafeBufferUsageHandler &Handler,
-                        bool EmitSuggestions, FixableGadgetList &FixableGadgets,
-                        WarningGadgetList &WarningGadgets,
-                        DeclUseTracker &Tracker) {
+class EvaluatedStmtMatcher : public FastMatcher {
----------------
ilya-biryukov wrote:

Could we use more descriptive names?

I think the `EvaluatedStmtMatcher` is pretty much `WarningGadgetMatcher`.
And `StmtMatcher` is `FixableGadgetsMatcher`.


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


More information about the cfe-commits mailing list