14#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_LOANS_H
15#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_LOANS_H
19#include "llvm/Support/raw_ostream.h"
25 return OS << ID.Value;
51 void dump(llvm::raw_ostream &OS)
const;
60 AllLoans.emplace_back(getNextLoanID(), Path, IssueExpr);
61 return AllLoans.back();
65 assert(ID.Value < AllLoans.size());
66 return AllLoans[ID.Value];
71 LoanID getNextLoanID() {
return NextLoanID++; }
This represents one expression.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
const Loan & getLoan(LoanID ID) const
Loan & addLoan(AccessPath Path, const Expr *IssueExpr)
llvm::ArrayRef< Loan > getLoans() const
utils::ID< struct LoanTag > LoanID
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, LoanID ID)
Represents the storage location being borrowed, e.g., a specific stack variable.
AccessPath(const clang::ValueDecl *D)
const clang::ValueDecl * D
Information about a single borrow, or "Loan".
Loan(LoanID id, AccessPath path, const Expr *IssueExpr)
const Expr * IssueExpr
The expression that creates the loan, e.g., &x.
LoanID ID
TODO: Represent opaque loans.
void dump(llvm::raw_ostream &OS) const
A generic, type-safe wrapper for an ID, distinguished by its Tag type.