clang 22.0.0git
clang::lifetimes::internal::Loan Struct Reference

Information about a single borrow, or "Loan". More...

#include "clang/Analysis/Analyses/LifetimeSafety/Loans.h"

Public Member Functions

 Loan (LoanID id, AccessPath path, const Expr *IssueExpr)
void dump (llvm::raw_ostream &OS) const

Public Attributes

LoanID ID
 TODO: Represent opaque loans.
AccessPath Path
const ExprIssueExpr
 The expression that creates the loan, e.g., &x.

Detailed Description

Information about a single borrow, or "Loan".

A loan is created when a reference or pointer is created.

Definition at line 39 of file Loans.h.

Constructor & Destructor Documentation

◆ Loan()

clang::lifetimes::internal::Loan::Loan ( LoanID id,
AccessPath path,
const Expr * IssueExpr )
inline

Definition at line 48 of file Loans.h.

References ID, IssueExpr, and Path.

Member Function Documentation

◆ dump()

void clang::lifetimes::internal::Loan::dump ( llvm::raw_ostream & OS) const

Definition at line 13 of file Loans.cpp.

References ID, and Path.

Referenced by clang::lifetimes::internal::ExpireFact::dump(), and clang::lifetimes::internal::IssueFact::dump().

Member Data Documentation

◆ ID

LoanID clang::lifetimes::internal::Loan::ID

TODO: Represent opaque loans.

TODO: Represent nullptr: loans to no path. Accessing it UB! Currently it is represented as empty LoanSet

Definition at line 43 of file Loans.h.

Referenced by dump(), and Loan().

◆ IssueExpr

const Expr* clang::lifetimes::internal::Loan::IssueExpr

The expression that creates the loan, e.g., &x.

Definition at line 46 of file Loans.h.

Referenced by Loan().

◆ Path

AccessPath clang::lifetimes::internal::Loan::Path

Definition at line 44 of file Loans.h.

Referenced by dump(), and Loan().


The documentation for this struct was generated from the following files: