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

Represents one step in an access path: either a field access or an access to an unnamed interior region (denoted by '*'). More...

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

Public Types

enum class  Kind { Field , Interior }

Public Member Functions

bool isField () const
bool isInterior () const
const FieldDeclgetFieldDecl () const
bool operator== (const PathElement &Other) const
bool operator!= (const PathElement &Other) const
void dump (llvm::raw_ostream &OS) const

Static Public Member Functions

static PathElement getField (const FieldDecl &FD)
static PathElement getInterior ()

Detailed Description

Represents one step in an access path: either a field access or an access to an unnamed interior region (denoted by '*').

Examples:

  • Field access: obj.field has PathElement 'field'
  • Interior access: owner.* has ''
    • In std::string s; std::string_view v = s;, v has loan to s.

Definition at line 40 of file Loans.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Field 
Interior 

Definition at line 42 of file Loans.h.

Member Function Documentation

◆ dump()

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

Definition at line 60 of file Loans.h.

References isField().

◆ getField()

PathElement clang::lifetimes::internal::PathElement::getField ( const FieldDecl & FD)
inlinestatic

Definition at line 44 of file Loans.h.

References Field.

◆ getFieldDecl()

const FieldDecl * clang::lifetimes::internal::PathElement::getFieldDecl ( ) const
inline

Definition at line 53 of file Loans.h.

◆ getInterior()

PathElement clang::lifetimes::internal::PathElement::getInterior ( )
inlinestatic

Definition at line 47 of file Loans.h.

References Interior.

◆ isField()

bool clang::lifetimes::internal::PathElement::isField ( ) const
inline

Definition at line 51 of file Loans.h.

References Field.

Referenced by dump().

◆ isInterior()

bool clang::lifetimes::internal::PathElement::isInterior ( ) const
inline

Definition at line 52 of file Loans.h.

References Interior.

◆ operator!=()

bool clang::lifetimes::internal::PathElement::operator!= ( const PathElement & Other) const
inline

Definition at line 58 of file Loans.h.

References clang::Other.

◆ operator==()

bool clang::lifetimes::internal::PathElement::operator== ( const PathElement & Other) const
inline

Definition at line 55 of file Loans.h.

References clang::Other.


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