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()
3817 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
3818 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
3821 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
3829 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
3838 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
3843 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
3844 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
3847 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
3849 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3855 } else if (Entity.getKind() == InitializedEntity::EK_Result || in MaybeProduceObjCObject()
3856 Entity.getKind() == InitializedEntity::EK_StmtExprResult) { in MaybeProduceObjCObject()
3857 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
3860 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3865 const InitializedEntity &Entity,
4042 const InitializedEntity &Entity, in TryConstructorInitialization() argument
4074 Entity.getKind() != InitializedEntity::EK_Base && in TryConstructorInitialization()
4075 Entity.getKind() != InitializedEntity::EK_Delegating && in TryConstructorInitialization()
4076 Entity.getKind() != in TryConstructorInitialization()
4169 Sequence.RewrapReferenceInitList(Entity.getType(), ILE); in TryConstructorInitialization()
4185 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
4187 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
4249 const InitializedEntity &Entity,
4259 const InitializedEntity &Entity,
4266 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
4277 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
4282 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
4309 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
4357 const InitializedEntity &Entity, in TryListInitialization() argument
4362 QualType DestType = Entity.getType(); in TryListInitialization()
4372 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
4400 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4417 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4425 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4444 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
4457 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4505 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4534 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4538 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4543 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
4557 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryRefInitWithConversionFunction() argument
4560 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
4737 const InitializedEntity &Entity,
4742 const InitializedEntity &Entity, in TryReferenceInitialization() argument
4746 QualType DestType = Entity.getType(); in TryReferenceInitialization()
4762 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
4779 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
4787 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
4857 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef, in TryReferenceInitializationCore()
4948 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
4999 S, Entity, Kind, Initializer, /*AllowRValues*/ true, in TryReferenceInitializationCore()
5101 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
5105 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
5110 const InitializedEntity &Entity, in TryValueInitialization() argument
5120 QualType T = Entity.getType(); in TryValueInitialization()
5151 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5179 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax); in TryValueInitialization()
5183 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5188 const InitializedEntity &Entity, in TryDefaultInitialization() argument
5196 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
5202 TryConstructorInitialization(S, Entity, Kind, None, DestType, in TryDefaultInitialization()
5203 Entity.getType(), Sequence); in TryDefaultInitialization()
5213 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
5220 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
5416 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
5419 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
5420 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
5533 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
5546 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
5553 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
5574 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
5639 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in InitializationSequence() argument
5643 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
5660 static bool canPerformArrayCopy(const InitializedEntity &Entity) { in canPerformArrayCopy() argument
5661 switch (Entity.getKind()) { in canPerformArrayCopy()
5672 return isa<DecompositionDecl>(Entity.getDecl()); in canPerformArrayCopy()
5678 return Entity.isImplicitMemberInitializer(); in canPerformArrayCopy()
5683 if (auto *E = Entity.getParent()) in canPerformArrayCopy()
5695 const InitializedEntity &Entity, in InitializeFrom() argument
5723 QualType DestType = Entity.getType(); in InitializeFrom()
5753 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
5775 TryReferenceInitialization(S, Entity, Kind, Args[0], *this); in InitializeFrom()
5782 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
5788 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
5806 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
5832 Entity.getType()) && in InitializeFrom()
5833 canPerformArrayCopy(Entity)) { in InitializeFrom()
5842 InitializedEntity::InitializeElement(S.Context, 0, Entity); in InitializeFrom()
5852 AddArrayInitLoopStep(Entity.getType(), InitEltT); in InitializeFrom()
5875 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
5877 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
5893 Entity.isParameterKind(); in InitializeFrom()
5903 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
5912 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5928 TryConstructorInitialization(S, Entity, Kind, Args, in InitializeFrom()
5970 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5972 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
6010 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
6027 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) { in InitializeFrom()
6028 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
6041 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6054 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
6055 switch(Entity.getKind()) { in getAssignmentAction()
6064 if (Entity.getDecl() && in getAssignmentAction()
6065 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6071 if (Entity.getDecl() && in getAssignmentAction()
6072 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6108 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
6109 switch (Entity.getKind()) { in shouldBindAsTemporary()
6141 static bool shouldDestroyEntity(const InitializedEntity &Entity) { in shouldDestroyEntity() argument
6142 switch (Entity.getKind()) { in shouldDestroyEntity()
6173 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
6175 switch (Entity.getKind()) { in getInitializationLoc()
6178 return Entity.getReturnLoc(); in getInitializationLoc()
6181 return Entity.getThrowLoc(); in getInitializationLoc()
6185 return Entity.getDecl()->getLocation(); in getInitializationLoc()
6188 return Entity.getCaptureLoc(); in getInitializationLoc()
6232 const InitializedEntity &Entity, in CopyObject() argument
6245 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
6272 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6282 << (int)Entity.getKind() in CopyObject()
6290 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6302 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
6375 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
6384 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
6392 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
6410 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
6416 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
6438 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
6439 if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) { in PrintInitLocationNote()
6440 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
6443 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
6444 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
6445 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
6447 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
6449 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
6450 Entity.getMethodDecl()) in PrintInitLocationNote()
6451 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
6453 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
6458 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
6461 switch (Entity.getKind()) { in isExplicitTemporary()
6484 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
6537 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
6542 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
6544 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
6562 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in PerformConstructorInitialization()
6571 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
6572 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ? in PerformConstructorInitialization()
6575 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
6589 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
6616 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
6620 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType())) in PerformConstructorInitialization()
6624 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
6664 const InitializedEntity *Entity, in getEntityLifetime() argument
6667 switch (Entity->getKind()) { in getEntityLifetime()
6670 return {Entity, LK_Extended}; in getEntityLifetime()
6674 if (Entity->getParent()) in getEntityLifetime()
6675 return getEntityLifetime(Entity->getParent(), Entity); in getEntityLifetime()
6689 return {Entity, Entity->isDefaultMemberInitializer() ? LK_Extended in getEntityLifetime()
6695 return {Entity, LK_Extended}; in getEntityLifetime()
6735 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
6739 if (Entity->getParent()) in getEntityLifetime()
6740 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
7543 void Sema::checkInitializerLifetime(const InitializedEntity &Entity, in checkInitializerLifetime() argument
7545 LifetimeResult LR = getEntityLifetime(&Entity); in checkInitializerLifetime()
7631 << RK << !Entity.getParent() in checkInitializerLifetime()
7654 bool IsSubobjectMember = ExtendingEntity != &Entity; in checkInitializerLifetime()
7720 << !Entity.getParent() << DiagRange; in checkInitializerLifetime()
7735 << Entity.getType()->isReferenceType() << DRE->getDecl() in checkInitializerLifetime()
7747 << Entity.getType()->isReferenceType() << DiagRange; in checkInitializerLifetime()
7988 const InitializedEntity &Entity, in Perform() argument
7993 Diagnose(S, Entity, Kind, Args); in Perform()
7998 if (Decl *D = Entity.getDecl()) in Perform()
8005 QualType DestType = Entity.getType(); in Perform()
8016 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
8018 QualType DeclType = Entity.getType(); in Perform()
8032 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { in Perform()
8068 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
8070 !Entity.isParamOrTemplateParamKind()) { in Perform()
8080 QualType ETy = Entity.getType(); in Perform()
8086 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { in Perform()
8089 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); in Perform()
8093 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
8098 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
8099 Entity.getType(); in Perform()
8165 if (Entity.getKind() == InitializedEntity::EK_Base || in Perform()
8166 Entity.getKind() == InitializedEntity::EK_Delegating) in Perform()
8265 MTETy, CurInit.get(), Entity.getType()->isLValueReferenceType()); in Perform()
8285 if (!shouldBindAsTemporary(Entity)) in Perform()
8287 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8292 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8331 Entity); in Perform()
8361 if (shouldBindAsTemporary(Entity)) in Perform()
8365 else if (CreatedObject && shouldDestroyEntity(Entity)) { in Perform()
8436 getAssignmentAction(Entity), CCK); in Perform()
8446 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
8460 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
8462 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
8502 Entity.getType().getNonReferenceType()); in Perform()
8503 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8510 Entity, in Perform()
8548 Entity.getType().getNonReferenceType()); in Perform()
8549 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8557 S, UseTemporary ? TempEntity : Entity, Kind, in Perform()
8579 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
8585 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in Perform()
8601 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
8609 Entity.isParameterKind() && in Perform()
8621 getAssignmentAction(Entity, true), in Perform()
8623 PrintInitLocationNote(S, Entity); in Perform()
8626 PrintInitLocationNote(S, Entity); in Perform()
8632 bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType(); in Perform()
8728 if (shouldBindAsTemporary(Entity)) in Perform()
8754 if (Entity.isParameterKind()) { in Perform()
8842 S.checkInitializerLifetime(Entity, Init); in Perform()
8845 if (Entity.getKind() == InitializedEntity::EK_Member && in Perform()
8846 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
8848 cast<FieldDecl>(Entity.getDecl()), in Perform()
8854 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
8928 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
8930 QualType DestType = Entity.getType(); in diagnoseListInit()
8951 if (auto *D = Entity.getDecl()) in diagnoseListInit()
8957 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
8965 const InitializedEntity &Entity, in Diagnose() argument
8984 QualType DestType = Entity.getType(); in Diagnose()
9004 << 1 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9095 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
9211 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9217 << (int)Entity.getKind() in Diagnose()
9224 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9255 << 0 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9295 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
9296 Entity.getKind() == InitializedEntity::EK_Member) && in Diagnose()
9307 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
9312 << Entity.getType() in Diagnose()
9316 = Entity.getBaseSpecifier()->getType()->castAs<RecordType>() in Diagnose()
9325 << Entity.getName() in Diagnose()
9327 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
9331 = Entity.getType()->getAs<RecordType>()) in Diagnose()
9380 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
9391 << Entity.getName(); in Diagnose()
9392 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
9393 << Entity.getName(); in Diagnose()
9408 diagnoseListInit(S, Entity, InitList); in Diagnose()
9432 PrintInitLocationNote(S, Entity); in Diagnose()
9877 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
9887 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
9892 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
9908 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
9912 Entity.isParameterKind() && Seq.isConstructorInitialization(); in PerformCopyInitialization()
9914 if (llvm::find(CurrentParameterCopyTypes, Entity.getType()) != in PerformCopyInitialization()
9942 CurrentParameterCopyTypes.push_back(Entity.getType()); in PerformCopyInitialization()
9945 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()
9964 TypeSourceInfo *TSInfo, const InitializedEntity &Entity, in DeduceTemplateSpecializationFromInitializer() argument