[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 24 15:14:54 PDT 2023
aaronpuchert added inline comments.
================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+ CF.getVarDecl()->getLocation());
+ break;
+ }
----------------
tbaeder wrote:
> This handles the function call, but without the instance parameter. I was wondering how to best do that.
Should you not simply pass `SxBuilder.createVariable(CF.getVarDecl())` as third parameter in analogy with the `AutomaticObjectDtor` case? It might also make sense to copy the attribute check.
================
Comment at: clang/test/Sema/warn-thread-safety-analysis.c:76-77
+void cleanup_int(int *unused) __attribute__((release_capability(mu1))) {
+ (void)unused;
+ mutex_exclusive_unlock(&mu1);
----------------
================
Comment at: clang/test/Sema/warn-thread-safety-analysis.c:136
+
+ {
----------------
Nitpick: one blank line is enough.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
More information about the cfe-commits
mailing list