[PATCH] D106713: Thread safety: Warn when demoting locks on back edges

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 23 14:06:07 PDT 2021


aaronpuchert created this revision.
aaronpuchert added reviewers: aaron.ballman, delesley.
aaronpuchert requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Previously in D104261 <https://reviews.llvm.org/D104261> we warned about dropping locks from back edges,
this is the corresponding change for exclusive/shared joins. If we're
entering the loop with an exclusive change, which is then relaxed to a
shared lock before we loop back, we have already analyzed the loop body
with the stronger exclusive lock and thus might have false positives.

There is a minor non-observable change: we modify the exit lock set of a
function, but since that isn't used further it doesn't change anything.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106713

Files:
  clang/lib/Analysis/ThreadSafety.cpp
  clang/test/SemaCXX/warn-thread-safety-analysis.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106713.361346.patch
Type: text/x-patch
Size: 4957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210723/074b2f57/attachment.bin>


More information about the cfe-commits mailing list