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

An abstract base class for a single, atomic lifetime-relevant event. More...

Inheritance diagram for clang::lifetimes::internal::Fact:
[legend]

Public Types

enum class  Kind : uint8_t {
  Issue , Expire , OriginFlow , ReturnOfOrigin ,
  Use , TestPoint
}

Public Member Functions

virtual ~Fact ()=default
Kind getKind () const
template<typename T>
const TgetAs () const
virtual void dump (llvm::raw_ostream &OS, const LoanManager &, const OriginManager &) const

Protected Member Functions

 Fact (Kind K)

Detailed Description

An abstract base class for a single, atomic lifetime-relevant event.

Definition at line 207 of file LifetimeSafety.cpp.

Member Enumeration Documentation

◆ Kind

enum class clang::lifetimes::internal::Fact::Kind : uint8_t
strong
Enumerator
Issue 

A new loan is issued from a borrow expression (e.g., &x).

Expire 

A loan expires as its underlying storage is freed (e.g., variable goes out of scope).

OriginFlow 

An origin is propagated from a source to a destination (e.g., p = q).

This can also optionally kill the destination origin before flowing into it. Otherwise, the source's loan set is merged into the destination's loan set.

ReturnOfOrigin 

An origin escapes the function by flowing into the return value.

Use 

An origin is used (eg. appears as l-value expression like DeclRefExpr).

TestPoint 

A marker for a specific point in the code, for testing.

Definition at line 210 of file LifetimeSafety.cpp.

Constructor & Destructor Documentation

◆ Fact()

◆ ~Fact()

virtual clang::lifetimes::internal::Fact::~Fact ( )
virtualdefault

Member Function Documentation

◆ dump()

◆ getAs()

template<typename T>
const T * clang::lifetimes::internal::Fact::getAs ( ) const
inline

Definition at line 239 of file LifetimeSafety.cpp.

References clang::T.

◆ getKind()


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