clang 22.0.0git
clang::lifetimes::internal::OriginList Class Reference

A list of origins representing levels of indirection for pointer-like types. More...

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

Public Member Functions

 OriginList (OriginID OID)
OriginListpeelOuterOrigin () const
OriginID getOuterOriginID () const
void setInnerOriginList (OriginList *Inner)
size_t getLength () const

Detailed Description

A list of origins representing levels of indirection for pointer-like types.

Each node in the list contains an OriginID representing a level of indirection. The list structure captures the multi-level nature of pointer and reference types in the lifetime analysis.

Examples:

  • For int& x, the list has size 2:
    • Outer: origin for the reference storage itself (the lvalue x)
    • Inner: origin for what x refers to
  • For int* p, the list has size 2:
    • Outer: origin for the pointer variable p
    • Inner: origin for what p points to
  • For View v (where View is gsl::Pointer), the list has size 2:
    • Outer: origin for the view object itself
    • Inner: origin for what the view refers to
  • For int** pp, the list has size 3:
    • Outer: origin for pp itself
    • Inner: origin for *pp (what pp points to)
    • Inner->Inner: origin for **pp (what *pp points to)

The list structure enables the analysis to track how loans flow through different levels of indirection when assignments and dereferences occur.

Definition at line 91 of file Origins.h.

Constructor & Destructor Documentation

◆ OriginList()

clang::lifetimes::internal::OriginList::OriginList ( OriginID OID)
inline

Definition at line 93 of file Origins.h.

Referenced by getLength(), peelOuterOrigin(), and setInnerOriginList().

Member Function Documentation

◆ getLength()

size_t clang::lifetimes::internal::OriginList::getLength ( ) const
inline

◆ getOuterOriginID()

OriginID clang::lifetimes::internal::OriginList::getOuterOriginID ( ) const
inline

◆ peelOuterOrigin()

◆ setInnerOriginList()

void clang::lifetimes::internal::OriginList::setInnerOriginList ( OriginList * Inner)
inline

Definition at line 98 of file Origins.h.

References OriginList().

Referenced by clang::lifetimes::internal::OriginManager::getOrCreateList().


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