[clang] [WIP] [analyzer] Refactor MallocChecker to use `BindExpr` in `evalCall` (PR #106081)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 09:02:32 PDT 2024


================
@@ -1052,6 +1103,12 @@ static bool isStandardNewDelete(const FunctionDecl *FD) {
 // Methods of MallocChecker and MallocBugVisitor.
 //===----------------------------------------------------------------------===//
 
+bool MallocChecker::isFreeingOwnershipAttrCall(const CallEvent &Call) {
+  const auto *Func = dyn_cast_or_null<FunctionDecl>(Call.getDecl());
+
+  return Func ? isFreeingOwnershipAttrCall(Func) : false;
----------------
NagyDonat wrote:

```suggestion
  return Func && isFreeingOwnershipAttrCall(Func);
```
This is a simpler way to express the same boolean operation.

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


More information about the cfe-commits mailing list