Lines Matching refs:Entity
245 void CheckImplicitInitList(const InitializedEntity &Entity,
249 void CheckExplicitInitList(const InitializedEntity &Entity,
253 void CheckListElementTypes(const InitializedEntity &Entity,
260 void CheckSubElementType(const InitializedEntity &Entity,
265 void CheckComplexType(const InitializedEntity &Entity,
270 void CheckScalarType(const InitializedEntity &Entity,
275 void CheckReferenceType(const InitializedEntity &Entity,
280 void CheckVectorType(const InitializedEntity &Entity,
284 void CheckStructUnionTypes(const InitializedEntity &Entity,
292 void CheckArrayType(const InitializedEntity &Entity,
298 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
323 const InitializedEntity &Entity,
354 void FillInEmptyInitializations(const InitializedEntity &Entity,
357 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
360 void CheckEmptyInitializable(const InitializedEntity &Entity,
364 InitListChecker(Sema &S, const InitializedEntity &Entity,
378 const InitializedEntity &Entity, in PerformEmptyInit() argument
392 Entity.getType()->getBaseElementTypeUnsafe()->isRecordType(); in PerformEmptyInit()
414 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
448 SemaRef, Entity, in PerformEmptyInit()
457 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
458 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
460 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) in PerformEmptyInit()
468 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
469 if (Entity.getKind() == InitializedEntity::EK_Member) in PerformEmptyInit()
470 SemaRef.Diag(Entity.getDecl()->getLocation(), in PerformEmptyInit()
472 << /*field*/1 << Entity.getDecl(); in PerformEmptyInit()
473 else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) in PerformEmptyInit()
475 << /*array element*/0 << Entity.getElementIndex(); in PerformEmptyInit()
481 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit); in PerformEmptyInit()
484 void InitListChecker::CheckEmptyInitializable(const InitializedEntity &Entity, in CheckEmptyInitializable() argument
488 if (PerformEmptyInit(SemaRef, Loc, Entity, /*VerifyOnly*/true, in CheckEmptyInitializable()
615 InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, in FillInEmptyInitializations() argument
626 Entity, ILE, RequiresSecondPass, FillWithNoInit); in FillInEmptyInitializations()
631 FillInEmptyInitForField(0, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
653 FillInEmptyInitForBase(Init, Base, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
666 FillInEmptyInitForField(Init, Field, Entity, ILE, RequiresSecondPass, in FillInEmptyInitializations()
684 InitializedEntity ElementEntity = Entity; in FillInEmptyInitializations()
692 0, Entity); in FillInEmptyInitializations()
697 0, Entity); in FillInEmptyInitializations()
767 InitListChecker::InitListChecker(Sema &S, const InitializedEntity &Entity, in InitListChecker() argument
780 CheckExplicitInitList(Entity, IL, T, FullyStructuredList, in InitListChecker()
785 FillInEmptyInitializations(Entity, FullyStructuredList, RequiresSecondPass); in InitListChecker()
787 FillInEmptyInitializations(Entity, FullyStructuredList, in InitListChecker()
822 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity, in CheckImplicitInitList() argument
857 CheckListElementTypes(Entity, ParentIList, T, in CheckImplicitInitList()
892 static void warnBracedScalarInit(Sema &S, const InitializedEntity &Entity, in warnBracedScalarInit() argument
902 switch (Entity.getKind()) { in warnBracedScalarInit()
916 if (Entity.getParent()) in warnBracedScalarInit()
956 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity, in CheckExplicitInitList() argument
966 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true, in CheckExplicitInitList()
1028 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange()); in CheckExplicitInitList()
1031 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity, in CheckListElementTypes() argument
1042 CheckComplexType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1045 CheckScalarType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1048 CheckVectorType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1059 CheckStructUnionTypes(Entity, IList, DeclType, Bases, RD->field_begin(), in CheckListElementTypes()
1066 CheckArrayType(Entity, IList, DeclType, Zero, in CheckListElementTypes()
1077 CheckReferenceType(Entity, IList, DeclType, Index, in CheckListElementTypes()
1092 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity, in CheckSubElementType() argument
1101 return CheckReferenceType(Entity, IList, ElemType, Index, in CheckSubElementType()
1114 CheckExplicitInitList(Entity, SubInitList, ElemType, in CheckSubElementType()
1119 FillInEmptyInitializations(Entity, InnerStructuredList, in CheckSubElementType()
1122 FillInEmptyInitializations(Entity, InnerStructuredList, in CheckSubElementType()
1149 InitializationSequence Seq(SemaRef, Entity, Kind, expr, in CheckSubElementType()
1161 Seq.Perform(SemaRef, Entity, Kind, expr); in CheckSubElementType()
1176 return CheckScalarType(Entity, IList, ElemType, Index, in CheckSubElementType()
1234 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList, in CheckSubElementType()
1241 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr, in CheckSubElementType()
1250 void InitListChecker::CheckComplexType(const InitializedEntity &Entity, in CheckComplexType() argument
1265 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList, in CheckComplexType()
1277 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckComplexType()
1286 void InitListChecker::CheckScalarType(const InitializedEntity &Entity, in CheckScalarType() argument
1313 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList, in CheckScalarType()
1328 if (!SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckScalarType()
1335 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(), expr, in CheckScalarType()
1357 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity, in CheckReferenceType() argument
1390 if (!SemaRef.CanPerformCopyInitialization(Entity,expr)) in CheckReferenceType()
1397 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(), expr, in CheckReferenceType()
1413 void InitListChecker::CheckVectorType(const InitializedEntity &Entity, in CheckVectorType() argument
1427 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity), in CheckVectorType()
1438 if (!SemaRef.CanPerformCopyInitialization(Entity, Init)) in CheckVectorType()
1445 SemaRef.PerformCopyInitialization(Entity, Init->getLocStart(), Init, in CheckVectorType()
1469 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1488 const VectorType *T = Entity.getType()->getAs<VectorType>(); in CheckVectorType()
1527 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckVectorType()
1568 void InitListChecker::CheckArrayType(const InitializedEntity &Entity, in CheckArrayType() argument
1633 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckArrayType()
1662 Entity); in CheckArrayType()
1693 SemaRef.Context, 0, Entity), in CheckArrayType()
1698 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity, in CheckFlexibleArrayInit() argument
1715 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in CheckFlexibleArrayInit()
1718 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) { in CheckFlexibleArrayInit()
1738 const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, in CheckStructUnionTypes() argument
1778 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
1801 SemaRef.Context, &Base, false, &Entity); in CheckStructUnionTypes()
1830 if (CheckDesignatedInitializer(Entity, IList, DIE, 0, in CheckStructUnionTypes()
1878 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
1914 InitializedEntity::InitializeMember(*Field, &Entity), in CheckStructUnionTypes()
1923 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, in CheckStructUnionTypes()
1931 InitializedEntity::InitializeMember(*Field, &Entity); in CheckStructUnionTypes()
2041 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, in CheckDesignatedInitializer() argument
2063 CheckSubElementType(Entity, IList, CurrentObjectType, Index, in CheckDesignatedInitializer()
2323 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field, in CheckDesignatedInitializer()
2339 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2358 InitializedEntity::InitializeMember(*Field, &Entity); in CheckDesignatedInitializer()
2393 CheckStructUnionTypes(Entity, IList, CurrentObjectType, NoBases, Field, in CheckDesignatedInitializer()
2548 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity); in CheckDesignatedInitializer()
2582 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex, in CheckDesignatedInitializer()
3349 const InitializedEntity &Entity) { in maybeRecoverWithZeroInitialization() argument
3350 if (Entity.getKind() != InitializedEntity::EK_Variable) in maybeRecoverWithZeroInitialization()
3353 VarDecl *VD = cast<VarDecl>(Entity.getDecl()); in maybeRecoverWithZeroInitialization()
3361 Sequence.AddZeroInitializationStep(Entity.getType()); in maybeRecoverWithZeroInitialization()
3370 const InitializedEntity &Entity) { in MaybeProduceObjCObject() argument
3375 if (Entity.isParameterKind()) { in MaybeProduceObjCObject()
3376 if (!Entity.isParameterConsumed()) in MaybeProduceObjCObject()
3379 assert(Entity.getType()->isObjCRetainableType() && in MaybeProduceObjCObject()
3381 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3387 } else if (Entity.getKind() == InitializedEntity::EK_Result) { in MaybeProduceObjCObject()
3388 if (!Entity.getType()->isObjCRetainableType()) in MaybeProduceObjCObject()
3391 Sequence.AddProduceObjCObjectStep(Entity.getType()); in MaybeProduceObjCObject()
3396 const InitializedEntity &Entity,
3512 const InitializedEntity &Entity, in TryConstructorInitialization() argument
3607 Entity.getType().isConstQualified()) { in TryConstructorInitialization()
3609 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryConstructorInitialization()
3660 const InitializedEntity &Entity,
3670 const InitializedEntity &Entity,
3677 const InitializedEntity &Entity, in TryReferenceListInitialization() argument
3688 if (Entity.getKind() == InitializedEntity::EK_CompoundLiteralInit) { in TryReferenceListInitialization()
3693 QualType DestType = Entity.getType(); in TryReferenceListInitialization()
3722 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceListInitialization()
3751 const InitializedEntity &Entity, in TryListInitialization() argument
3756 QualType DestType = Entity.getType(); in TryListInitialization()
3766 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence, in TryListInitialization()
3794 TryConstructorInitialization(S, Entity, Kind, InitAsExpr, DestType, in TryListInitialization()
3810 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
3818 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
3837 TryValueInitialization(S, Entity, Kind, Sequence, InitList); in TryListInitialization()
3850 TryConstructorInitialization(S, Entity, Kind, InitListAsExpr, DestType, in TryListInitialization()
3896 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
3921 Sequence.InitializeFrom(S, Entity, SubKind, SubInit, in TryListInitialization()
3925 Sequence.RewrapReferenceInitList(Entity.getType(), InitList); in TryListInitialization()
3930 InitListChecker CheckInitList(S, Entity, InitList, in TryListInitialization()
3944 const InitializedEntity &Entity, in TryRefInitWithConversionFunction() argument
3949 QualType DestType = Entity.getType(); in TryRefInitWithConversionFunction()
4120 const InitializedEntity &Entity,
4125 const InitializedEntity &Entity, in TryReferenceInitialization() argument
4129 QualType DestType = Entity.getType(); in TryReferenceInitialization()
4145 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1, in TryReferenceInitialization()
4201 const InitializedEntity &Entity, in TryReferenceInitializationCore() argument
4209 QualType DestType = Entity.getType(); in TryReferenceInitializationCore()
4273 S, Entity, Kind, Initializer, /*AllowRValues*/isRValueRef, Sequence); in TryReferenceInitializationCore()
4328 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer); in TryReferenceInitializationCore()
4356 S, Entity, Kind, Initializer, /*AllowRValues*/true, Sequence); in TryReferenceInitializationCore()
4438 const InitializedEntity &Entity, in TryStringLiteralInitialization() argument
4442 Sequence.AddStringInitStep(Entity.getType()); in TryStringLiteralInitialization()
4447 const InitializedEntity &Entity, in TryValueInitialization() argument
4457 QualType T = Entity.getType(); in TryValueInitialization()
4490 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
4515 return TryConstructorInitialization(S, Entity, Kind, Args, T, Sequence, in TryValueInitialization()
4520 Sequence.AddZeroInitializationStep(Entity.getType()); in TryValueInitialization()
4525 const InitializedEntity &Entity, in TryDefaultInitialization() argument
4533 QualType DestType = S.Context.getBaseElementType(Entity.getType()); in TryDefaultInitialization()
4539 TryConstructorInitialization(S, Entity, Kind, None, DestType, Sequence); in TryDefaultInitialization()
4549 if (!maybeRecoverWithZeroInitialization(S, Sequence, Entity)) in TryDefaultInitialization()
4556 Sequence.AddZeroInitializationStep(Entity.getType()); in TryDefaultInitialization()
4722 const InitializedEntity &Entity, in isLibstdcxxPointerReturnFalseHack() argument
4725 Entity.getKind() == InitializedEntity::EK_Result && in isLibstdcxxPointerReturnFalseHack()
4726 Entity.getType()->isPointerType() && in isLibstdcxxPointerReturnFalseHack()
4839 const InitializedEntity &Entity, in tryObjCWritebackConversion() argument
4852 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(), in tryObjCWritebackConversion()
4859 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in tryObjCWritebackConversion()
4880 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy); in tryObjCWritebackConversion()
4918 const InitializedEntity &Entity, in InitializationSequence() argument
4924 InitializeFrom(S, Entity, Kind, Args, TopLevelOfInitList, in InitializationSequence()
4940 const InitializedEntity &Entity, in InitializeFrom() argument
4968 QualType DestType = Entity.getType(); in InitializeFrom()
4998 TryListInitialization(S, Entity, Kind, InitList, *this, in InitializeFrom()
5014 TryReferenceInitialization(S, Entity, Kind, Args[0], *this); in InitializeFrom()
5021 TryValueInitialization(S, Entity, Kind, *this); in InitializeFrom()
5027 TryDefaultInitialization(S, Entity, Kind, *this); in InitializeFrom()
5045 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this); in InitializeFrom()
5080 Entity.getKind() == InitializedEntity::EK_Member && in InitializeFrom()
5082 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer), in InitializeFrom()
5098 Entity.isParameterKind(); in InitializeFrom()
5105 tryObjCWritebackConversion(S, *this, Entity, Initializer)) { in InitializeFrom()
5117 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5133 TryConstructorInitialization(S, Entity, Kind, Args, in InitializeFrom()
5170 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5172 AddAtomicConversionStep(Entity.getType()); in InitializeFrom()
5197 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl())) in InitializeFrom()
5214 if (isLibstdcxxPointerReturnFalseHack(S, Entity, Initializer)) { in InitializeFrom()
5215 AddZeroInitializationStep(Entity.getType()); in InitializeFrom()
5228 MaybeProduceObjCObject(S, *this, Entity); in InitializeFrom()
5241 getAssignmentAction(const InitializedEntity &Entity, bool Diagnose = false) { in getAssignmentAction() argument
5242 switch(Entity.getKind()) { in getAssignmentAction()
5251 if (Entity.getDecl() && in getAssignmentAction()
5252 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
5258 if (Entity.getDecl() && in getAssignmentAction()
5259 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext())) in getAssignmentAction()
5287 static bool shouldBindAsTemporary(const InitializedEntity &Entity) { in shouldBindAsTemporary() argument
5288 switch (Entity.getKind()) { in shouldBindAsTemporary()
5316 static bool shouldDestroyTemporary(const InitializedEntity &Entity) { in shouldDestroyTemporary() argument
5317 switch (Entity.getKind()) { in shouldDestroyTemporary()
5388 static SourceLocation getInitializationLoc(const InitializedEntity &Entity, in getInitializationLoc() argument
5390 switch (Entity.getKind()) { in getInitializationLoc()
5392 return Entity.getReturnLoc(); in getInitializationLoc()
5395 return Entity.getThrowLoc(); in getInitializationLoc()
5398 return Entity.getDecl()->getLocation(); in getInitializationLoc()
5401 return Entity.getCaptureLoc(); in getInitializationLoc()
5443 const InitializedEntity &Entity, in CopyObject() argument
5472 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get()); in CopyObject()
5496 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5505 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5512 << (int)Entity.getKind() << CurInitExpr->getType() in CopyObject()
5522 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity, in CopyObject()
5569 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity)) in CopyObject()
5578 const InitializedEntity &Entity, in CheckCXX98CompatAccessibleCopy() argument
5586 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr); in CheckCXX98CompatAccessibleCopy()
5600 << OR << (int)Entity.getKind() << CurInitExpr->getType() in CheckCXX98CompatAccessibleCopy()
5606 Best->FoundDecl, Entity, Diag); in CheckCXX98CompatAccessibleCopy()
5628 const InitializedEntity &Entity) { in PrintInitLocationNote() argument
5629 if (Entity.isParameterKind() && Entity.getDecl()) { in PrintInitLocationNote()
5630 if (Entity.getDecl()->getLocation().isInvalid()) in PrintInitLocationNote()
5633 if (Entity.getDecl()->getDeclName()) in PrintInitLocationNote()
5634 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here) in PrintInitLocationNote()
5635 << Entity.getDecl()->getDeclName(); in PrintInitLocationNote()
5637 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here); in PrintInitLocationNote()
5639 else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && in PrintInitLocationNote()
5640 Entity.getMethodDecl()) in PrintInitLocationNote()
5641 S.Diag(Entity.getMethodDecl()->getLocation(), in PrintInitLocationNote()
5643 << Entity.getMethodDecl()->getDeclName(); in PrintInitLocationNote()
5653 static bool isExplicitTemporary(const InitializedEntity &Entity, in isExplicitTemporary() argument
5656 switch (Entity.getKind()) { in isExplicitTemporary()
5679 const InitializedEntity &Entity, in PerformConstructorInitialization() argument
5730 if (isExplicitTemporary(Entity, Kind, NumArgs)) { in PerformConstructorInitialization()
5735 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in PerformConstructorInitialization()
5737 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc); in PerformConstructorInitialization()
5760 if (Entity.getKind() == InitializedEntity::EK_Base) { in PerformConstructorInitialization()
5761 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ? in PerformConstructorInitialization()
5764 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) { in PerformConstructorInitialization()
5778 if (Entity.allowsNRVO()) in PerformConstructorInitialization()
5779 CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(), in PerformConstructorInitialization()
5790 CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(), in PerformConstructorInitialization()
5805 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity); in PerformConstructorInitialization()
5809 if (shouldBindAsTemporary(Entity)) in PerformConstructorInitialization()
5819 InitializedEntityOutlivesFullExpression(const InitializedEntity &Entity) { in InitializedEntityOutlivesFullExpression() argument
5820 const InitializedEntity *Top = &Entity; in InitializedEntityOutlivesFullExpression()
5859 const InitializedEntity *Entity, in getEntityForTemporaryLifetimeExtension() argument
5862 switch (Entity->getKind()) { in getEntityForTemporaryLifetimeExtension()
5865 return Entity; in getEntityForTemporaryLifetimeExtension()
5869 if (Entity->getParent()) in getEntityForTemporaryLifetimeExtension()
5870 return getEntityForTemporaryLifetimeExtension(Entity->getParent(), in getEntityForTemporaryLifetimeExtension()
5871 Entity); in getEntityForTemporaryLifetimeExtension()
5876 return Entity; in getEntityForTemporaryLifetimeExtension()
5903 return getEntityForTemporaryLifetimeExtension(Entity->getParent(), in getEntityForTemporaryLifetimeExtension()
5908 if (Entity->getParent()) in getEntityForTemporaryLifetimeExtension()
5909 return getEntityForTemporaryLifetimeExtension(Entity->getParent(), in getEntityForTemporaryLifetimeExtension()
5910 Entity); in getEntityForTemporaryLifetimeExtension()
6038 static void warnOnLifetimeExtension(Sema &S, const InitializedEntity &Entity, in warnOnLifetimeExtension() argument
6050 for (const InitializedEntity *Ent = Entity.getParent(); Ent; in warnOnLifetimeExtension()
6209 const InitializedEntity &Entity, in Perform() argument
6214 Diagnose(S, Entity, Kind, Args); in Perform()
6219 if (Decl *D = Entity.getDecl()) in Perform()
6226 QualType DestType = Entity.getType(); in Perform()
6237 if (ResultType && !Entity.getType()->isDependentType() && in Perform()
6239 QualType DeclType = Entity.getType(); in Perform()
6253 if (DeclaratorDecl *DD = Entity.getDecl()) { in Perform()
6289 if (S.getLangOpts().CPlusPlus11 && Entity.getType()->isReferenceType() && in Perform()
6291 !Entity.isParameterKind()) { in Perform()
6303 Entity.getType()->isPointerType() && in Perform()
6304 InitializedEntityOutlivesFullExpression(Entity)) { in Perform()
6312 QualType DestType = Entity.getType().getNonReferenceType(); in Perform()
6317 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() : in Perform()
6318 Entity.getType(); in Perform()
6424 << Entity.getType().isVolatileQualified() in Perform()
6437 << Entity.getType().isVolatileQualified() in Perform()
6439 PrintInitLocationNote(S, Entity); in Perform()
6453 getEntityForTemporaryLifetimeExtension(&Entity)) in Perform()
6455 warnOnLifetimeExtension(S, Entity, CurInit.get(), in Perform()
6472 Entity.getType().getNonReferenceType(), CurInit.get(), in Perform()
6473 Entity.getType()->isLValueReferenceType()); in Perform()
6478 getEntityForTemporaryLifetimeExtension(&Entity)) in Perform()
6480 warnOnLifetimeExtension(S, Entity, CurInit.get(), /*IsInitializerList=*/false, in Perform()
6498 CurInit = CopyObject(S, Step->Type, Entity, CurInit, in Perform()
6539 Entity); in Perform()
6581 bool MaybeBindToTemp = RequiresCopy || shouldBindAsTemporary(Entity); in Perform()
6583 if (!MaybeBindToTemp && CreatedObject && shouldDestroyTemporary(Entity)) { in Perform()
6602 CurInit = CopyObject(S, Entity.getType().getNonReferenceType(), Entity, in Perform()
6645 getAssignmentAction(Entity), CCK); in Perform()
6652 DiagnoseNarrowingInInitList(S, *Step->ICS, SourceType, Entity.getType(), in Perform()
6662 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty); in Perform()
6664 InitializedEntity InitEntity = IsTemporary ? TempEntity : Entity; in Perform()
6701 Entity.getType().getNonReferenceType()); in Perform()
6702 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
6709 Entity, in Perform()
6744 Entity.getType().getNonReferenceType()); in Perform()
6745 bool UseTemporary = Entity.getType()->isReferenceType(); in Perform()
6749 S, UseTemporary ? TempEntity : Entity, Kind, Args, *Step, in Perform()
6770 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo(); in Perform()
6791 Entity.getKind() == InitializedEntity::EK_Parameter_CF_Audited); in Perform()
6799 Entity.isParameterKind() && in Perform()
6811 getAssignmentAction(Entity, true), in Perform()
6813 PrintInitLocationNote(S, Entity); in Perform()
6816 PrintInitLocationNote(S, Entity); in Perform()
6890 getEntityForTemporaryLifetimeExtension(&Entity)) in Perform()
6892 warnOnLifetimeExtension(S, Entity, CurInit.get(), in Perform()
6901 if (shouldBindAsTemporary(Entity)) in Perform()
6912 if (Entity.isParameterKind()) { in Perform()
6916 } else if (Entity.getKind() != InitializedEntity::EK_Variable) { in Perform()
6935 if (Entity.getKind() == InitializedEntity::EK_Member && in Perform()
6936 cast<FieldDecl>(Entity.getDecl())->isBitField()) in Perform()
6938 cast<FieldDecl>(Entity.getDecl()), in Perform()
6944 Entity.getKind() == InitializedEntity::EK_Result); in Perform()
7008 static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, in diagnoseListInit() argument
7010 QualType DestType = Entity.getType(); in diagnoseListInit()
7031 if (auto *D = Entity.getDecl()) in diagnoseListInit()
7037 InitListChecker DiagnoseInitList(S, Entity, InitList, DestType, in diagnoseListInit()
7045 const InitializedEntity &Entity, in Diagnose() argument
7051 QualType DestType = Entity.getType(); in Diagnose()
7143 << (Entity.getKind() == InitializedEntity::EK_Result) in Diagnose()
7219 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
7225 << (int)Entity.getKind() in Diagnose()
7232 emitBadConversionNotes(S, Entity, Args[0]); in Diagnose()
7296 (Entity.getKind() == InitializedEntity::EK_Base || in Diagnose()
7297 Entity.getKind() == InitializedEntity::EK_Member) && in Diagnose()
7308 if (Entity.getKind() == InitializedEntity::EK_Base) { in Diagnose()
7313 << Entity.getType() in Diagnose()
7317 = Entity.getBaseSpecifier()->getType()->getAs<RecordType>() in Diagnose()
7326 << Entity.getName() in Diagnose()
7328 S.Diag(Entity.getDecl()->getLocation(), in Diagnose()
7332 = Entity.getType()->getAs<RecordType>()) in Diagnose()
7378 if (Entity.getKind() == InitializedEntity::EK_Member && in Diagnose()
7389 << Entity.getName(); in Diagnose()
7390 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl) in Diagnose()
7391 << Entity.getName(); in Diagnose()
7406 diagnoseListInit(S, Entity, InitList); in Diagnose()
7429 PrintInitLocationNote(S, Entity); in Diagnose()
7821 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity, in CanPerformCopyInitialization() argument
7831 InitializationSequence Seq(*this, Entity, Kind, InitE); in CanPerformCopyInitialization()
7836 Sema::PerformCopyInitialization(const InitializedEntity &Entity, in PerformCopyInitialization() argument
7853 InitializationSequence Seq(*this, Entity, Kind, InitE, TopLevelOfInitList); in PerformCopyInitialization()
7855 ExprResult Result = Seq.Perform(*this, Entity, Kind, InitE); in PerformCopyInitialization()