clang 23.0.0git
clang::lifetimes Namespace Reference

Namespaces

namespace  internal

Classes

class  LifetimeSafetySemaHelper
 Abstract interface for operations requiring Sema access. More...
struct  LifetimeSafetyStats
 A structure to hold the statistics related to LifetimeAnalysis. More...

Enumerations

enum class  Confidence : uint8_t { None , Maybe , Definite }
 Enum to track the confidence level of a potential error. More...
enum class  SuggestionScope { CrossTU , IntraTU }
 Enum to track functions visible across or within TU. More...

Functions

void runLifetimeSafetyAnalysis (AnalysisDeclContext &AC, LifetimeSafetySemaHelper *SemaHelper, LifetimeSafetyStats &Stats, bool CollectStats)
 The main entry point for the analysis.
void printStats (const LifetimeSafetyStats &Stats)
 Utility function to print missing origin stats.
const FunctionDeclgetDeclWithMergedLifetimeBoundAttrs (const FunctionDecl *FD)
const CXXMethodDeclgetDeclWithMergedLifetimeBoundAttrs (const CXXMethodDecl *CMD)
bool isNormalAssignmentOperator (const FunctionDecl *FD)
bool isAssignmentOperatorLifetimeBound (const CXXMethodDecl *CMD)
static const LifetimeBoundAttr * getLifetimeBoundAttrFromFunctionType (const TypeSourceInfo &TSI)
 Check if a function has a lifetimebound attribute on its function type (which represents the implicit 'this' parameter for methods).
bool implicitObjectParamIsLifetimeBound (const FunctionDecl *FD)
bool isInStlNamespace (const Decl *D)
bool isPointerLikeType (QualType QT)
bool shouldTrackImplicitObjectArg (const CXXMethodDecl *Callee, bool RunningUnderLifetimeSafety)
bool shouldTrackFirstArgument (const FunctionDecl *FD)
template<typename T>
static bool isRecordWithAttr (QualType Type)
bool isGslPointerType (QualType QT)
bool isGslOwnerType (QualType QT)

Enumeration Type Documentation

◆ Confidence

enum class clang::lifetimes::Confidence : uint8_t
strong

Enum to track the confidence level of a potential error.

Enumerator
None 
Maybe 
Definite 

Definition at line 33 of file LifetimeSafety.h.

◆ SuggestionScope

Enum to track functions visible across or within TU.

Enumerator
CrossTU 
IntraTU 

Definition at line 40 of file LifetimeSafety.h.

Function Documentation

◆ getDeclWithMergedLifetimeBoundAttrs() [1/2]

const CXXMethodDecl * clang::lifetimes::getDeclWithMergedLifetimeBoundAttrs ( const CXXMethodDecl * CMD)

Definition at line 25 of file LifetimeAnnotations.cpp.

References getDeclWithMergedLifetimeBoundAttrs().

◆ getDeclWithMergedLifetimeBoundAttrs() [2/2]

◆ getLifetimeBoundAttrFromFunctionType()

const LifetimeBoundAttr * clang::lifetimes::getLifetimeBoundAttrFromFunctionType ( const TypeSourceInfo & TSI)
static

Check if a function has a lifetimebound attribute on its function type (which represents the implicit 'this' parameter for methods).

Returns the attribute if found, nullptr otherwise.

Definition at line 59 of file LifetimeAnnotations.cpp.

References clang::TypeLoc::getAsAdjusted(), and clang::TypeSourceInfo::getTypeLoc().

◆ implicitObjectParamIsLifetimeBound()

◆ isAssignmentOperatorLifetimeBound()

◆ isGslOwnerType()

bool clang::lifetimes::isGslOwnerType ( QualType QT)

◆ isGslPointerType()

◆ isInStlNamespace()

◆ isNormalAssignmentOperator()

◆ isPointerLikeType()

◆ isRecordWithAttr()

template<typename T>
bool clang::lifetimes::isRecordWithAttr ( QualType Type)
static

◆ printStats()

◆ runLifetimeSafetyAnalysis()

◆ shouldTrackFirstArgument()

◆ shouldTrackImplicitObjectArg()

bool clang::lifetimes::shouldTrackImplicitObjectArg ( const CXXMethodDecl * Callee,
bool RunningUnderLifetimeSafety )