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

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

Public Member Functions

 LivenessInfo ()
 LivenessInfo (const UseFact *UF, LivenessKind K)
bool operator== (const LivenessInfo &Other) const
bool operator!= (const LivenessInfo &Other) const
void Profile (llvm::FoldingSetNodeID &IDBuilder) const

Public Attributes

const UseFactCausingUseFact
 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 1158 of file LifetimeSafety.cpp.

Constructor & Destructor Documentation

◆ LivenessInfo() [1/2]

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

Definition at line 1175 of file LifetimeSafety.cpp.

References CausingUseFact, clang::lifetimes::Dead, Kind, and clang::nullptr.

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

◆ LivenessInfo() [2/2]

clang::lifetimes::internal::LivenessInfo::LivenessInfo ( const UseFact * UF,
LivenessKind K )
inline

Definition at line 1176 of file LifetimeSafety.cpp.

References CausingUseFact, and Kind.

Member Function Documentation

◆ operator!=()

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

Definition at line 1182 of file LifetimeSafety.cpp.

References LivenessInfo(), and clang::Other.

◆ operator==()

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

Definition at line 1179 of file LifetimeSafety.cpp.

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

◆ Profile()

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

Definition at line 1184 of file LifetimeSafety.cpp.

References CausingUseFact, and Kind.

Member Data Documentation

◆ CausingUseFact

const UseFact* clang::lifetimes::internal::LivenessInfo::CausingUseFact

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 1163 of file LifetimeSafety.cpp.

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 1173 of file LifetimeSafety.cpp.

Referenced by clang::lifetimes::internal::LivenessLattice::dump(), LivenessInfo(), LivenessInfo(), operator==(), and Profile().


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