Lines Matching refs:Entity

196 static bool initializingConstexprVariable(const InitializedEntity &Entity) {  in initializingConstexprVariable()  argument
197 Decl *D = Entity.getDecl(); in initializingConstexprVariable()
198 const InitializedEntity *Parent = &Entity; in initializingConstexprVariable()
326 void CheckImplicitInitList(const InitializedEntity &Entity,
330 void CheckExplicitInitList(const InitializedEntity &Entity,
334 void CheckListElementTypes(const InitializedEntity &Entity,
341 void CheckSubElementType(const InitializedEntity &Entity,
347 void CheckComplexType(const InitializedEntity &Entity,
352 void CheckScalarType(const InitializedEntity &Entity,
357 void CheckReferenceType(const InitializedEntity &Entity,
362 void CheckVectorType(const InitializedEntity &Entity,
366 void CheckStructUnionTypes(const InitializedEntity &Entity,
374 void CheckArrayType(const InitializedEntity &Entity,
380 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
408 const InitializedEntity &Entity);
497 void FillInEmptyInitializations(const InitializedEntity &Entity,
501 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
504 void CheckEmptyInitializable(const InitializedEntity &Entity,
507 Expr *HandleEmbed(EmbedExpr *Embed, const InitializedEntity &Entity) { in HandleEmbed() argument
517 if (Entity.getKind() == InitializedEntity::EK_ArrayElement) { in HandleEmbed()
519 SemaRef.Context.getAsArrayType(Entity.getParent()->getType()); in HandleEmbed()
545 Sema &S, const InitializedEntity &Entity, InitListExpr *IL, QualType &T,
549 InitListChecker(Sema &S, const InitializedEntity &Entity, InitListExpr *IL, in InitListChecker() argument
552 : InitListChecker(S, Entity, IL, T, /*VerifyOnly=*/true, in InitListChecker()
567 const InitializedEntity &Entity) { in PerformEmptyInit() argument
579 Entity.getType()->getBaseElementTypeUnsafe()->isRecordType(); in PerformEmptyInit()
603 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
637 SemaRef, Entity, in PerformEmptyInit()
646 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
647 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
649 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) in PerformEmptyInit()
657 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
658 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
659 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
661 << /*field*/1 << Entity.getDecl(); in PerformEmptyInit()
662 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) { in PerformEmptyInit()
664 Entity.getParent() && in PerformEmptyInit()
665 Entity.getParent()->isVariableLengthArrayNew(); in PerformEmptyInit()
668 << Entity.getElementIndex(); in PerformEmptyInit()
676 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
679 void InitListChecker::CheckEmptyInitializable(const InitializedEntity &Entity, in CheckEmptyInitializable() argument
686 PerformEmptyInit(Loc, Entity); in CheckEmptyInitializable()
819 InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, in FillInEmptyInitializations() argument
857 FillInEmptyInitForField(0, ILE->getInitializedFieldInUnion(), Entity, ILE, in FillInEmptyInitializations()
879 FillInEmptyInitForBase(Init, Base, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
892 FillInEmptyInitForField(Init, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
910 InitializedEntity ElementEntity = Entity; in FillInEmptyInitializations()
919 if (Entity.isVariableLengthArrayNew()) in FillInEmptyInitializations()
922 0, Entity); in FillInEmptyInitializations()
927 0, Entity); in FillInEmptyInitializations()
1016 Sema &S, const InitializedEntity &Entity, InitListExpr *IL, QualType &T, in InitListChecker() argument
1033 CheckExplicitInitList(Entity, IL, T, FullyStructuredList, in InitListChecker()
1038 FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass, in InitListChecker()
1041 FillInEmptyInitializations(Entity, FullyStructuredList, in InitListChecker()
1082 static bool isIdiomaticBraceElisionEntity(const InitializedEntity &Entity) { in isIdiomaticBraceElisionEntity() argument
1091 if (!Entity.getParent()) in isIdiomaticBraceElisionEntity()
1095 if (Entity.getKind() == InitializedEntity::EK_Base) { in isIdiomaticBraceElisionEntity()
1097 Entity.getParent()->getType()->castAs<RecordType>()->getDecl(); in isIdiomaticBraceElisionEntity()
1103 if (Entity.getKind() == InitializedEntity::EK_Member) { in isIdiomaticBraceElisionEntity()
1105 Entity.getParent()->getType()->castAs<RecordType>()->getDecl(); in isIdiomaticBraceElisionEntity()
1126 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity, in CheckImplicitInitList() argument
1160 CheckListElementTypes(Entity, ParentIList, T, in CheckImplicitInitList()
1181 !isIdiomaticBraceElisionEntity(Entity)) { in CheckImplicitInitList()
1205 static void warnBracedScalarInit(Sema &S, const InitializedEntity &Entity, in warnBracedScalarInit() argument
1215 switch (Entity.getKind()) { in warnBracedScalarInit()
1231 if (Entity.getParent()) in warnBracedScalarInit()
1263 << Entity.getType()->isSizelessBuiltinType() << Braces in warnBracedScalarInit()
1274 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity, in CheckExplicitInitList() argument
1279 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true, in CheckExplicitInitList()
1332 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange()); in CheckExplicitInitList()
1355 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity, in CheckListElementTypes() argument
1366 CheckComplexType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1369 CheckScalarType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1372 CheckVectorType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1386 CheckStructUnionTypes(Entity, IList, DeclType, Bases, RD->field_begin(), in CheckListElementTypes()
1393 CheckArrayType(Entity, IList, DeclType, Zero, in CheckListElementTypes()
1404 CheckReferenceType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1413 CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckListElementTypes()
1430 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, in CheckSubElementType() argument
1440 return CheckReferenceType(Entity, IList, ElemType, Index, in CheckSubElementType()
1475 (ElemType->isExtVectorType() && !Entity.getType()->isExtVectorType()) in CheckSubElementType()
1477 : Entity; in CheckSubElementType()
1516 expr = HandleEmbed(Embed, Entity); in CheckSubElementType()
1542 return CheckScalarType(Entity, IList, ElemType, Index, in CheckSubElementType()
1555 initializingConstexprVariable(Entity)); in CheckSubElementType()
1604 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList, in CheckSubElementType()
1627 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr, in CheckSubElementType()
1639 void InitListChecker::CheckComplexType(const InitializedEntity &Entity, in CheckComplexType() argument
1654 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckComplexType()
1666 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckComplexType()
1675 void InitListChecker::CheckScalarType(const InitializedEntity &Entity, in CheckScalarType() argument
1712 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList, in CheckScalarType()
1726 expr = HandleEmbed(Embed, Entity); in CheckScalarType()
1731 if (SemaRef.CanPerformCopyInitialization(Entity, expr)) in CheckScalarType()
1737 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckScalarType()
1762 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity, in CheckReferenceType() argument
1795 if (SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckReferenceType()
1801 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckReferenceType()
1819 void InitListChecker::CheckVectorType(const InitializedEntity &Entity, in CheckVectorType() argument
1832 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckVectorType()
1844 if (SemaRef.CanPerformCopyInitialization(Entity, Init)) in CheckVectorType()
1850 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init, in CheckVectorType()
1874 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1892 const VectorType *T = Entity.getType()->castAs<VectorType>(); in CheckVectorType()
1931 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1998 const InitializedEntity &Entity, in canInitializeArrayWithEmbedDataString() argument
2000 QualType InitType = Entity.getType(); in canInitializeArrayWithEmbedDataString()
2001 const InitializedEntity *Parent = &Entity; in canInitializeArrayWithEmbedDataString()
2029 void InitListChecker::CheckArrayType(const InitializedEntity &Entity, in CheckArrayType() argument
2046 if (canInitializeArrayWithEmbedDataString(IList->inits(), Entity, in CheckArrayType()
2065 initializingConstexprVariable(Entity)); in CheckArrayType()
2127 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckArrayType()
2155 SemaRef.Context, StructuredIndex, Entity); in CheckArrayType()
2182 if (maxElements == Zero && !Entity.isVariableLengthArrayNew()) { in CheckArrayType()
2197 Entity.isVariableLengthArrayNew()) in CheckArrayType()
2199 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckArrayType()
2204 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity, in CheckFlexibleArrayInit() argument
2217 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in CheckFlexibleArrayInit()
2220 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) { in CheckFlexibleArrayInit()
2239 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, in CheckStructUnionTypes() argument
2289 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2341 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
2385 Entity, IList, DIE, 0, DeclType, &Field, nullptr, Index, in CheckStructUnionTypes()
2479 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2528 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2552 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, in CheckStructUnionTypes()
2560 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2682 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, in CheckDesignatedInitializer() argument
2705 InitializationSequence Seq(SemaRef, Entity, Kind, Init, in CheckDesignatedInitializer()
2710 : Seq.Perform(SemaRef, Entity, Kind, Init); in CheckDesignatedInitializer()
2729 CheckSubElementType(Entity, IList, CurrentObjectType, Index, StructuredList, in CheckDesignatedInitializer()
3037 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field, in CheckDesignatedInitializer()
3053 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
3072 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
3111 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field, in CheckDesignatedInitializer()
3274 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
3308 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex, in CheckDesignatedInitializer()
3442 const InitializedEntity &Entity, InitListExpr *From) { in CanPerformAggregateInitializationForOverloadResolution() argument
3443 QualType Type = Entity.getType(); in CanPerformAggregateInitializationForOverloadResolution()
3444 InitListChecker Check(*this, Entity, From, Type, /*VerifyOnly=*/true, in CanPerformAggregateInitializationForOverloadResolution()
4120 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
4121 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
4124 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
4132 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
4141 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
4146 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
4147 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
4150 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
4152 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
4158 } else if (Entity.getKind() == InitializedEntity::EK_Result || in MaybeProduceObjCObject()
4159 Entity.getKind() == InitializedEntity::EK_StmtExprResult) { in MaybeProduceObjCObject()
4160 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
4163 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
4168 const InitializedEntity &Entity,
4342 const InitializedEntity &Entity, in TryConstructorInitialization() argument
4365 !(Entity.getKind() != InitializedEntity::EK_Base && in TryConstructorInitialization()
4366 Entity.getKind() != InitializedEntity::EK_Delegating && in TryConstructorInitialization()
4367 Entity.getKind() != in TryConstructorInitialization()
4469 Sequence.RewrapReferenceInitList(Entity.getType(), ILE); in TryConstructorInitialization()
4485 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
4487 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
4549 const InitializedEntity &Entity,
4560 const InitializedEntity &Entity,
4567 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
4578 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
4583 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
4610 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
4670 const InitializedEntity &Entity, in TryListInitialization() argument
4675 QualType DestType = Entity.getType(); in TryListInitialization()
4685 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
4730 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4747 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4755 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4774 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
4787 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4835 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4864 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4868 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4873 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
4887 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryRefInitWithConversionFunction() argument
4890 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
5067 const InitializedEntity &Entity,
5071 static void TryReferenceInitialization(Sema &S, const InitializedEntity &Entity, in TryReferenceInitialization() argument
5076 QualType DestType = Entity.getType(); in TryReferenceInitialization()
5092 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
5110 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
5119 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
5189 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef, in TryReferenceInitializationCore()
5280 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
5331 S, Entity, Kind, Initializer, /*AllowRValues*/ true, in TryReferenceInitializationCore()
5434 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
5438 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
5443 const InitializedEntity &Entity, in TryValueInitialization() argument
5453 QualType T = Entity.getType(); in TryValueInitialization()
5484 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5512 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax); in TryValueInitialization()
5516 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5521 const InitializedEntity &Entity, in TryDefaultInitialization() argument
5529 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
5535 TryConstructorInitialization(S, Entity, Kind, std::nullopt, DestType, in TryDefaultInitialization()
5536 Entity.getType(), Sequence); in TryDefaultInitialization()
5546 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
5553 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
5559 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryOrBuildParenListInitialization() argument
5601 S.getASTContext().getAsArrayType(Entity.getType())) { in TryOrBuildParenListInitialization()
5610 S.getASTContext().getAsConstantArrayType(Entity.getType())) { in TryOrBuildParenListInitialization()
5612 ResultType = Entity.getType(); in TryOrBuildParenListInitialization()
5614 S.getASTContext().getAsVariableArrayType(Entity.getType())) { in TryOrBuildParenListInitialization()
5624 assert(Entity.getType()->isIncompleteArrayType()); in TryOrBuildParenListInitialization()
5633 S.getASTContext(), EntityIndexToProcess, Entity); in TryOrBuildParenListInitialization()
5640 if (ArrayLength > Args.size() || Entity.isVariableLengthArrayNew()) { in TryOrBuildParenListInitialization()
5642 S.getASTContext(), Args.size(), Entity); in TryOrBuildParenListInitialization()
5654 } else if (auto *RT = Entity.getType()->getAs<RecordType>()) { in TryOrBuildParenListInitialization()
5669 S.getASTContext(), &Base, false, &Entity); in TryOrBuildParenListInitialization()
5774 ResultType = Entity.getType(); in TryOrBuildParenListInitialization()
5782 QualType T = Entity.getType(); in TryOrBuildParenListInitialization()
5794 Sequence.AddParenthesizedListInitStep(Entity.getType()); in TryOrBuildParenListInitialization()
6002 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
6005 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
6006 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
6119 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
6132 if (!S.ObjC().isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
6139 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
6160 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
6225 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in InitializationSequence() argument
6229 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
6246 static bool canPerformArrayCopy(const InitializedEntity &Entity) { in canPerformArrayCopy() argument
6247 switch (Entity.getKind()) { in canPerformArrayCopy()
6258 return isa<DecompositionDecl>(Entity.getDecl()); in canPerformArrayCopy()
6264 return Entity.isImplicitMemberInitializer(); in canPerformArrayCopy()
6269 if (auto *E = Entity.getParent()) in canPerformArrayCopy()
6281 const InitializedEntity &Entity, in InitializeFrom() argument
6309 QualType DestType = Entity.getType(); in InitializeFrom()
6339 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
6361 TryReferenceInitialization(S, Entity, Kind, Args[0], *this, in InitializeFrom()
6369 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
6375 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
6396 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
6422 Entity.getType()) && in InitializeFrom()
6423 canPerformArrayCopy(Entity)) { in InitializeFrom()
6432 InitializedEntity::InitializeElement(S.Context, 0, Entity); in InitializeFrom()
6442 AddArrayInitLoopStep(Entity.getType(), InitEltT); in InitializeFrom()
6465 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
6467 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
6472 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this, in InitializeFrom()
6487 Entity.isParameterKind(); in InitializeFrom()
6498 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
6507 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6524 TryConstructorInitialization(S, Entity, Kind, Args, DestType, DestType, in InitializeFrom()
6556 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this, in InitializeFrom()
6634 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6636 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
6674 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
6690 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) in InitializeFrom()
6691 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
6705 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6718 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
6719 switch(Entity.getKind()) { in getAssignmentAction()
6728 if (Entity.getDecl() && in getAssignmentAction()
6729 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6735 if (Entity.getDecl() && in getAssignmentAction()
6736 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6773 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
6774 switch (Entity.getKind()) { in shouldBindAsTemporary()
6807 static bool shouldDestroyEntity(const InitializedEntity &Entity) { in shouldDestroyEntity() argument
6808 switch (Entity.getKind()) { in shouldDestroyEntity()
6840 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
6842 switch (Entity.getKind()) { in getInitializationLoc()
6845 return Entity.getReturnLoc(); in getInitializationLoc()
6848 return Entity.getThrowLoc(); in getInitializationLoc()
6852 return Entity.getDecl()->getLocation(); in getInitializationLoc()
6855 return Entity.getCaptureLoc(); in getInitializationLoc()
6900 const InitializedEntity &Entity, in CopyObject() argument
6913 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
6941 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6951 << (int)Entity.getKind() in CopyObject()
6959 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6971 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
7041 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
7050 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
7058 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
7077 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
7083 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
7105 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
7106 if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) { in PrintInitLocationNote()
7107 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
7110 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
7111 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
7112 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
7114 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
7116 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
7117 Entity.getMethodDecl()) in PrintInitLocationNote()
7118 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
7120 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
7125 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
7128 switch (Entity.getKind()) { in isExplicitTemporary()
7151 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
7200 Entity.getType(), Args.front()->getType(), Kind.getLocation()); in PerformConstructorInitialization()
7209 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
7214 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
7216 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
7232 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in PerformConstructorInitialization()
7240 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
7241 ConstructKind = Entity.getBaseSpecifier()->isVirtual() in PerformConstructorInitialization()
7244 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
7258 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
7285 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
7289 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType())) in PerformConstructorInitialization()
7293 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
7299 void Sema::checkInitializerLifetime(const InitializedEntity &Entity, in checkInitializerLifetime() argument
7301 return sema::checkExprLifetime(*this, Entity, Init); in checkInitializerLifetime()
7483 const InitializedEntity &Entity, in Perform() argument
7488 Diagnose(S, Entity, Kind, Args); in Perform()
7492 const Decl *D = Entity.getDecl(); in Perform()
7494 QualType DestType = Entity.getType(); in Perform()
7521 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
7523 QualType DeclType = Entity.getType(); in Perform()
7537 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { in Perform()
7573 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
7575 !Entity.isParamOrTemplateParamKind()) { in Perform()
7585 isa<PredefinedExpr>(Args[0]) && Entity.getType()->isArrayType()) { in Perform()
7594 QualType ETy = Entity.getType(); in Perform()
7600 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { in Perform()
7603 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); in Perform()
7607 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
7612 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
7613 Entity.getType(); in Perform()
7686 if (Entity.getKind() == InitializedEntity::EK_Base || in Perform()
7687 Entity.getKind() == InitializedEntity::EK_Delegating) in Perform()
7790 MTETy, CurInit.get(), Entity.getType()->isLValueReferenceType()); in Perform()
7810 if (!shouldBindAsTemporary(Entity)) in Perform()
7812 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
7817 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
7853 Entity); in Perform()
7883 if (shouldBindAsTemporary(Entity)) in Perform()
7887 else if (CreatedObject && shouldDestroyEntity(Entity)) { in Perform()
7957 Init, Step->Type, *Step->ICS, getAssignmentAction(Entity), CCK); in Perform()
7967 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
7981 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
7983 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
8023 Entity.getType().getNonReferenceType()); in Perform()
8024 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8031 Entity, in Perform()
8069 Entity.getType().getNonReferenceType()); in Perform()
8070 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8078 S, UseTemporary ? TempEntity : Entity, Kind, in Perform()
8100 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
8106 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in Perform()
8123 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
8131 Entity.isParameterKind() && in Perform()
8139 if (S.getLangOpts().C23 && initializingConstexprVariable(Entity)) { in Perform()
8140 CheckC23ConstexprInitConversion(S, SourceType, Entity.getType(), in Perform()
8149 if (Entity.getType()->getAs<PointerType>() && in Perform()
8160 getAssignmentAction(Entity, true), in Perform()
8162 PrintInitLocationNote(S, Entity); in Perform()
8165 PrintInitLocationNote(S, Entity); in Perform()
8171 bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType(); in Perform()
8175 initializingConstexprVariable(Entity)); in Perform()
8318 if (shouldBindAsTemporary(Entity)) in Perform()
8344 if (Entity.isParameterKind()) { in Perform()
8428 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this, in Perform()
8432 if (shouldBindAsTemporary(Entity)) in Perform()
8445 S.checkInitializerLifetime(Entity, Init); in Perform()
8448 if (InitializedEntity::EntityKind EK = Entity.getKind(); in Perform()
8451 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
8453 cast<FieldDecl>(Entity.getDecl()), Init); in Perform()
8457 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
8534 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
8536 QualType DestType = Entity.getType(); in diagnoseListInit()
8557 if (auto *D = Entity.getDecl()) in diagnoseListInit()
8563 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
8571 const InitializedEntity &Entity, in Diagnose() argument
8577 QualType DestType = Entity.getType(); in Diagnose()
8622 << 1 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
8712 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
8831 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
8837 << (int)Entity.getKind() in Diagnose()
8844 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
8875 << 0 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
8915 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
8916 Entity.getKind() == InitializedEntity::EK_Member || in Diagnose()
8917 Entity.getKind() == InitializedEntity::EK_ParenAggInitMember) && in Diagnose()
8928 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
8933 << Entity.getType() in Diagnose()
8937 = Entity.getBaseSpecifier()->getType()->castAs<RecordType>() in Diagnose()
8946 << Entity.getName() in Diagnose()
8948 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
8952 = Entity.getType()->getAs<RecordType>()) in Diagnose()
9005 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
9016 << Entity.getName(); in Diagnose()
9017 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
9018 << Entity.getName(); in Diagnose()
9019 } else if (const auto *VD = dyn_cast_if_present<VarDecl>(Entity.getDecl()); in Diagnose()
9037 diagnoseListInit(S, Entity, InitList); in Diagnose()
9061 TryOrBuildParenListInitialization(S, Entity, Kind, Args, *this, in Diagnose()
9068 << Entity.getType() << InitList->getSourceRange(); in Diagnose()
9072 PrintInitLocationNote(S, Entity); in Diagnose()
9601 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
9611 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
9616 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
9632 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
9636 Entity.isParameterKind() && Seq.isConstructorInitialization(); in PerformCopyInitialization()
9638 if (llvm::is_contained(CurrentParameterCopyTypes, Entity.getType())) { in PerformCopyInitialization()
9665 CurrentParameterCopyTypes.push_back(Entity.getType()); in PerformCopyInitialization()
9668 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()
9687 TypeSourceInfo *TSInfo, const InitializedEntity &Entity, in DeduceTemplateSpecializationFromInitializer() argument
9867 InitListChecker CheckInitList(*this, Entity, ListInit, Ty, ElementTypes); in DeduceTemplateSpecializationFromInitializer()