[clang] Thread Safety Analysis: Track try-acquired capabilities as try facts of their call (PR #241550)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 15 16:10:24 PST 2026


================
@@ -168,6 +228,98 @@ class FactEntry : public CapabilityExpr {
   }
 };
 
+/// The conditional fact of one try-acquire call's stored result: created at the
+/// call, resolved by the branches on the result, and kept afterwards as the
+/// record of what they proved, in one of these states:
+///
+///   Conditional    The result is unknown here: the capability is held iff it
+///                  is truthy. The only state that is a (possible) hold.
+///   ProvedHeld     The result is truthy on every path here, and the hold it
+///                  proved is live: one level of the definite fact comes from
+///                  branching on this call.
----------------
aaronpuchert wrote:

I find the values self-explanatory, I don't think we need to document them.

But I wonder whether we shouldn't include `ProvedNotHeld` to facilitate joins.

https://github.com/llvm/llvm-project/pull/241550


More information about the cfe-commits mailing list