================
@@ -105,14 +105,73 @@ class CapExprSet : public SmallVector<CapabilityExpr, 4> {
 
 class FactManager;
 class FactSet;
+class LockableFactEntry;
 
 /// This is a helper class that stores a fact that is known at a
-/// particular point in program execution.  Currently, a fact is a capability,
+/// particular point in program execution. Concretely, a fact is a capability,
 /// along with additional information, such as where it was acquired, whether
 /// it is exclusive or shared, etc.
+///
+/// A capability's facts come in two forms, and a FactSet keeps them apart:
+///
+///  * At most one definite fact per capability: the capability is held (or,
+///    for a negative capability, provably not held). A LockableFactEntry for
+///    a mutex; a ScopedLockableFactEntry for a scope object's own capability,
+///    which also lists the mutexes the object manages. Its reentrancy depth
+///    counts the levels acquired on top of the first; the levels are
+///    interchangeable -- releasing "a" level is releasing "the" level -- so
+///    a counter is all they need.
+///
+///  * Any number of try facts per capability (TryFactEntry), one per
+///    originating try-acquire call and lock kind: what that call's stored
+///    result says about the capability. An unresolved try fact is conditional
+///    -- "held if that call succeeded" -- and a branch on the call's result
+///    resolves exactly the try facts that name it as their origin. A resolved
+///    try fact stays behind as the record of what the branch proved, for
+///    joins and rebranching.
----------------
aaronpuchert wrote:

I wonder whether we aren't better off storing all the information regarding a 
fact in one entry.

https://github.com/llvm/llvm-project/pull/241550
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to