aaronpuchert added inline comments.

================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:868
                                 ThreadSafetyHandler &Handler) const override {
-    if (!managed() && !asserted() && !negative() && !isUniversal()) {
+    if (!asserted() && !negative() && !isUniversal()) {
       Handler.handleMutexHeldEndOfScope("mutex", toString(), loc(), JoinLoc,
----------------
aaronpuchert wrote:
> One might ask: what about asserted capabilities? I plan to introduce a 
> warning when they are released, because that can't be consistent, and then 
> they can't disappear on back edges without warning.
> 
> For negative capabilities we'd presumably see a warning for the "positive" 
> capability instead.
> 
> Not sure how universal capabilities are typically used. Presumably one could 
> release such a capability in a loop? Then on the other hand, code using such 
> capabilities is probably not very interested in false negatives.
> For negative capabilities we'd presumably see a warning for the "positive" 
> capability instead.

No, because a back edge is missing a positive capability when I'm unlocking in 
a loop, whereas it would be missing a negative capability when I'm locking in a 
loop.

But we probably want to warn about this only when `-Wthread-safety-negative` is 
active.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104261/new/

https://reviews.llvm.org/D104261

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to