[clang] [analyzer] Clean up bug types in CallAndMessageChecker (PR #156073)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 2 01:37:50 PDT 2025


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/156073 at github.com>


================
@@ -108,29 +109,26 @@ class CallAndMessageChecker
   bool PreVisitProcessArg(CheckerContext &C, SVal V, SourceRange ArgRange,
                           const Expr *ArgEx, int ArgumentNumber,
                           bool CheckUninitFields, const CallEvent &Call,
-                          std::unique_ptr<BugType> &BT,
+                          const BugType &BT,
                           const ParmVarDecl *ParamDecl) const;
 
-  static void emitBadCall(BugType *BT, CheckerContext &C, const Expr *BadE);
+  static void emitBadCall(const BugType *BT, CheckerContext &C,
----------------
steakhal wrote:

In the other APIs, we pass BugTypes by reference. Is `BT` always non-null in all callsites? If so, could we use reference here as well?

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


More information about the cfe-commits mailing list