[PATCH] D100801: Thread safety analysis: Replace flags in FactEntry by SourceKind [NFC]

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 15:05:46 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.

The motivation here is to make it available in the base class whether a
fact is managed or not. That would have meant three flags on the base
class, so I had a look whether we really have 8 possible combinations.

It turns out we don't: asserted and declared are obviously mutually
exclusive. Managed facts are only created when we acquire a capability
through a scoped capability. Adopting an asserted or declared lock will
not (in fact can not, because Facts are immutable) make them managed.

We probably don't want to allow adopting an asserted lock (because then
the function should probably have a release attribute, and then the
assertion is pointless), but we might at some point decide to replace a
declared fact on adoption.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100801

Files:
  clang/lib/Analysis/ThreadSafety.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100801.338656.patch
Type: text/x-patch
Size: 7016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210419/994c5442/attachment-0001.bin>


More information about the cfe-commits mailing list