[clang] Thread Safety Analysis: Support reentrant capabilities (PR #137133)
Aaron Puchert via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 26 12:08:37 PDT 2025
================
@@ -114,31 +112,39 @@ class FactEntry : public CapabilityExpr {
};
private:
- const FactEntryKind Kind : 8;
+ const FactEntryKind Kind : 4;
/// Exclusive or shared.
- LockKind LKind : 8;
+ const LockKind LKind : 4;
+
+ /// How it was acquired.
+ const SourceKind Source : 4;
----------------
aaronpuchert wrote:
We probably don't need these to be `const`. The `FactEntryKind` is `const` because it encodes the actual dynamic type of the fact, which shouldn't change after construction. The other fields can freely be changed, at least before we move the fact into the `FactManager`, which applies `const` to the entire fact.
https://github.com/llvm/llvm-project/pull/137133
More information about the cfe-commits
mailing list