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

Represents a component of an access path: either a named field access or an abstract unnamed interior region (denoted by '*'). More...

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

Public Member Functions

 Loan (LoanID ID, AccessPath Path, const Expr *IssueExpr=nullptr)
LoanID getID () const
const AccessPathgetAccessPath () const
const ExprgetIssueExpr () const
void dump (llvm::raw_ostream &OS) const

Detailed Description

Represents a component of an access path: either a named field access or an abstract unnamed interior region (denoted by '*').

The interior access (*) represents the borrowable content of an object without exposing its internal implementation details. It may abstract over multiple underlying fields or memory regions.

Examples:

  • int* p = &x; creates a loan to x
  • std::string_view v = s; creates a loan to s.* (interior)
  • int* p = &obj.field; creates a loan to obj.field
  • Parameter loans have no IssueExpr (created at function entry)

Definition at line 191 of file Loans.h.

Constructor & Destructor Documentation

◆ Loan()

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

Definition at line 199 of file Loans.h.

Member Function Documentation

◆ dump()

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

Definition at line 32 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 203 of file Loans.h.

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

◆ getID()

◆ getIssueExpr()

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

Definition at line 204 of file Loans.h.


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