================
@@ -34,46 +34,110 @@ struct AccessPath {
AccessPath(const clang::ValueDecl *D) : D(D) {}
};
-/// Information about a single borrow, or "Loan". A loan is created when a
-/// reference or pointer is created.
-struct Loan {
+/// An abstract base class for a single borrow, or "Loan".
+class Loan {
/// TODO: Represent opaque loans.
/// TODO: Represent nullptr: loans to no path. Accessing it UB! Currently it
/// is represented as empty LoanSet
- LoanID ID;
+public:
+ enum class Kind : uint8_t {
+ /// A regular borrow of a variable within the function that has a path and
+ /// can expire.
+ Borrow,
----------------
kashika0112 wrote:
Okay, I agree on BorrowLoan. I'll rename it to concreteLoan and similar with
borrow in enum.
However, for placeholder loans, I'll keep it as it is. While it currently only
holds a paramter loab, but it may extend in the future to support things like
the implicit this pointer.
https://github.com/llvm/llvm-project/pull/169767
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits