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
2010 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in CheckFlexibleArrayInit()
2013 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) { in CheckFlexibleArrayInit()
2032 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, in CheckStructUnionTypes() argument
2081 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2104 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
2148 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckStructUnionTypes()
2244 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2280 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
2304 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, in CheckStructUnionTypes()
2312 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2428 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, in CheckDesignatedInitializer() argument
2451 InitializationSequence Seq(SemaRef, Entity, Kind, Init, in CheckDesignatedInitializer()
2456 : Seq.Perform(SemaRef, Entity, Kind, Init); in CheckDesignatedInitializer()
2473 CheckSubElementType(Entity, IList, CurrentObjectType, Index, StructuredList, in CheckDesignatedInitializer()
2768 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field, in CheckDesignatedInitializer()
2784 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2803 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2838 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field, in CheckDesignatedInitializer()
3001 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
3035 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex, in CheckDesignatedInitializer()
3171 const InitializedEntity &Entity, InitListExpr *From) { in CanPerformAggregateInitializationForOverloadResolution() argument
3172 QualType Type = Entity.getType(); in CanPerformAggregateInitializationForOverloadResolution()
3173 InitListChecker Check(*this, Entity, From, Type, /*VerifyOnly=*/true, in CanPerformAggregateInitializationForOverloadResolution()
3845 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
3846 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
3849 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
3857 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
3866 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
3871 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
3872 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
3875 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
3877 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3883 } else if (Entity.getKind() == InitializedEntity::EK_Result || in MaybeProduceObjCObject()
3884 Entity.getKind() == InitializedEntity::EK_StmtExprResult) { in MaybeProduceObjCObject()
3885 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
3888 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3893 const InitializedEntity &Entity,
4070 const InitializedEntity &Entity, in TryConstructorInitialization() argument
4102 Entity.getKind() != InitializedEntity::EK_Base && in TryConstructorInitialization()
4103 Entity.getKind() != InitializedEntity::EK_Delegating && in TryConstructorInitialization()
4104 Entity.getKind() != in TryConstructorInitialization()
4197 Sequence.RewrapReferenceInitList(Entity.getType(), ILE); in TryConstructorInitialization()
4213 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
4215 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
4277 const InitializedEntity &Entity,
4287 const InitializedEntity &Entity,
4294 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
4305 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
4310 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
4337 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
4385 const InitializedEntity &Entity, in TryListInitialization() argument
4390 QualType DestType = Entity.getType(); in TryListInitialization()
4400 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
4428 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4445 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4453 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4472 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
4485 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
4533 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4562 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
4566 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
4571 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
4585 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in TryRefInitWithConversionFunction() argument
4588 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
4765 const InitializedEntity &Entity,
4770 const InitializedEntity &Entity, in TryReferenceInitialization() argument
4774 QualType DestType = Entity.getType(); in TryReferenceInitialization()
4790 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
4807 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
4815 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
4885 S, Entity, Kind, Initializer, /*AllowRValues*/ isRValueRef, in TryReferenceInitializationCore()
4976 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
5027 S, Entity, Kind, Initializer, /*AllowRValues*/ true, in TryReferenceInitializationCore()
5129 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
5133 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
5138 const InitializedEntity &Entity, in TryValueInitialization() argument
5148 QualType T = Entity.getType(); in TryValueInitialization()
5179 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5207 S, Entity, Kind, Args, T, Entity.getType(), Sequence, InitListSyntax); in TryValueInitialization()
5211 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
5216 const InitializedEntity &Entity, in TryDefaultInitialization() argument
5224 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
5230 TryConstructorInitialization(S, Entity, Kind, None, DestType, in TryDefaultInitialization()
5231 Entity.getType(), Sequence); in TryDefaultInitialization()
5241 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
5248 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
5444 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
5447 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
5448 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
5561 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
5574 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
5581 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
5602 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
5667 Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, in InitializationSequence() argument
5671 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
5688 static bool canPerformArrayCopy(const InitializedEntity &Entity) { in canPerformArrayCopy() argument
5689 switch (Entity.getKind()) { in canPerformArrayCopy()
5700 return isa<DecompositionDecl>(Entity.getDecl()); in canPerformArrayCopy()
5706 return Entity.isImplicitMemberInitializer(); in canPerformArrayCopy()
5711 if (auto *E = Entity.getParent()) in canPerformArrayCopy()
5723 const InitializedEntity &Entity, in InitializeFrom() argument
5751 QualType DestType = Entity.getType(); in InitializeFrom()
5781 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
5803 TryReferenceInitialization(S, Entity, Kind, Args[0], *this); in InitializeFrom()
5810 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
5816 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
5834 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
5860 Entity.getType()) && in InitializeFrom()
5861 canPerformArrayCopy(Entity)) { in InitializeFrom()
5870 InitializedEntity::InitializeElement(S.Context, 0, Entity); in InitializeFrom()
5880 AddArrayInitLoopStep(Entity.getType(), InitEltT); in InitializeFrom()
5903 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
5905 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
5921 Entity.isParameterKind(); in InitializeFrom()
5931 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
5940 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5956 TryConstructorInitialization(S, Entity, Kind, Args, in InitializeFrom()
6029 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6031 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
6069 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
6086 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) { in InitializeFrom()
6087 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
6100 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
6113 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
6114 switch(Entity.getKind()) { in getAssignmentAction()
6123 if (Entity.getDecl() && in getAssignmentAction()
6124 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6130 if (Entity.getDecl() && in getAssignmentAction()
6131 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
6167 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
6168 switch (Entity.getKind()) { in shouldBindAsTemporary()
6200 static bool shouldDestroyEntity(const InitializedEntity &Entity) { in shouldDestroyEntity() argument
6201 switch (Entity.getKind()) { in shouldDestroyEntity()
6232 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
6234 switch (Entity.getKind()) { in getInitializationLoc()
6237 return Entity.getReturnLoc(); in getInitializationLoc()
6240 return Entity.getThrowLoc(); in getInitializationLoc()
6244 return Entity.getDecl()->getLocation(); in getInitializationLoc()
6247 return Entity.getCaptureLoc(); in getInitializationLoc()
6291 const InitializedEntity &Entity, in CopyObject() argument
6304 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
6331 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6341 << (int)Entity.getKind() in CopyObject()
6349 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
6361 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
6434 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
6443 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
6451 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
6469 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
6475 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
6497 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
6498 if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) { in PrintInitLocationNote()
6499 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
6502 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
6503 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
6504 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
6506 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
6508 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
6509 Entity.getMethodDecl()) in PrintInitLocationNote()
6510 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
6512 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
6517 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
6520 switch (Entity.getKind()) { in isExplicitTemporary()
6543 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
6596 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
6601 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
6603 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
6621 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in PerformConstructorInitialization()
6630 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
6631 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ? in PerformConstructorInitialization()
6634 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
6648 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
6675 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
6679 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType())) in PerformConstructorInitialization()
6683 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
6723 const InitializedEntity *Entity, in getEntityLifetime() argument
6726 switch (Entity->getKind()) { in getEntityLifetime()
6729 return {Entity, LK_Extended}; in getEntityLifetime()
6733 if (Entity->getParent()) in getEntityLifetime()
6734 return getEntityLifetime(Entity->getParent(), Entity); in getEntityLifetime()
6748 return {Entity, Entity->isDefaultMemberInitializer() ? LK_Extended in getEntityLifetime()
6754 return {Entity, LK_Extended}; in getEntityLifetime()
6794 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
6798 if (Entity->getParent()) in getEntityLifetime()
6799 return getEntityLifetime(Entity->getParent(), InitField); in getEntityLifetime()
7602 void Sema::checkInitializerLifetime(const InitializedEntity &Entity, in checkInitializerLifetime() argument
7604 LifetimeResult LR = getEntityLifetime(&Entity); in checkInitializerLifetime()
7690 << RK << !Entity.getParent() in checkInitializerLifetime()
7713 bool IsSubobjectMember = ExtendingEntity != &Entity; in checkInitializerLifetime()
7779 << !Entity.getParent() << DiagRange; in checkInitializerLifetime()
7794 << Entity.getType()->isReferenceType() << DRE->getDecl() in checkInitializerLifetime()
7806 << Entity.getType()->isReferenceType() << DiagRange; in checkInitializerLifetime()
8047 const InitializedEntity &Entity, in Perform() argument
8052 Diagnose(S, Entity, Kind, Args); in Perform()
8057 if (Decl *D = Entity.getDecl()) in Perform()
8064 QualType DestType = Entity.getType(); in Perform()
8075 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
8077 QualType DeclType = Entity.getType(); in Perform()
8091 if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { in Perform()
8127 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
8129 !Entity.isParamOrTemplateParamKind()) { in Perform()
8139 QualType ETy = Entity.getType(); in Perform()
8145 Entity.getKind() == InitializedEntity::EK_Variable && Args.size() > 0) { in Perform()
8148 << SourceRange(Entity.getDecl()->getBeginLoc(), Args[0]->getEndLoc()); in Perform()
8152 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
8157 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
8158 Entity.getType(); in Perform()
8230 if (Entity.getKind() == InitializedEntity::EK_Base || in Perform()
8231 Entity.getKind() == InitializedEntity::EK_Delegating) in Perform()
8334 MTETy, CurInit.get(), Entity.getType()->isLValueReferenceType()); in Perform()
8354 if (!shouldBindAsTemporary(Entity)) in Perform()
8356 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8361 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
8400 Entity); in Perform()
8430 if (shouldBindAsTemporary(Entity)) in Perform()
8434 else if (CreatedObject && shouldDestroyEntity(Entity)) { in Perform()
8505 getAssignmentAction(Entity), CCK); in Perform()
8515 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
8529 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
8531 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
8571 Entity.getType().getNonReferenceType()); in Perform()
8572 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8579 Entity, in Perform()
8617 Entity.getType().getNonReferenceType()); in Perform()
8618 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
8626 S, UseTemporary ? TempEntity : Entity, Kind, in Perform()
8648 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
8654 Entity.getType().getNonLValueExprType(S.Context), TSInfo, in Perform()
8670 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
8678 Entity.isParameterKind() && in Perform()
8690 getAssignmentAction(Entity, true), in Perform()
8692 PrintInitLocationNote(S, Entity); in Perform()
8695 PrintInitLocationNote(S, Entity); in Perform()
8701 bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType(); in Perform()
8797 if (shouldBindAsTemporary(Entity)) in Perform()
8823 if (Entity.isParameterKind()) { in Perform()
8911 S.checkInitializerLifetime(Entity, Init); in Perform()
8914 if (Entity.getKind() == InitializedEntity::EK_Member && in Perform()
8915 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
8917 cast<FieldDecl>(Entity.getDecl()), in Perform()
8923 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
9001 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
9003 QualType DestType = Entity.getType(); in diagnoseListInit()
9024 if (auto *D = Entity.getDecl()) in diagnoseListInit()
9030 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
9038 const InitializedEntity &Entity, in Diagnose() argument
9057 QualType DestType = Entity.getType(); in Diagnose()
9077 << 1 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9168 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
9284 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9290 << (int)Entity.getKind() in Diagnose()
9297 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
9328 << 0 << Entity.getType() << Args[0]->getSourceRange(); in Diagnose()
9368 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
9369 Entity.getKind() == InitializedEntity::EK_Member) && in Diagnose()
9380 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
9385 << Entity.getType() in Diagnose()
9389 = Entity.getBaseSpecifier()->getType()->castAs<RecordType>() in Diagnose()
9398 << Entity.getName() in Diagnose()
9400 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
9404 = Entity.getType()->getAs<RecordType>()) in Diagnose()
9453 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
9464 << Entity.getName(); in Diagnose()
9465 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
9466 << Entity.getName(); in Diagnose()
9481 diagnoseListInit(S, Entity, InitList); in Diagnose()
9505 PrintInitLocationNote(S, Entity); in Diagnose()
9950 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
9960 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
9965 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
9981 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
9985 Entity.isParameterKind() && Seq.isConstructorInitialization(); in PerformCopyInitialization()
9987 if (llvm::is_contained(CurrentParameterCopyTypes, Entity.getType())) { in PerformCopyInitialization()
10014 CurrentParameterCopyTypes.push_back(Entity.getType()); in PerformCopyInitialization()
10017 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()
10036 TypeSourceInfo *TSInfo, const InitializedEntity &Entity, in DeduceTemplateSpecializationFromInitializer() argument