[clang] [LifetimeSafety] Implement more precise access paths (PR #180369)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 09:31:18 PST 2026


================
@@ -97,48 +102,64 @@ class IssueFact : public Fact {
   LoanID getLoanID() const { return LID; }
   OriginID getOriginID() const { return OID; }
   void dump(llvm::raw_ostream &OS, const LoanManager &LM,
-            const OriginManager &OM) const override;
+            const OriginManager &OM,
+            const LoanPropagationAnalysis *LPA = nullptr) const override;
 };
 
+/// Represents the expiration of loans at a specific storage location.
+///
+/// When an AccessPath expires (e.g., a variable goes out of scope), all loans
+/// that are prefixed by this path expire. For example, if `x` expires, then
+/// loans to `x`, `x.field`, and `x.field.*` all expire.
 class ExpireFact : public Fact {
-  LoanID LID;
+  /// The access path that expires (e.g., the variable going out of scope).
----------------
Xazax-hun wrote:

Do we ever expire a loan that is not a base path? I wonder if having an access path member here is too generic. 

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


More information about the cfe-commits mailing list