10#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMEANNOTATIONS_H
11#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMEANNOTATIONS_H
15#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/PointerUnion.h"
17#include "llvm/ADT/SmallVector.h"
50const LifetimeBoundAttr *
55const LifetimeBoundAttr *
64 llvm::PointerUnion<const ParmVarDecl *, const CXXMethodDecl *>;
67 const FunctionDecl *
FD =
nullptr;
77std::optional<LifetimeBoundParamInfo>
83std::optional<LifetimeBoundParamInfo>
93 const CXXMethodDecl *Callee,
94 bool RunningUnderLifetimeSafety);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
bool isInvalidationMethod(const CXXMethodDecl &MD)
bool isStdReferenceCast(const FunctionDecl *FD)
Returns true for std reference-cast builtins (e.g., std::move).
bool isAssignmentOperatorLifetimeBound(const CXXMethodDecl *CMD)
Returns true if this is an assignment operator where the parameter has the lifetimebound attribute.
bool isPointerLikeType(QualType QT)
bool shouldTrackImplicitObjectArg(const Expr &ImplicitObjectArgument, const CXXMethodDecl *Callee, bool RunningUnderLifetimeSafety)
bool implicitObjectParamIsLifetimeBound(const FunctionDecl *FD)
Returns true if the implicit object parameter (this) should be considered lifetimebound,...
std::optional< LifetimeBoundParamInfo > getTrackedArgInfo(const FunctionDecl *FD, llvm::ArrayRef< const Expr * > Args, unsigned I)
Returns the parameter corresponding to argument I when the argument should be tracked for lifetime sa...
bool shouldTrackFirstArgument(const FunctionDecl *FD)
bool shouldTrackSecondArgument(const FunctionDecl *FD)
bool destructsFirstArg(const FunctionDecl &FD)
const FunctionDecl * getDeclWithMergedLifetimeBoundAttrs(const FunctionDecl *FD)
Returns the most recent declaration of the method to ensure all lifetime-bound attributes from redecl...
const LifetimeBoundAttr * getImplicitObjectParamLifetimeBoundAttr(const FunctionDecl *FD)
Returns the lifetimebound attribute for the implicit this parameter, if it exists on any redeclaratio...
std::optional< LifetimeBoundParamInfo > getTrackingInfoForCallArg(const Expr *Call, const Expr *Source)
Returns lifetime safety tracking info for the call argument containing Source.
FunctionCallInfo getFunctionCallInfo(const Expr *Call)
Returns the callee and arguments corresponding to Call.
bool isNormalAssignmentOperator(const FunctionDecl *FD)
bool isUniquePtrRelease(const CXXMethodDecl &MD)
bool isInStlNamespace(const Decl *D)
llvm::PointerUnion< const ParmVarDecl *, const CXXMethodDecl * > LifetimeBoundParamInfo
bool isStdCallableWrapperType(const CXXRecordDecl *RD)
Returns true for standard library callable wrappers (e.g., std::function) that can propagate the stor...
const LifetimeBoundAttr * getDirectImplicitObjectLifetimeBoundAttr(const FunctionDecl *FD)
Returns the lifetimebound attribute for the implicit this parameter, if it exists on the current type...
bool isGslPointerType(QualType QT)
bool isGslOwnerType(QualType QT)
Top level wrappers for InstallAPI frontend operations.
llvm::SmallVector< const Expr *, 4 > Args