@@ -55,6 +55,7 @@ class Fact;
5555class FactManager ;
5656class LoanPropagationAnalysis ;
5757class ExpiredLoansAnalysis ;
58+ class LiveOriginAnalysis ;
5859struct LifetimeFactory ;
5960
6061// / A generic, type-safe wrapper for an ID, distinguished by its `Tag` type.
@@ -89,6 +90,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, OriginID ID) {
8990// TODO(opt): Consider using a bitset to represent the set of loans.
9091using LoanSet = llvm::ImmutableSet<LoanID>;
9192using OriginSet = llvm::ImmutableSet<OriginID>;
93+ using OriginLoanMap = llvm::ImmutableMap<OriginID, LoanSet>;
9294
9395// / A `ProgramPoint` identifies a location in the CFG by pointing to a specific
9496// / `Fact`. identified by a lifetime-related event (`Fact`).
@@ -110,8 +112,9 @@ class LifetimeSafetyAnalysis {
110112 // / Returns the set of loans an origin holds at a specific program point.
111113 LoanSet getLoansAtPoint (OriginID OID, ProgramPoint PP) const ;
112114
113- // / Returns the set of loans that have expired at a specific program point.
114- std::vector<LoanID> getExpiredLoansAtPoint (ProgramPoint PP) const ;
115+ // / TODO:Document.
116+ std::vector<std::pair<OriginID, Confidence>>
117+ getLiveOriginsAtPoint (ProgramPoint PP) const ;
115118
116119 // / Finds the OriginID for a given declaration.
117120 // / Returns a null optional if not found.
@@ -138,7 +141,7 @@ class LifetimeSafetyAnalysis {
138141 std::unique_ptr<LifetimeFactory> Factory;
139142 std::unique_ptr<FactManager> FactMgr;
140143 std::unique_ptr<LoanPropagationAnalysis> LoanPropagation;
141- std::unique_ptr<ExpiredLoansAnalysis> ExpiredLoans ;
144+ std::unique_ptr<LiveOriginAnalysis> LiveOrigins ;
142145};
143146} // namespace internal
144147} // namespace clang::lifetimes
0 commit comments