|
clang 24.0.0git
|
Classes | |
| struct | FunctionCallInfo |
| Stores the callee and normalized arguments for a function call. More... | |
Typedefs | |
| using | LifetimeBoundParamInfo |
Functions | |
| bool | isInStlNamespace (const Decl *D) |
| bool | isPointerLikeType (QualType QT) |
| const FunctionDecl * | getDeclWithMergedLifetimeBoundAttrs (const FunctionDecl *FD) |
| Returns the most recent declaration of the method to ensure all lifetime-bound attributes from redeclarations are considered. | |
| const CXXMethodDecl * | getDeclWithMergedLifetimeBoundAttrs (const CXXMethodDecl *CMD) |
| Returns the most recent declaration of the method to ensure all lifetime-bound attributes from redeclarations are considered. | |
| bool | isNormalAssignmentOperator (const FunctionDecl *FD) |
| bool | isAssignmentOperatorLifetimeBound (const CXXMethodDecl *CMD) |
| Returns true if this is an assignment operator where the parameter has the lifetimebound attribute. | |
| const LifetimeBoundAttr * | getDirectImplicitObjectLifetimeBoundAttr (const FunctionDecl *FD) |
| Returns the lifetimebound attribute for the implicit this parameter, if it exists on the current type. | |
| const LifetimeBoundAttr * | getImplicitObjectParamLifetimeBoundAttr (const FunctionDecl *FD) |
| Returns the lifetimebound attribute for the implicit this parameter, if it exists on any redeclaration. | |
| bool | implicitObjectParamIsLifetimeBound (const FunctionDecl *FD) |
| Returns true if the implicit object parameter (this) should be considered lifetimebound, either due to an explicit lifetimebound attribute on the method or because it's a normal assignment operator. | |
| bool | paramIsLifetimeBound (const ParmVarDecl &PVD) |
Returns true if PVD should be considered lifetimebound, either due to an explicit lifetimebound attribute or because it is a constructor parameter marked lifetime_capture_by(this), which has the same meaning. | |
| const LifetimeCaptureByAttr * | getCaptureByAttrFromFunctionType (const FunctionDecl *FD) |
| Check if a function has a lifetime_capture_by attribute on its declaration or its function type (which represents the implicit 'this' parameter for methods). | |
| bool | hasObjectArg (const FunctionDecl &FD) |
Returns true if argument 0 of a call to FD (as listed by FunctionCallInfo) is the object argument, bound either to the implicit object parameter or to an explicit object parameter. | |
| bool | hasImplicitObjectArg (const FunctionDecl &FD) |
Returns true if argument 0 of a call to FD is the implicit object argument. | |
| const ParmVarDecl * | getParamForArg (const FunctionDecl &FD, unsigned I) |
Returns the parameter that argument I of a call to FD binds to, or null for the implicit object argument and for variadic arguments. | |
| 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 safety. | |
| std::optional< LifetimeBoundParamInfo > | getTrackingInfoForCallArg (const Expr *Call, const Expr *Source) |
| Returns lifetime safety tracking info for the call argument containing Source. | |
| bool | shouldTrackImplicitObjectArg (const Expr &ImplicitObjectArgument, const CXXMethodDecl *Callee, bool RunningUnderLifetimeSafety) |
| bool | shouldTrackFirstArgument (const FunctionDecl *FD) |
| bool | shouldTrackSecondArgument (const FunctionDecl *FD) |
| bool | isGslPointerType (QualType QT) |
| bool | isGslOwnerType (QualType QT) |
| bool | isGslOwnerType (const CXXRecordDecl *RD) |
| bool | isOwnerPtrCtor (const CXXConstructorDecl *Ctor, const ParmVarDecl *PVD) |
| bool | isUniquePtrRelease (const CXXMethodDecl &MD) |
| bool | isInvalidationMethod (const CXXMethodDecl &MD) |
| bool | destructsFirstArg (const FunctionDecl &FD) |
| bool | isAllocatingFunction (const FunctionDecl &FD) |
| Returns true if the function allocates memory that must be freed by the caller (e.g. | |
| bool | isFreeingFunction (const FunctionDecl &FD) |
| Returns true if the function frees memory it takes ownership of (e.g. | |
| bool | isStdCallableWrapperType (const CXXRecordDecl *RD) |
| Returns true for standard library callable wrappers (e.g., std::function) that can propagate the stored lambda's origins. | |
| bool | isStdReferenceCast (const FunctionDecl *FD) |
| Returns true for std reference-cast builtins (e.g., std::move). | |
| const Expr * | ignoreParensAndImpCasts (const Expr *E) |
| Skips parentheses and implicit casts. | |
| using clang ::lifetimes::LifetimeBoundParamInfo |
Definition at line 78 of file LifetimeAnnotations.h.
| bool clang ::lifetimes::destructsFirstArg | ( | const FunctionDecl & | FD | ) |
References destructsFirstArg().
Referenced by destructsFirstArg().
| const LifetimeCaptureByAttr * clang ::lifetimes::getCaptureByAttrFromFunctionType | ( | const FunctionDecl * | FD | ) |
Check if a function has a lifetime_capture_by attribute on its declaration or its function type (which represents the implicit 'this' parameter for methods).
Returns the attribute if found, nullptr otherwise.
References getCaptureByAttrFromFunctionType().
Referenced by getCaptureByAttrFromFunctionType().
| const CXXMethodDecl * clang ::lifetimes::getDeclWithMergedLifetimeBoundAttrs | ( | const CXXMethodDecl * | CMD | ) |
Returns the most recent declaration of the method to ensure all lifetime-bound attributes from redeclarations are considered.
References getDeclWithMergedLifetimeBoundAttrs().
| const FunctionDecl * clang ::lifetimes::getDeclWithMergedLifetimeBoundAttrs | ( | const FunctionDecl * | FD | ) |
Returns the most recent declaration of the method to ensure all lifetime-bound attributes from redeclarations are considered.
References getDeclWithMergedLifetimeBoundAttrs().
Referenced by getDeclWithMergedLifetimeBoundAttrs(), and getDeclWithMergedLifetimeBoundAttrs().
| const LifetimeBoundAttr * clang ::lifetimes::getDirectImplicitObjectLifetimeBoundAttr | ( | const FunctionDecl * | FD | ) |
Returns the lifetimebound attribute for the implicit this parameter, if it exists on the current type.
References getDirectImplicitObjectLifetimeBoundAttr().
Referenced by getDirectImplicitObjectLifetimeBoundAttr().
| const LifetimeBoundAttr * clang ::lifetimes::getImplicitObjectParamLifetimeBoundAttr | ( | const FunctionDecl * | FD | ) |
Returns the lifetimebound attribute for the implicit this parameter, if it exists on any redeclaration.
References getImplicitObjectParamLifetimeBoundAttr().
Referenced by getImplicitObjectParamLifetimeBoundAttr().
| const ParmVarDecl * clang ::lifetimes::getParamForArg | ( | const FunctionDecl & | FD, |
| unsigned | I ) |
Returns the parameter that argument I of a call to FD binds to, or null for the implicit object argument and for variadic arguments.
References getParamForArg().
Referenced by getParamForArg().
| std::optional< LifetimeBoundParamInfo > clang ::lifetimes::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 safety.
References getTrackedArgInfo().
Referenced by getTrackedArgInfo().
| std::optional< LifetimeBoundParamInfo > clang ::lifetimes::getTrackingInfoForCallArg | ( | const Expr * | Call, |
| const Expr * | Source ) |
Returns lifetime safety tracking info for the call argument containing Source.
References Call, and getTrackingInfoForCallArg().
Referenced by getTrackingInfoForCallArg().
| bool clang ::lifetimes::hasImplicitObjectArg | ( | const FunctionDecl & | FD | ) |
Returns true if argument 0 of a call to FD is the implicit object argument.
An explicit object parameter is an ordinary parameter.
References hasImplicitObjectArg().
Referenced by hasImplicitObjectArg().
| bool clang ::lifetimes::hasObjectArg | ( | const FunctionDecl & | FD | ) |
Returns true if argument 0 of a call to FD (as listed by FunctionCallInfo) is the object argument, bound either to the implicit object parameter or to an explicit object parameter.
Constructors have no object argument.
References hasObjectArg().
Referenced by hasObjectArg().
| const Expr * clang ::lifetimes::ignoreParensAndImpCasts | ( | const Expr * | E | ) |
Skips parentheses and implicit casts.
Unlike IgnoreParenImpCasts(), stops at a MaterializeTemporaryExpr, which owns the storage of a temporary.
References ignoreParensAndImpCasts().
Referenced by ignoreParensAndImpCasts().
| bool clang ::lifetimes::implicitObjectParamIsLifetimeBound | ( | const FunctionDecl * | FD | ) |
Returns true if the implicit object parameter (this) should be considered lifetimebound, either due to an explicit lifetimebound attribute on the method or because it's a normal assignment operator.
References implicitObjectParamIsLifetimeBound().
Referenced by implicitObjectParamIsLifetimeBound().
| bool clang ::lifetimes::isAllocatingFunction | ( | const FunctionDecl & | FD | ) |
Returns true if the function allocates memory that must be freed by the caller (e.g.
functions annotated with ownership_returns, such as __attribute__((ownership_returns(malloc)))).
References isAllocatingFunction().
Referenced by isAllocatingFunction().
| bool clang ::lifetimes::isAssignmentOperatorLifetimeBound | ( | const CXXMethodDecl * | CMD | ) |
Returns true if this is an assignment operator where the parameter has the lifetimebound attribute.
References isAssignmentOperatorLifetimeBound().
Referenced by isAssignmentOperatorLifetimeBound().
| bool clang ::lifetimes::isFreeingFunction | ( | const FunctionDecl & | FD | ) |
Returns true if the function frees memory it takes ownership of (e.g.
functions annotated with ownership_takes, such as __attribute__((ownership_takes(malloc, 1)))).
References isFreeingFunction().
Referenced by isFreeingFunction().
| bool clang ::lifetimes::isGslOwnerType | ( | const CXXRecordDecl * | RD | ) |
| bool clang ::lifetimes::isGslOwnerType | ( | QualType | QT | ) |
| bool clang ::lifetimes::isGslPointerType | ( | QualType | QT | ) |
| bool clang ::lifetimes::isInStlNamespace | ( | const Decl * | D | ) |
References isInStlNamespace().
Referenced by isInStlNamespace().
| bool clang ::lifetimes::isInvalidationMethod | ( | const CXXMethodDecl & | MD | ) |
References isInvalidationMethod().
Referenced by isInvalidationMethod().
| bool clang ::lifetimes::isNormalAssignmentOperator | ( | const FunctionDecl * | FD | ) |
References isNormalAssignmentOperator().
Referenced by isNormalAssignmentOperator().
| bool clang ::lifetimes::isOwnerPtrCtor | ( | const CXXConstructorDecl * | Ctor, |
| const ParmVarDecl * | PVD ) |
References isOwnerPtrCtor().
Referenced by isOwnerPtrCtor().
| bool clang ::lifetimes::isPointerLikeType | ( | QualType | QT | ) |
References isPointerLikeType().
Referenced by isPointerLikeType().
| bool clang ::lifetimes::isStdCallableWrapperType | ( | const CXXRecordDecl * | RD | ) |
Returns true for standard library callable wrappers (e.g., std::function) that can propagate the stored lambda's origins.
References isStdCallableWrapperType().
Referenced by isStdCallableWrapperType().
| bool clang ::lifetimes::isStdReferenceCast | ( | const FunctionDecl * | FD | ) |
Returns true for std reference-cast builtins (e.g., std::move).
Their result refers to the same object as the argument, so all origins propagate from argument to result.
References isStdReferenceCast().
Referenced by isStdReferenceCast().
| bool clang ::lifetimes::isUniquePtrRelease | ( | const CXXMethodDecl & | MD | ) |
References isUniquePtrRelease().
Referenced by isUniquePtrRelease().
| bool clang ::lifetimes::paramIsLifetimeBound | ( | const ParmVarDecl & | PVD | ) |
Returns true if PVD should be considered lifetimebound, either due to an explicit lifetimebound attribute or because it is a constructor parameter marked lifetime_capture_by(this), which has the same meaning.
References paramIsLifetimeBound().
Referenced by paramIsLifetimeBound().
| bool clang ::lifetimes::shouldTrackFirstArgument | ( | const FunctionDecl * | FD | ) |
References shouldTrackFirstArgument().
Referenced by shouldTrackFirstArgument().
| bool clang ::lifetimes::shouldTrackImplicitObjectArg | ( | const Expr & | ImplicitObjectArgument, |
| const CXXMethodDecl * | Callee, | ||
| bool | RunningUnderLifetimeSafety ) |
References shouldTrackImplicitObjectArg().
Referenced by shouldTrackImplicitObjectArg().
| bool clang ::lifetimes::shouldTrackSecondArgument | ( | const FunctionDecl * | FD | ) |
References shouldTrackSecondArgument().
Referenced by shouldTrackSecondArgument().