[PATCH] D102025: Thread safety analysis: Factor out function for merging locks (NFC)
Aaron Puchert via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 13 07:05:21 PDT 2021
aaronpuchert added inline comments.
================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2199
+ // Take the exclusive capability to reduce further warnings.
+ return B.kind() == LK_Exclusive;
+ } else {
----------------
aaron.ballman wrote:
> The old code was looking at `LDat1.kind() != LK_Exclusive` -- any reason this isn't `A.kind() != LK_Exclusive` as well?
Given that both should be equivalent (knowing `A.kind() != B.kind()` and that there are just two kinds), I thought this condition fits better to the comment: we select the lock that's exclusive, instead of not selecting the lock that's not exclusive.
But I don't have a problem with `A.kind() != LK_Exclusive` if that sounds more natural to you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102025/new/
https://reviews.llvm.org/D102025
More information about the cfe-commits
mailing list