clang 23.0.0git
clang::lifetimes::internal::Loan Class Reference

Represents lending a storage location. More...

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

Public Member Functions

 Loan (LoanID ID, AccessPath Path, const Expr *IssuingExpr)
LoanID getID () const
const AccessPathgetAccessPath () const
const ExprgetIssuingExpr () const
void dump (llvm::raw_ostream &OS) const

Detailed Description

Represents lending a storage location.

A loan tracks the borrowing relationship created by operations like taking a pointer/reference (&x), creating a view (std::string_view sv = s), or receiving a parameter.

Examples:

  • int* p = &x; creates a loan to x
  • Parameter loans have no IssueExpr (created at function entry)

Definition at line 112 of file Loans.h.

Constructor & Destructor Documentation

◆ Loan()

clang::lifetimes::internal::Loan::Loan ( LoanID ID,
AccessPath Path,
const Expr * IssuingExpr )
inline

Definition at line 120 of file Loans.h.

Member Function Documentation

◆ dump()

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

Definition at line 34 of file Loans.cpp.

References getID().

Referenced by clang::lifetimes::internal::IssueFact::dump().

◆ getAccessPath()

const AccessPath & clang::lifetimes::internal::Loan::getAccessPath ( ) const
inline

Definition at line 123 of file Loans.h.

◆ getID()

LoanID clang::lifetimes::internal::Loan::getID ( ) const
inline

◆ getIssuingExpr()

const Expr * clang::lifetimes::internal::Loan::getIssuingExpr ( ) const
inline

Definition at line 124 of file Loans.h.


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