[clang] [Clang SA]: add support for mismatched ownership_returns+ownership_takes calls for custom allocation classes (PR #98941)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 16 23:45:32 PDT 2024


================
@@ -194,7 +226,7 @@ class RefState {
   void Profile(llvm::FoldingSetNodeID &ID) const {
     ID.AddInteger(K);
     ID.AddPointer(S);
-    ID.AddInteger(Family);
+    ID.AddInteger(Family.kind());
----------------
steakhal wrote:

This Profile wouldn't take the custom allocation function name into account.
I'd suggest letting the Family define its own Profile method and just pass the ID to it.
That is the canonical way of doing this.

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


More information about the cfe-commits mailing list