Lines Matching refs:Entity

256   void CheckImplicitInitList(const InitializedEntity &Entity,
260 void CheckExplicitInitList(const InitializedEntity &Entity,
264 void CheckListElementTypes(const InitializedEntity &Entity,
271 void CheckSubElementType(const InitializedEntity &Entity,
276 void CheckComplexType(const InitializedEntity &Entity,
281 void CheckScalarType(const InitializedEntity &Entity,
286 void CheckReferenceType(const InitializedEntity &Entity,
291 void CheckVectorType(const InitializedEntity &Entity,
295 void CheckStructUnionTypes(const InitializedEntity &Entity,
303 void CheckArrayType(const InitializedEntity &Entity,
309 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
334 const InitializedEntity &Entity,
365 void FillInEmptyInitializations(const InitializedEntity &Entity,
369 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
372 void CheckEmptyInitializable(const InitializedEntity &Entity,
376 InitListChecker(Sema &S, const InitializedEntity &Entity,
390 const InitializedEntity &Entity, in PerformEmptyInit() argument
404 Entity.getType()->getBaseElementTypeUnsafe()->isRecordType(); in PerformEmptyInit()
426 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
460 SemaRef, Entity, in PerformEmptyInit()
469 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
470 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
472 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) in PerformEmptyInit()
480 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
481 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
482 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
484 << /*field*/1 << Entity.getDecl(); in PerformEmptyInit()
485 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) { in PerformEmptyInit()
487 Entity.getParent() && in PerformEmptyInit()
488 Entity.getParent()->isVariableLengthArrayNew(); in PerformEmptyInit()
491 << Entity.getElementIndex(); in PerformEmptyInit()
498 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
501 void InitListChecker::CheckEmptyInitializable(const InitializedEntity &Entity, in CheckEmptyInitializable() argument
505 if (PerformEmptyInit(SemaRef, Loc, Entity, /*VerifyOnly*/true, in CheckEmptyInitializable()
635 InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, in FillInEmptyInitializations() argument
669 Entity, ILE, RequiresSecondPass, FillWithNoInit); in FillInEmptyInitializations()
674 FillInEmptyInitForField(0, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
696 FillInEmptyInitForBase(Init, Base, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
709 FillInEmptyInitForField(Init, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
727 InitializedEntity ElementEntity = Entity; in FillInEmptyInitializations()
736 if (Entity.isVariableLengthArrayNew()) in FillInEmptyInitializations()
739 0, Entity); in FillInEmptyInitializations()
744 0, Entity); in FillInEmptyInitializations()
817 InitListChecker::InitListChecker(Sema &S, const InitializedEntity &Entity, in InitListChecker() argument
830 CheckExplicitInitList(Entity, IL, T, FullyStructuredList, in InitListChecker()
835 FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass, in InitListChecker()
838 FillInEmptyInitializations(Entity, FullyStructuredList, in InitListChecker()
869 static bool isIdiomaticBraceElisionEntity(const InitializedEntity &Entity) { in isIdiomaticBraceElisionEntity() argument
880 if (Entity.getKind() != InitializedEntity::EK_Member || !Entity.getParent()) in isIdiomaticBraceElisionEntity()
884 Entity.getParent()->getType()->castAs<RecordType>()->getDecl(); in isIdiomaticBraceElisionEntity()
901 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity, in CheckImplicitInitList() argument
935 CheckListElementTypes(Entity, ParentIList, T, in CheckImplicitInitList()
956 !isIdiomaticBraceElisionEntity(Entity)) { in CheckImplicitInitList()
980 static void warnBracedScalarInit(Sema &S, const InitializedEntity &Entity, in warnBracedScalarInit() argument
990 switch (Entity.getKind()) { in warnBracedScalarInit()
1004 if (Entity.getParent()) in warnBracedScalarInit()
1047 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity, in CheckExplicitInitList() argument
1057 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true, in CheckExplicitInitList()
1120 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange()); in CheckExplicitInitList()
1143 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity, in CheckListElementTypes() argument
1154 CheckComplexType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1157 CheckScalarType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1160 CheckVectorType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1171 CheckStructUnionTypes(Entity, IList, DeclType, Bases, RD->field_begin(), in CheckListElementTypes()
1178 CheckArrayType(Entity, IList, DeclType, Zero, in CheckListElementTypes()
1189 CheckReferenceType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1197 CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckListElementTypes()
1207 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, in CheckSubElementType() argument
1216 return CheckReferenceType(Entity, IList, ElemType, Index, in CheckSubElementType()
1229 CheckExplicitInitList(Entity, SubInitList, ElemType, in CheckSubElementType()
1234 FillInEmptyInitializations(Entity, InnerStructuredList, in CheckSubElementType()
1238 FillInEmptyInitializations(Entity, InnerStructuredList, in CheckSubElementType()
1266 InitializationSequence Seq(SemaRef, Entity, Kind, expr, in CheckSubElementType()
1278 Seq.Perform(SemaRef, Entity, Kind, expr); in CheckSubElementType()
1293 return CheckScalarType(Entity, IList, ElemType, Index, in CheckSubElementType()
1352 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList, in CheckSubElementType()
1359 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr, in CheckSubElementType()
1368 void InitListChecker::CheckComplexType(const InitializedEntity &Entity, in CheckComplexType() argument
1383 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckComplexType()
1395 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckComplexType()
1404 void InitListChecker::CheckScalarType(const InitializedEntity &Entity, in CheckScalarType() argument
1431 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList, in CheckScalarType()
1445 if (!SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckScalarType()
1452 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckScalarType()
1474 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity, in CheckReferenceType() argument
1506 if (!SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckReferenceType()
1513 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr, in CheckReferenceType()
1529 void InitListChecker::CheckVectorType(const InitializedEntity &Entity, in CheckVectorType() argument
1543 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckVectorType()
1554 if (!SemaRef.CanPerformCopyInitialization(Entity, Init)) in CheckVectorType()
1561 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init, in CheckVectorType()
1585 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1604 const VectorType *T = Entity.getType()->getAs<VectorType>(); in CheckVectorType()
1643 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1684 void InitListChecker::CheckArrayType(const InitializedEntity &Entity, in CheckArrayType() argument
1749 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckArrayType()
1778 Entity); in CheckArrayType()
1793 if (maxElements == Zero && !Entity.isVariableLengthArrayNew()) { in CheckArrayType()
1809 Entity.isVariableLengthArrayNew()) in CheckArrayType()
1811 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckArrayType()
1816 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity, in CheckFlexibleArrayInit() argument
1833 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in CheckFlexibleArrayInit()
1836 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) { in CheckFlexibleArrayInit()
1879 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, in CheckStructUnionTypes() argument
1928 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
1951 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
1992 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckStructUnionTypes()
2059 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2095 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2119 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, in CheckStructUnionTypes()
2127 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2237 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, in CheckDesignatedInitializer() argument
2259 CheckSubElementType(Entity, IList, CurrentObjectType, Index, in CheckDesignatedInitializer()
2520 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field, in CheckDesignatedInitializer()
2536 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2555 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2590 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field, in CheckDesignatedInitializer()
2745 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
2779 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex, in CheckDesignatedInitializer()
3590 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
3591 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
3594 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
3602 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
3611 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
3616 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
3617 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
3620 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
3622 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3628 } else if (Entity.getKind() == InitializedEntity::EK_Result || in MaybeProduceObjCObject()
3629 Entity.getKind() == InitializedEntity::EK_StmtExprResult) { in MaybeProduceObjCObject()
3630 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
3633 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3638 const InitializedEntity &Entity,
3816 const InitializedEntity &Entity, in TryConstructorInitialization() argument
3848 Entity.getKind() != InitializedEntity::EK_Base && in TryConstructorInitialization()
3849 Entity.getKind() != InitializedEntity::EK_Delegating && in TryConstructorInitialization()
3850 Entity.getKind() != in TryConstructorInitialization()
3941 Sequence.RewrapReferenceInitList(Entity.getType(), ILE); in TryConstructorInitialization()
3955 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
3957 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
4007 const InitializedEntity &Entity,
4017 const InitializedEntity &Entity,
4024 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
4035 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
4040 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
4069 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
4098 const InitializedEntity &Entity, in TryListInitialization() argument
4103 QualType DestType = Entity.getType(); in TryListInitialization()
4113 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
4141 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4158 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4166 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4185 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
4198 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4246 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4271 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4275 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4280 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
4294 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryRefInitWithConversionFunction() argument
4297 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
4479 const InitializedEntity &Entity,
4484 const InitializedEntity &Entity, in TryReferenceInitialization() argument
4488 QualType DestType = Entity.getType(); in TryReferenceInitialization()
4504 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
4517 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
4525 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
4586 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef, in TryReferenceInitializationCore()
4665 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
4707 S, Entity, Kind, Initializer, /*AllowRValues*/ true, in TryReferenceInitializationCore()
4789 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
4793 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
4798 const InitializedEntity &Entity, in TryValueInitialization() argument
4808 QualType T = Entity.getType(); in TryValueInitialization()
4839 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
4867 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax); in TryValueInitialization()
4871 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
4876 const InitializedEntity &Entity, in TryDefaultInitialization() argument
4884 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
4890 TryConstructorInitialization(S, Entity, Kind, None, DestType, in TryDefaultInitialization()
4891 Entity.getType(), Sequence); in TryDefaultInitialization()
4901 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
4908 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
5095 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
5098 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
5099 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
5212 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
5225 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
5232 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
5253 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
5318 const InitializedEntity &Entity, in InitializationSequence() argument
5324 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
5341 static bool canPerformArrayCopy(const InitializedEntity &Entity) { in canPerformArrayCopy() argument
5342 switch (Entity.getKind()) { in canPerformArrayCopy()
5353 return isa<DecompositionDecl>(Entity.getDecl()); in canPerformArrayCopy()
5359 return Entity.isImplicitMemberInitializer(); in canPerformArrayCopy()
5364 if (auto *E = Entity.getParent()) in canPerformArrayCopy()
5376 const InitializedEntity &Entity, in InitializeFrom() argument
5404 QualType DestType = Entity.getType(); in InitializeFrom()
5434 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
5456 TryReferenceInitialization(S, Entity, Kind, Args[0], *this); in InitializeFrom()
5463 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
5469 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
5487 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
5513 Entity.getType()) && in InitializeFrom()
5514 canPerformArrayCopy(Entity)) { in InitializeFrom()
5523 InitializedEntity::InitializeElement(S.Context, 0, Entity); in InitializeFrom()
5533 AddArrayInitLoopStep(Entity.getType(), InitEltT); in InitializeFrom()
5557 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
5559 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
5575 Entity.isParameterKind(); in InitializeFrom()
5582 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
5594 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5610 TryConstructorInitialization(S, Entity, Kind, Args, in InitializeFrom()
5652 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5654 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
5679 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
5696 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) { in InitializeFrom()
5697 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
5710 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5723 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
5724 switch(Entity.getKind()) { in getAssignmentAction()
5733 if (Entity.getDecl() && in getAssignmentAction()
5734 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
5740 if (Entity.getDecl() && in getAssignmentAction()
5741 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
5772 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
5773 switch (Entity.getKind()) { in shouldBindAsTemporary()
5804 static bool shouldDestroyEntity(const InitializedEntity &Entity) { in shouldDestroyEntity() argument
5805 switch (Entity.getKind()) { in shouldDestroyEntity()
5835 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
5837 switch (Entity.getKind()) { in getInitializationLoc()
5840 return Entity.getReturnLoc(); in getInitializationLoc()
5843 return Entity.getThrowLoc(); in getInitializationLoc()
5847 return Entity.getDecl()->getLocation(); in getInitializationLoc()
5850 return Entity.getCaptureLoc(); in getInitializationLoc()
5893 const InitializedEntity &Entity, in CopyObject() argument
5906 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
5931 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5940 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5947 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5959 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
6031 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
6040 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
6048 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
6066 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
6072 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
6094 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
6095 if (Entity.isParameterKind() && Entity.getDecl()) { in PrintInitLocationNote()
6096 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
6099 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
6100 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
6101 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
6103 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
6105 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
6106 Entity.getMethodDecl()) in PrintInitLocationNote()
6107 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
6109 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
6114 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
6117 switch (Entity.getKind()) { in isExplicitTemporary()
6140 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
6192 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
6197 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
6199 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
6215 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in PerformConstructorInitialization()
6223 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
6224 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ? in PerformConstructorInitialization()
6227 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
6241 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
6268 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
6272 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
6312 const InitializedEntity *Entity, in getEntityLifetime() argument
6315 switch (Entity->getKind()) { in getEntityLifetime()
6318 return {Entity, LK_Extended}; in getEntityLifetime()
6322 if (Entity->getParent()) in getEntityLifetime()
6323 return getEntityLifetime(Entity->getParent(), Entity); in getEntityLifetime()
6337 return {Entity, Entity->isDefaultMemberInitializer() ? LK_Extended in getEntityLifetime()
6343 return {Entity, LK_Extended}; in getEntityLifetime()
6379 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
6383 if (Entity->getParent()) in getEntityLifetime()
6384 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
6918 void Sema::checkInitializerLifetime(const InitializedEntity &Entity, in checkInitializerLifetime() argument
6920 LifetimeResult LR = getEntityLifetime(&Entity); in checkInitializerLifetime()
6976 << RK << !Entity.getParent() in checkInitializerLifetime()
6990 bool IsSubobjectMember = ExtendingEntity != &Entity; in checkInitializerLifetime()
7047 << !Entity.getParent() << DiagRange; in checkInitializerLifetime()
7062 << Entity.getType()->isReferenceType() << DRE->getDecl() in checkInitializerLifetime()
7074 << Entity.getType()->isReferenceType() << DiagRange; in checkInitializerLifetime()
7285 const InitializedEntity &Entity, in Perform() argument
7290 Diagnose(S, Entity, Kind, Args); in Perform()
7295 if (Decl *D = Entity.getDecl()) in Perform()
7302 QualType DestType = Entity.getType(); in Perform()
7313 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
7315 QualType DeclType = Entity.getType(); in Perform()
7329 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { in Perform()
7365 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
7367 !Entity.isParameterKind()) { in Perform()
7377 QualType ETy = Entity.getType(); in Perform()
7384 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { in Perform()
7387 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); in Perform()
7391 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
7396 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
7397 Entity.getType(); in Perform()
7463 if (Entity.getKind() == InitializedEntity::EK_Base || in Perform()
7464 Entity.getKind() == InitializedEntity::EK_Delegating) in Perform()
7552 Step->Type, CurInit.get(), Entity.getType()->isLValueReferenceType()); in Perform()
7572 if (!shouldBindAsTemporary(Entity)) in Perform()
7574 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
7579 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
7618 Entity); in Perform()
7648 if (shouldBindAsTemporary(Entity)) in Perform()
7652 else if (CreatedObject && shouldDestroyEntity(Entity)) { in Perform()
7720 getAssignmentAction(Entity), CCK); in Perform()
7730 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
7744 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
7746 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
7786 Entity.getType().getNonReferenceType()); in Perform()
7787 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
7794 Entity, in Perform()
7832 Entity.getType().getNonReferenceType()); in Perform()
7833 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
7841 S, UseTemporary ? TempEntity : Entity, Kind, in Perform()
7863 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
7869 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in Perform()
7885 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
7893 Entity.isParameterKind() && in Perform()
7905 getAssignmentAction(Entity, true), in Perform()
7907 PrintInitLocationNote(S, Entity); in Perform()
7910 PrintInitLocationNote(S, Entity); in Perform()
8009 if (shouldBindAsTemporary(Entity)) in Perform()
8035 if (Entity.isParameterKind()) { in Perform()
8123 S.checkInitializerLifetime(Entity, Init); in Perform()
8126 if (Entity.getKind() == InitializedEntity::EK_Member && in Perform()
8127 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
8129 cast<FieldDecl>(Entity.getDecl()), in Perform()
8135 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
8199 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
8201 QualType DestType = Entity.getType(); in diagnoseListInit()
8222 if (auto *D = Entity.getDecl()) in diagnoseListInit()
8228 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
8236 const InitializedEntity &Entity, in Diagnose() argument
8255 QualType DestType = Entity.getType(); in Diagnose()
8275 << 1 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
8363 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
8457 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
8463 << (int)Entity.getKind() in Diagnose()
8470 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
8501 << 0 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
8539 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
8540 Entity.getKind() == InitializedEntity::EK_Member) && in Diagnose()
8551 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
8556 << Entity.getType() in Diagnose()
8560 = Entity.getBaseSpecifier()->getType()->getAs<RecordType>() in Diagnose()
8569 << Entity.getName() in Diagnose()
8571 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
8575 = Entity.getType()->getAs<RecordType>()) in Diagnose()
8621 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
8632 << Entity.getName(); in Diagnose()
8633 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
8634 << Entity.getName(); in Diagnose()
8649 diagnoseListInit(S, Entity, InitList); in Diagnose()
8673 PrintInitLocationNote(S, Entity); in Diagnose()
9110 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
9120 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
9125 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
9141 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
9145 Entity.isParameterKind() && Seq.isConstructorInitialization(); in PerformCopyInitialization()
9147 if (llvm::find(CurrentParameterCopyTypes, Entity.getType()) != in PerformCopyInitialization()
9175 CurrentParameterCopyTypes.push_back(Entity.getType()); in PerformCopyInitialization()
9178 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()
9197 TypeSourceInfo *TSInfo, const InitializedEntity &Entity, in DeduceTemplateSpecializationFromInitializer() argument