Thread safety analysis: Allow exlusive/shared joins for managed and asserted capabilities
authorAaron Puchert <aaron.puchert@sap.com>
Thu, 27 May 2021 15:45:59 +0000 (17:45 +0200)
committerAaron Puchert <aaron.puchert@sap.com>
Thu, 27 May 2021 15:46:04 +0000 (17:46 +0200)
commitcf0b337c1b1f064c81fe40124ddba178572778d6
treec8bf4ba7239da6f70e30c142a0e43553e61da72f
parent3d64677c28072867ea6025a22805977386b767f8
Thread safety analysis: Allow exlusive/shared joins for managed and asserted capabilities

Similar to how we allow managed and asserted locks to be held and not
held in joining branches, we also allow them to be held shared and
exclusive. The scoped lock should restore the original state at the end
of the scope in any event, and asserted locks need not be released.

We should probably only allow asserted locks to be subsumed by managed,
not by (directly) acquired locks, but that's for another change.

Reviewed By: delesley

Differential Revision: https://reviews.llvm.org/D102026
clang/lib/Analysis/ThreadSafety.cpp
clang/test/SemaCXX/warn-thread-safety-analysis.cpp