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

Represents the storage location being borrowed, e.g., a specific stack variable or a field within it: var.field. More...

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

Public Types

enum class  Kind : uint8_t { ValueDecl , MaterializeTemporary , PlaceholderParam , PlaceholderThis }

Public Member Functions

 AccessPath (const clang::ValueDecl *D)
 AccessPath (const clang::MaterializeTemporaryExpr *MTE)
 AccessPath (const AccessPath &Other)
Kind getKind () const
const clang::ValueDeclgetAsValueDecl () const
const clang::MaterializeTemporaryExprgetAsMaterializeTemporaryExpr () const
const ParmVarDeclgetAsPlaceholderParam () const
const CXXMethodDeclgetAsPlaceholderThis () const
bool operator== (const AccessPath &RHS) const
bool operator!= (const AccessPath &RHS) const
void dump (llvm::raw_ostream &OS) const

Static Public Member Functions

static AccessPath Placeholder (const ParmVarDecl *PVD)
static AccessPath Placeholder (const CXXMethodDecl *MD)

Detailed Description

Represents the storage location being borrowed, e.g., a specific stack variable or a field within it: var.field.

Placeholder paths never expire within the function scope, as they represent storage from the caller's scope.

TODO: Model access paths of other types, e.g. field, array subscript, heap and globals.

Definition at line 44 of file Loans.h.

Member Enumeration Documentation

◆ Kind

enum class clang::lifetimes::internal::AccessPath::Kind : uint8_t
strong
Enumerator
ValueDecl 
MaterializeTemporary 
PlaceholderParam 
PlaceholderThis 

Definition at line 46 of file Loans.h.

Constructor & Destructor Documentation

◆ AccessPath() [1/3]

clang::lifetimes::internal::AccessPath::AccessPath ( const clang::ValueDecl * D)
inline

Definition at line 61 of file Loans.h.

References ValueDecl.

Referenced by AccessPath(), operator!=(), operator==(), Placeholder(), and Placeholder().

◆ AccessPath() [2/3]

clang::lifetimes::internal::AccessPath::AccessPath ( const clang::MaterializeTemporaryExpr * MTE)
inline

Definition at line 62 of file Loans.h.

References MaterializeTemporary.

◆ AccessPath() [3/3]

clang::lifetimes::internal::AccessPath::AccessPath ( const AccessPath & Other)
inline

Definition at line 70 of file Loans.h.

References AccessPath(), and clang::Other.

Member Function Documentation

◆ dump()

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

◆ getAsMaterializeTemporaryExpr()

const clang::MaterializeTemporaryExpr * clang::lifetimes::internal::AccessPath::getAsMaterializeTemporaryExpr ( ) const
inline

Definition at line 78 of file Loans.h.

References MaterializeTemporary.

Referenced by dump().

◆ getAsPlaceholderParam()

const ParmVarDecl * clang::lifetimes::internal::AccessPath::getAsPlaceholderParam ( ) const
inline

Definition at line 83 of file Loans.h.

References PlaceholderParam.

Referenced by dump().

◆ getAsPlaceholderThis()

const CXXMethodDecl * clang::lifetimes::internal::AccessPath::getAsPlaceholderThis ( ) const
inline

Definition at line 87 of file Loans.h.

References PlaceholderThis.

◆ getAsValueDecl()

const clang::ValueDecl * clang::lifetimes::internal::AccessPath::getAsValueDecl ( ) const
inline

Definition at line 74 of file Loans.h.

References ValueDecl.

Referenced by dump().

◆ getKind()

Kind clang::lifetimes::internal::AccessPath::getKind ( ) const
inline

Definition at line 72 of file Loans.h.

◆ operator!=()

bool clang::lifetimes::internal::AccessPath::operator!= ( const AccessPath & RHS) const
inline

Definition at line 95 of file Loans.h.

References AccessPath().

◆ operator==()

bool clang::lifetimes::internal::AccessPath::operator== ( const AccessPath & RHS) const
inline

Definition at line 92 of file Loans.h.

References AccessPath().

◆ Placeholder() [1/2]

AccessPath clang::lifetimes::internal::AccessPath::Placeholder ( const CXXMethodDecl * MD)
inlinestatic

Definition at line 67 of file Loans.h.

References AccessPath(), and PlaceholderThis.

◆ Placeholder() [2/2]

AccessPath clang::lifetimes::internal::AccessPath::Placeholder ( const ParmVarDecl * PVD)
inlinestatic

Definition at line 64 of file Loans.h.

References AccessPath(), and PlaceholderParam.


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