Lines Matching refs:Entity
300 void CheckImplicitInitList(const InitializedEntity &Entity,
304 void CheckExplicitInitList(const InitializedEntity &Entity,
308 void CheckListElementTypes(const InitializedEntity &Entity,
315 void CheckSubElementType(const InitializedEntity &Entity,
321 void CheckComplexType(const InitializedEntity &Entity,
326 void CheckScalarType(const InitializedEntity &Entity,
331 void CheckReferenceType(const InitializedEntity &Entity,
336 void CheckVectorType(const InitializedEntity &Entity,
340 void CheckStructUnionTypes(const InitializedEntity &Entity,
348 void CheckArrayType(const InitializedEntity &Entity,
354 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
381 const InitializedEntity &Entity);
467 void FillInEmptyInitializations(const InitializedEntity &Entity,
471 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
474 void CheckEmptyInitializable(const InitializedEntity &Entity,
478 InitListChecker(Sema &S, const InitializedEntity &Entity, InitListExpr *IL,
491 const InitializedEntity &Entity) { in PerformEmptyInit() argument
503 Entity.getType()->getBaseElementTypeUnsafe()->isRecordType(); in PerformEmptyInit()
525 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
559 SemaRef, Entity, in PerformEmptyInit()
568 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
569 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
571 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) in PerformEmptyInit()
579 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
580 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
581 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
583 << /*field*/1 << Entity.getDecl(); in PerformEmptyInit()
584 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) { in PerformEmptyInit()
586 Entity.getParent() && in PerformEmptyInit()
587 Entity.getParent()->isVariableLengthArrayNew(); in PerformEmptyInit()
590 << Entity.getElementIndex(); in PerformEmptyInit()
598 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
601 void InitListChecker::CheckEmptyInitializable(const InitializedEntity &Entity, in CheckEmptyInitializable() argument
608 PerformEmptyInit(Loc, Entity); in CheckEmptyInitializable()
741 InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, in FillInEmptyInitializations() argument
780 Entity, ILE, RequiresSecondPass, FillWithNoInit); in FillInEmptyInitializations()
785 FillInEmptyInitForField(0, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
807 FillInEmptyInitForBase(Init, Base, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
820 FillInEmptyInitForField(Init, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
838 InitializedEntity ElementEntity = Entity; in FillInEmptyInitializations()
847 if (Entity.isVariableLengthArrayNew()) in FillInEmptyInitializations()
850 0, Entity); in FillInEmptyInitializations()
855 0, Entity); in FillInEmptyInitializations()
943 InitListChecker::InitListChecker(Sema &S, const InitializedEntity &Entity, in InitListChecker() argument
960 CheckExplicitInitList(Entity, IL, T, FullyStructuredList, in InitListChecker()
965 FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass, in InitListChecker()
968 FillInEmptyInitializations(Entity, FullyStructuredList, in InitListChecker()
1001 static bool isIdiomaticBraceElisionEntity(const InitializedEntity &Entity) { in isIdiomaticBraceElisionEntity() argument
1010 if (!Entity.getParent()) in isIdiomaticBraceElisionEntity()
1014 if (Entity.getKind() == InitializedEntity::EK_Base) { in isIdiomaticBraceElisionEntity()
1016 Entity.getParent()->getType()->castAs<RecordType>()->getDecl(); in isIdiomaticBraceElisionEntity()
1022 if (Entity.getKind() == InitializedEntity::EK_Member) { in isIdiomaticBraceElisionEntity()
1024 Entity.getParent()->getType()->castAs<RecordType>()->getDecl(); in isIdiomaticBraceElisionEntity()
1045 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity, in CheckImplicitInitList() argument
1079 CheckListElementTypes(Entity, ParentIList, T, in CheckImplicitInitList()
1100 !isIdiomaticBraceElisionEntity(Entity)) { in CheckImplicitInitList()
1124 static void warnBracedScalarInit(Sema &S, const InitializedEntity &Entity, in warnBracedScalarInit() argument
1134 switch (Entity.getKind()) { in warnBracedScalarInit()
1149 if (Entity.getParent()) in warnBracedScalarInit()
1181 << Entity.getType()->isSizelessBuiltinType() << Braces in warnBracedScalarInit()
1192 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity, in CheckExplicitInitList() argument
1197 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true, in CheckExplicitInitList()
1250 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange()); in CheckExplicitInitList()
1273 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity, in CheckListElementTypes() argument
1284 CheckComplexType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1287 CheckScalarType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1290 CheckVectorType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1301 CheckStructUnionTypes(Entity, IList, DeclType, Bases, RD->field_begin(), in CheckListElementTypes()
1308 CheckArrayType(Entity, IList, DeclType, Zero, in CheckListElementTypes()
1319 CheckReferenceType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1328 CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckListElementTypes()
1338 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, in CheckSubElementType() argument
1348 return CheckReferenceType(Entity, IList, ElemType, Index, in CheckSubElementType()
1383 (ElemType->isExtVectorType() && !Entity.getType()->isExtVectorType()) in CheckSubElementType()
1385 : Entity; in CheckSubElementType()
1417 return CheckScalarType(Entity, IList, ElemType, Index, in CheckSubElementType()
1477 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList, in CheckSubElementType()
1500 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr, in CheckSubElementType()
1512 void InitListChecker::CheckComplexType(const InitializedEntity &Entity, in CheckComplexType() argument
1527 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckComplexType()
1539 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckComplexType()
1548 void InitListChecker::CheckScalarType(const InitializedEntity &Entity, in CheckScalarType() argument
1582 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList, in CheckScalarType()
1599 if (SemaRef.CanPerformCopyInitialization(Entity, expr)) in CheckScalarType()
1605 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckScalarType()
1626 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity, in CheckReferenceType() argument
1659 if (SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckReferenceType()
1665 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckReferenceType()
1681 void InitListChecker::CheckVectorType(const InitializedEntity &Entity, in CheckVectorType() argument
1694 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckVectorType()
1706 if (SemaRef.CanPerformCopyInitialization(Entity, Init)) in CheckVectorType()
1712 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init, in CheckVectorType()
1734 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1752 const VectorType *T = Entity.getType()->castAs<VectorType>(); in CheckVectorType()
1791 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1856 void InitListChecker::CheckArrayType(const InitializedEntity &Entity, in CheckArrayType() argument
1931 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckArrayType()
1960 Entity); in CheckArrayType()
1975 if (maxElements == Zero && !Entity.isVariableLengthArrayNew()) { in CheckArrayType()
1990 Entity.isVariableLengthArrayNew()) in CheckArrayType()
1992 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckArrayType()
1997 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity, in CheckFlexibleArrayInit() argument
2014 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in CheckFlexibleArrayInit()
2017 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) { in CheckFlexibleArrayInit()
2036 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, in CheckStructUnionTypes() argument
2085 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2108 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
2149 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckStructUnionTypes()
2216 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2252 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2276 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, in CheckStructUnionTypes()
2284 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2400 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, in CheckDesignatedInitializer() argument
2423 InitializationSequence Seq(SemaRef, Entity, Kind, Init, in CheckDesignatedInitializer()
2428 : Seq.Perform(SemaRef, Entity, Kind, Init); in CheckDesignatedInitializer()
2445 CheckSubElementType(Entity, IList, CurrentObjectType, Index, StructuredList, in CheckDesignatedInitializer()
2740 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field, in CheckDesignatedInitializer()
2756 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2775 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2810 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field, in CheckDesignatedInitializer()
2973 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
3007 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex, in CheckDesignatedInitializer()
3143 const InitializedEntity &Entity, InitListExpr *From) { in CanPerformAggregateInitializationForOverloadResolution() argument
3144 QualType Type = Entity.getType(); in CanPerformAggregateInitializationForOverloadResolution()
3145 InitListChecker Check(*this, Entity, From, Type, /*VerifyOnly=*/true, in CanPerformAggregateInitializationForOverloadResolution()
3815 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
3816 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
3819 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
3827 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
3836 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
3841 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
3842 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
3845 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
3847 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3853 } else if (Entity.getKind() == InitializedEntity::EK_Result || in MaybeProduceObjCObject()
3854 Entity.getKind() == InitializedEntity::EK_StmtExprResult) { in MaybeProduceObjCObject()
3855 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
3858 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3863 const InitializedEntity &Entity,
4040 const InitializedEntity &Entity, in TryConstructorInitialization() argument
4072 Entity.getKind() != InitializedEntity::EK_Base && in TryConstructorInitialization()
4073 Entity.getKind() != InitializedEntity::EK_Delegating && in TryConstructorInitialization()
4074 Entity.getKind() != in TryConstructorInitialization()
4167 Sequence.RewrapReferenceInitList(Entity.getType(), ILE); in TryConstructorInitialization()
4183 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
4185 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
4247 const InitializedEntity &Entity,
4257 const InitializedEntity &Entity,
4264 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
4275 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
4280 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
4307 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
4355 const InitializedEntity &Entity, in TryListInitialization() argument
4360 QualType DestType = Entity.getType(); in TryListInitialization()
4370 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
4398 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4415 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4423 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4442 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
4455 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4503 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4532 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4536 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4541 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
4555 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryRefInitWithConversionFunction() argument
4558 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
4735 const InitializedEntity &Entity,
4740 const InitializedEntity &Entity, in TryReferenceInitialization() argument
4744 QualType DestType = Entity.getType(); in TryReferenceInitialization()
4760 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
4777 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
4785 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
4855 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef, in TryReferenceInitializationCore()
4946 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
4997 S, Entity, Kind, Initializer, /*AllowRValues*/ true, in TryReferenceInitializationCore()
5099 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
5103 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
5108 const InitializedEntity &Entity, in TryValueInitialization() argument
5118 QualType T = Entity.getType(); in TryValueInitialization()
5149 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5177 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax); in TryValueInitialization()
5181 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5186 const InitializedEntity &Entity, in TryDefaultInitialization() argument
5194 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
5200 TryConstructorInitialization(S, Entity, Kind, None, DestType, in TryDefaultInitialization()
5201 Entity.getType(), Sequence); in TryDefaultInitialization()
5211 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
5218 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
5414 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
5417 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
5418 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
5531 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
5544 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
5551 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
5572 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
5637 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in InitializationSequence() argument
5641 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
5658 static bool canPerformArrayCopy(const InitializedEntity &Entity) { in canPerformArrayCopy() argument
5659 switch (Entity.getKind()) { in canPerformArrayCopy()
5670 return isa<DecompositionDecl>(Entity.getDecl()); in canPerformArrayCopy()
5676 return Entity.isImplicitMemberInitializer(); in canPerformArrayCopy()
5681 if (auto *E = Entity.getParent()) in canPerformArrayCopy()
5693 const InitializedEntity &Entity, in InitializeFrom() argument
5721 QualType DestType = Entity.getType(); in InitializeFrom()
5751 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
5773 TryReferenceInitialization(S, Entity, Kind, Args[0], *this); in InitializeFrom()
5780 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
5786 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
5804 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
5830 Entity.getType()) && in InitializeFrom()
5831 canPerformArrayCopy(Entity)) { in InitializeFrom()
5840 InitializedEntity::InitializeElement(S.Context, 0, Entity); in InitializeFrom()
5850 AddArrayInitLoopStep(Entity.getType(), InitEltT); in InitializeFrom()
5873 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
5875 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
5891 Entity.isParameterKind(); in InitializeFrom()
5901 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
5910 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5926 TryConstructorInitialization(S, Entity, Kind, Args, in InitializeFrom()
5968 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5970 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
6008 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
6025 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) { in InitializeFrom()
6026 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
6039 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6052 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
6053 switch(Entity.getKind()) { in getAssignmentAction()
6062 if (Entity.getDecl() && in getAssignmentAction()
6063 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6069 if (Entity.getDecl() && in getAssignmentAction()
6070 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6106 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
6107 switch (Entity.getKind()) { in shouldBindAsTemporary()
6139 static bool shouldDestroyEntity(const InitializedEntity &Entity) { in shouldDestroyEntity() argument
6140 switch (Entity.getKind()) { in shouldDestroyEntity()
6171 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
6173 switch (Entity.getKind()) { in getInitializationLoc()
6176 return Entity.getReturnLoc(); in getInitializationLoc()
6179 return Entity.getThrowLoc(); in getInitializationLoc()
6183 return Entity.getDecl()->getLocation(); in getInitializationLoc()
6186 return Entity.getCaptureLoc(); in getInitializationLoc()
6230 const InitializedEntity &Entity, in CopyObject() argument
6243 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
6270 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6280 << (int)Entity.getKind() in CopyObject()
6288 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6300 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
6373 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
6382 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
6390 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
6408 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
6414 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
6436 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
6437 if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) { in PrintInitLocationNote()
6438 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
6441 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
6442 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
6443 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
6445 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
6447 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
6448 Entity.getMethodDecl()) in PrintInitLocationNote()
6449 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
6451 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
6456 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
6459 switch (Entity.getKind()) { in isExplicitTemporary()
6482 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
6535 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
6540 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
6542 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
6560 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in PerformConstructorInitialization()
6569 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
6570 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ? in PerformConstructorInitialization()
6573 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
6587 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
6614 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
6618 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType())) in PerformConstructorInitialization()
6622 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
6662 const InitializedEntity *Entity, in getEntityLifetime() argument
6665 switch (Entity->getKind()) { in getEntityLifetime()
6668 return {Entity, LK_Extended}; in getEntityLifetime()
6672 if (Entity->getParent()) in getEntityLifetime()
6673 return getEntityLifetime(Entity->getParent(), Entity); in getEntityLifetime()
6687 return {Entity, Entity->isDefaultMemberInitializer() ? LK_Extended in getEntityLifetime()
6693 return {Entity, LK_Extended}; in getEntityLifetime()
6733 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
6737 if (Entity->getParent()) in getEntityLifetime()
6738 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
7541 void Sema::checkInitializerLifetime(const InitializedEntity &Entity, in checkInitializerLifetime() argument
7543 LifetimeResult LR = getEntityLifetime(&Entity); in checkInitializerLifetime()
7629 << RK << !Entity.getParent() in checkInitializerLifetime()
7652 bool IsSubobjectMember = ExtendingEntity != &Entity; in checkInitializerLifetime()
7718 << !Entity.getParent() << DiagRange; in checkInitializerLifetime()
7733 << Entity.getType()->isReferenceType() << DRE->getDecl() in checkInitializerLifetime()
7745 << Entity.getType()->isReferenceType() << DiagRange; in checkInitializerLifetime()
7986 const InitializedEntity &Entity, in Perform() argument
7991 Diagnose(S, Entity, Kind, Args); in Perform()
7996 if (Decl *D = Entity.getDecl()) in Perform()
8003 QualType DestType = Entity.getType(); in Perform()
8014 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
8016 QualType DeclType = Entity.getType(); in Perform()
8030 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { in Perform()
8066 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
8068 !Entity.isParamOrTemplateParamKind()) { in Perform()
8078 QualType ETy = Entity.getType(); in Perform()
8084 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { in Perform()
8087 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); in Perform()
8091 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
8096 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
8097 Entity.getType(); in Perform()
8163 if (Entity.getKind() == InitializedEntity::EK_Base || in Perform()
8164 Entity.getKind() == InitializedEntity::EK_Delegating) in Perform()
8264 MTETy, CurInit.get(), Entity.getType()->isLValueReferenceType()); in Perform()
8284 if (!shouldBindAsTemporary(Entity)) in Perform()
8286 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8291 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8330 Entity); in Perform()
8360 if (shouldBindAsTemporary(Entity)) in Perform()
8364 else if (CreatedObject && shouldDestroyEntity(Entity)) { in Perform()
8435 getAssignmentAction(Entity), CCK); in Perform()
8445 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
8459 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
8461 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
8501 Entity.getType().getNonReferenceType()); in Perform()
8502 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8509 Entity, in Perform()
8547 Entity.getType().getNonReferenceType()); in Perform()
8548 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8556 S, UseTemporary ? TempEntity : Entity, Kind, in Perform()
8578 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
8584 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in Perform()
8600 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
8608 Entity.isParameterKind() && in Perform()
8620 getAssignmentAction(Entity, true), in Perform()
8622 PrintInitLocationNote(S, Entity); in Perform()
8625 PrintInitLocationNote(S, Entity); in Perform()
8631 bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType(); in Perform()
8727 if (shouldBindAsTemporary(Entity)) in Perform()
8753 if (Entity.isParameterKind()) { in Perform()
8841 S.checkInitializerLifetime(Entity, Init); in Perform()
8844 if (Entity.getKind() == InitializedEntity::EK_Member && in Perform()
8845 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
8847 cast<FieldDecl>(Entity.getDecl()), in Perform()
8853 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
8927 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
8929 QualType DestType = Entity.getType(); in diagnoseListInit()
8950 if (auto *D = Entity.getDecl()) in diagnoseListInit()
8956 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
8964 const InitializedEntity &Entity, in Diagnose() argument
8983 QualType DestType = Entity.getType(); in Diagnose()
9003 << 1 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9094 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
9210 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9216 << (int)Entity.getKind() in Diagnose()
9223 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9254 << 0 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9294 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
9295 Entity.getKind() == InitializedEntity::EK_Member) && in Diagnose()
9306 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
9311 << Entity.getType() in Diagnose()
9315 = Entity.getBaseSpecifier()->getType()->castAs<RecordType>() in Diagnose()
9324 << Entity.getName() in Diagnose()
9326 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
9330 = Entity.getType()->getAs<RecordType>()) in Diagnose()
9379 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
9390 << Entity.getName(); in Diagnose()
9391 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
9392 << Entity.getName(); in Diagnose()
9407 diagnoseListInit(S, Entity, InitList); in Diagnose()
9431 PrintInitLocationNote(S, Entity); in Diagnose()
9876 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
9886 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
9891 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
9907 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
9911 Entity.isParameterKind() && Seq.isConstructorInitialization(); in PerformCopyInitialization()
9913 if (llvm::find(CurrentParameterCopyTypes, Entity.getType()) != in PerformCopyInitialization()
9941 CurrentParameterCopyTypes.push_back(Entity.getType()); in PerformCopyInitialization()
9944 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()
9963 TypeSourceInfo *TSInfo, const InitializedEntity &Entity, in DeduceTemplateSpecializationFromInitializer() argument