clang: clang::sema Namespace Reference (original ) (raw )
Functions
static LifetimeResult
getEntityLifetime (const InitializedEntity *Entity, const InitializedEntity *InitField=nullptr)
Determine the declaration which an initialized entity ultimately refers to, for the purpose of lifetime-extending a temporary bound to a reference in the initialization of Entity.
static bool
isVarOnPath (const IndirectLocalPath &Path , VarDecl *VD)
static bool
pathContainsInit (const IndirectLocalPath &Path )
static void
visitLocalsRetainedByInitializer (IndirectLocalPath &Path , Expr *Init , LocalVisitor Visit, bool RevisitSubinits)
Visit the locals that would be reachable through an object initialized by the prvalue expression Init.
static void
visitLocalsRetainedByReferenceBinding (IndirectLocalPath &Path , Expr *Init , ReferenceKind RK, LocalVisitor Visit)
Visit the locals that would be reachable through a reference bound to the glvalue expression Init.
template<typename T >
static bool
isRecordWithAttr (QualType Type )
bool
isGLSPointerType (QualType QT)
static bool
isPointerLikeType (QualType QT)
static bool
isInStlNamespace (const Decl *D )
static bool
isContainerOfPointer (const RecordDecl *Container)
static bool
isContainerOfOwner (const RecordDecl *Container)
static bool
isStdInitializerListOfPointer (const RecordDecl *RD)
static bool
shouldTrackImplicitObjectArg (const CXXMethodDecl *Callee)
static bool
shouldTrackFirstArgument (const FunctionDecl *FD)
static bool
isCopyLikeConstructor (const CXXConstructorDecl *Ctor)
static bool
shouldTrackFirstArgumentForConstructor (const CXXConstructExpr *Ctor)
static bool
isNormalAssignmentOperator (const FunctionDecl *FD)
static const FunctionDecl *
getDeclWithMergedLifetimeBoundAttrs (const FunctionDecl *FD)
static const CXXMethodDecl *
getDeclWithMergedLifetimeBoundAttrs (const CXXMethodDecl *CMD)
bool
implicitObjectParamIsLifetimeBound (const FunctionDecl *FD)
static void
visitFunctionCallArguments (IndirectLocalPath &Path , Expr *Call , LocalVisitor Visit)
static PathLifetimeKind
shouldLifetimeExtendThroughPath (const IndirectLocalPath &Path )
Determine whether this is an indirect path to a temporary that we are supposed to lifetime-extend along.
static SourceRange
nextPathEntryRange (const IndirectLocalPath &Path , unsigned I, Expr *E )
Find the range for the first interesting entry in the path at or after I.
static bool
pathOnlyHandlesGslPointer (const IndirectLocalPath &Path )
static AnalysisResult
analyzePathForGSLPointer (const IndirectLocalPath &Path , Local L, LifetimeKind LK)
static bool
isAssignmentOperatorLifetimeBound (const CXXMethodDecl *CMD)
static bool
shouldRunGSLAssignmentAnalysis (const Sema &SemaRef, const AssignedEntity &Entity)
static void
checkExprLifetimeImpl (Sema &SemaRef, const InitializedEntity *InitEntity, const InitializedEntity *ExtendingEntity, LifetimeKind LK, const AssignedEntity *AEntity, const CapturingEntity *CapEntity, Expr *Init )
void
checkInitLifetime (Sema &SemaRef, const InitializedEntity &Entity, Expr *Init )
Check that the lifetime of the given expr (and its subobjects) is sufficient for initializing the entity, and perform lifetime extension (when permitted) if not.
void
checkExprLifetimeMustTailArg (Sema &SemaRef, const InitializedEntity &Entity, Expr *Init )
Check that the lifetime of the given expr (and its subobjects) is sufficient, assuming that it is passed as an argument to a musttail function.
void
checkAssignmentLifetime (Sema &SemaRef, const AssignedEntity &Entity, Expr *Init )
Check that the lifetime of the given expr (and its subobjects) is sufficient for assigning to the entity.
void
checkCaptureByLifetime (Sema &SemaRef, const CapturingEntity &Entity, Expr *Init )
Attr *
instantiateTemplateAttribute (const Attr *At, ASTContext &C , Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs)
Attr *
instantiateTemplateAttributeForDecl (const Attr *At, ASTContext &C , Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs)
◆ AnalysisResult◆ FirstCoroutineStmtKind
Enumerator
CoReturn
CoAwait
CoYield
Definition at line 100 of file ScopeInfo.h .
◆ PathLifetimeKindWhether a path to an object supports lifetime extension.
Enumerator
Extend
Lifetime-extend along this path.
NoExtend
Do not lifetime extend along this path.
Definition at line 1099 of file CheckExprLifetime.cpp .
◆ analyzePathForGSLPointer()
static AnalysisResult clang::sema::analyzePathForGSLPointer ( const IndirectLocalPath & Path , Local L , LifetimeKind LK )
static
Definition at line 1190 of file CheckExprLifetime.cpp .
References Abandon , E , clang::Type::getPointeeType() , clang::FunctionDecl::getReturnType() , isPointerLikeType() , clang::Type::isReferenceType() , NotGSLPointer , Path , pathContainsInit() , pathOnlyHandlesGslPointer() , Report , and Skip .
Referenced by checkExprLifetimeImpl() .
◆ checkAssignmentLifetime()◆ checkCaptureByLifetime()◆ checkExprLifetimeImpl()Definition at line 1294 of file CheckExprLifetime.cpp .
References Abandon , clang::InitializedEntity::allocateManglingNumber() , analyzePathForGSLPointer() , clang::sema::AssignedEntity::AssignmentOperator , clang::SemaBase::Diag() , clang::sema::CapturingEntity::Entity , Extend , clang::SourceRange::getBegin() , clang::InitializedEntity::getDecl() , clang::NamedDecl::getDeclName() , clang::ParmVarDecl::getDefaultArgRange() , clang::Sema::getLangOpts() , clang::Decl::getLocation() , clang::InitializedEntity::getParent() , clang::ValueDecl::getType() , clang::Expr::getType() , clang::InitializedEntity::getType() , clang::Init , isAssignmentOperatorLifetimeBound() , clang::Decl::isImplicit() , clang::ValueDecl::isInitCapture() , isPointerLikeType() , clang::Type::isPointerType() , clang::Type::isReferenceType() , clang::SourceLocation::isValid() , clang::LCK_ByRef , clang::sema::AssignedEntity::LHS , clang::Member , nextPathEntryRange() , NoExtend , NotGSLPointer , Path , pathContainsInit() , Report , shouldLifetimeExtendThroughPath() , shouldRunGSLAssignmentAnalysis() , and Skip .
Referenced by checkAssignmentLifetime() , checkCaptureByLifetime() , checkExprLifetimeMustTailArg() , and checkInitLifetime() .
◆ checkExprLifetimeMustTailArg()◆ checkInitLifetime()◆ getDeclWithMergedLifetimeBoundAttrs() [1/2]◆ getDeclWithMergedLifetimeBoundAttrs() [2/2]◆ getEntityLifetime()Determine the declaration which an initialized entity ultimately refers to, for the purpose of lifetime-extending a temporary bound to a reference in the initialization of Entity
.
Definition at line 66 of file CheckExprLifetime.cpp .
References clang::InitializedEntity::EK_ArrayElement , clang::InitializedEntity::EK_Base , clang::InitializedEntity::EK_Binding , clang::InitializedEntity::EK_BlockElement , clang::InitializedEntity::EK_ComplexElement , clang::InitializedEntity::EK_CompoundLiteralInit , clang::InitializedEntity::EK_Delegating , clang::InitializedEntity::EK_Exception , clang::InitializedEntity::EK_LambdaCapture , clang::InitializedEntity::EK_LambdaToBlockConversionBlockElement , clang::InitializedEntity::EK_Member , clang::InitializedEntity::EK_New , clang::InitializedEntity::EK_Parameter , clang::InitializedEntity::EK_Parameter_CF_Audited , clang::InitializedEntity::EK_ParenAggInitMember , clang::InitializedEntity::EK_RelatedResult , clang::InitializedEntity::EK_Result , clang::InitializedEntity::EK_StmtExprResult , clang::InitializedEntity::EK_TemplateParameter , clang::InitializedEntity::EK_Temporary , clang::InitializedEntity::EK_Variable , clang::InitializedEntity::EK_VectorElement , getEntityLifetime() , clang::InitializedEntity::getKind() , clang::InitializedEntity::getParent() , and clang::InitializedEntity::isDefaultMemberInitializer() .
Referenced by checkInitLifetime() , and getEntityLifetime() .
◆ implicitObjectParamIsLifetimeBound()◆ instantiateTemplateAttribute()◆ instantiateTemplateAttributeForDecl()◆ isAssignmentOperatorLifetimeBound()
static bool clang::sema::isAssignmentOperatorLifetimeBound ( const CXXMethodDecl * CMD )
static
◆ isContainerOfOwner()
static bool clang::sema::isContainerOfOwner ( const RecordDecl * Container )
static
◆ isContainerOfPointer()
static bool clang::sema::isContainerOfPointer ( const RecordDecl * Container )
static
◆ isCopyLikeConstructor()◆ isGLSPointerType()◆ isInStlNamespace()
static bool clang::sema::isInStlNamespace ( const Decl * D )
static
◆ isNormalAssignmentOperator()
static bool clang::sema::isNormalAssignmentOperator ( const FunctionDecl * FD )
static
◆ isPointerLikeType()
static bool clang::sema::isPointerLikeType ( QualType QT )
static
◆ isRecordWithAttr()template<typename T >
static bool clang::sema::isRecordWithAttr ( QualType Type )
static
◆ isStdInitializerListOfPointer()
static bool clang::sema::isStdInitializerListOfPointer ( const RecordDecl * RD )
static
◆ isVarOnPath()
static bool clang::sema::isVarOnPath ( const IndirectLocalPath & Path , VarDecl * VD )
static
◆ nextPathEntryRange()◆ pathContainsInit()
static bool clang::sema::pathContainsInit ( const IndirectLocalPath & Path )
static
◆ pathOnlyHandlesGslPointer()
static bool clang::sema::pathOnlyHandlesGslPointer ( const IndirectLocalPath & Path )
static
◆ shouldLifetimeExtendThroughPath()
static PathLifetimeKind clang::sema::shouldLifetimeExtendThroughPath ( const IndirectLocalPath & Path )
static
◆ shouldRunGSLAssignmentAnalysis()
static bool clang::sema::shouldRunGSLAssignmentAnalysis ( const Sema & SemaRef , const AssignedEntity & Entity )
static
◆ shouldTrackFirstArgument()
static bool clang::sema::shouldTrackFirstArgument ( const FunctionDecl * FD )
static
◆ shouldTrackFirstArgumentForConstructor()
static bool clang::sema::shouldTrackFirstArgumentForConstructor ( const CXXConstructExpr * Ctor )
static
Definition at line 432 of file CheckExprLifetime.cpp .
References clang::CXXConstructExpr::getArg() , clang::Type::getAsRecordDecl() , clang::CXXConstructExpr::getConstructor() , clang::CXXMethodDecl::getParent() , clang::FunctionDecl::getPrimaryTemplate() , clang::Expr::getType() , isContainerOfOwner() , isContainerOfPointer() , isCopyLikeConstructor() , isStdInitializerListOfPointer() , and clang::FunctionDecl::param_empty() .
Referenced by visitFunctionCallArguments() .
◆ shouldTrackImplicitObjectArg()
static bool clang::sema::shouldTrackImplicitObjectArg ( const CXXMethodDecl * Callee )
static
◆ visitFunctionCallArguments()
static void clang::sema::visitFunctionCallArguments ( IndirectLocalPath & Path , Expr * Call , LocalVisitor Visit )
static
Definition at line 561 of file CheckExprLifetime.cpp .
References clang::Call , clang::Sema::CanBeGetReturnObject() , D , clang::Decl::getAttr() , getDeclWithMergedLifetimeBoundAttrs() , clang::FunctionDecl::getNumParams() , clang::FunctionDecl::getParamDecl() , clang::Decl::hasAttr() , clang::Expr::IgnoreImplicit() , implicitObjectParamIsLifetimeBound() , Path , shouldTrackFirstArgument() , shouldTrackFirstArgumentForConstructor() , shouldTrackImplicitObjectArg() , visitLocalsRetainedByInitializer() , and visitLocalsRetainedByReferenceBinding() .
Referenced by visitLocalsRetainedByInitializer() , and visitLocalsRetainedByReferenceBinding() .
◆ visitLocalsRetainedByInitializer()
static void clang::sema::visitLocalsRetainedByInitializer ( IndirectLocalPath & Path , Expr * Init , LocalVisitor Visit , bool RevisitSubinits )
static
Visit the locals that would be reachable through an object initialized by the prvalue expression Init
.
Definition at line 833 of file CheckExprLifetime.cpp .
References clang::C , clang::LambdaCapture::capturesVariable() , E , clang::Init , isVarOnPath() , Path , visitFunctionCallArguments() , visitLocalsRetainedByInitializer() , and visitLocalsRetainedByReferenceBinding() .
Referenced by visitFunctionCallArguments() , visitLocalsRetainedByInitializer() , and visitLocalsRetainedByReferenceBinding() .
◆ visitLocalsRetainedByReferenceBinding()
static void clang::sema::visitLocalsRetainedByReferenceBinding ( IndirectLocalPath & Path , Expr * Init , ReferenceKind RK , LocalVisitor Visit )
static