clang 22.0.0git
clang::lifetimes::internal::LivenessInfo Struct Reference

Information about why an origin is live at a program point. More...

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

Public Member Functions

 LivenessInfo ()
 LivenessInfo (CausingFactType CF, LivenessKind K)
bool operator== (const LivenessInfo &Other) const
bool operator!= (const LivenessInfo &Other) const
void Profile (llvm::FoldingSetNodeID &IDBuilder) const

Public Attributes

CausingFactType CausingFact
 The use that makes the origin live.
LivenessKind Kind
 The kind of liveness of the origin.

Detailed Description

Information about why an origin is live at a program point.

Definition at line 44 of file LiveOrigins.h.

Constructor & Destructor Documentation

◆ LivenessInfo() [1/2]

clang::lifetimes::internal::LivenessInfo::LivenessInfo ( )
inline

Definition at line 62 of file LiveOrigins.h.

References CausingFact, clang::lifetimes::internal::Dead, Kind, and clang::nullptr.

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

◆ LivenessInfo() [2/2]

clang::lifetimes::internal::LivenessInfo::LivenessInfo ( CausingFactType CF,
LivenessKind K )
inline

Definition at line 63 of file LiveOrigins.h.

References CausingFact, and Kind.

Member Function Documentation

◆ operator!=()

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

Definition at line 68 of file LiveOrigins.h.

References LivenessInfo(), and clang::Other.

◆ operator==()

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

Definition at line 65 of file LiveOrigins.h.

References CausingFact, Kind, LivenessInfo(), and clang::Other.

◆ Profile()

void clang::lifetimes::internal::LivenessInfo::Profile ( llvm::FoldingSetNodeID & IDBuilder) const
inline

Definition at line 70 of file LiveOrigins.h.

References CausingFact, and Kind.

Member Data Documentation

◆ CausingFact

CausingFactType clang::lifetimes::internal::LivenessInfo::CausingFact

The use that makes the origin live.

If liveness is propagated from multiple uses along different paths, this will point to the use appearing earlier in the translation unit. This is 'null' when the origin is not live.

Definition at line 49 of file LiveOrigins.h.

Referenced by LivenessInfo(), LivenessInfo(), operator==(), and Profile().

◆ Kind

LivenessKind clang::lifetimes::internal::LivenessInfo::Kind

The kind of liveness of the origin.

Must: The origin is live on all control-flow paths from the current point to the function's exit (i.e. the current point is dominated by a set of uses). Maybe: indicates it is live on some but not all paths.

This determines the diagnostic's confidence level. Must-be-alive at expiration implies a definite use-after-free, while Maybe-be-alive suggests a potential one on some paths.

Definition at line 60 of file LiveOrigins.h.

Referenced by LivenessInfo(), LivenessInfo(), operator==(), and Profile().


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