Home | History | Annotate | Download | only in Sema

Lines Matching full:entity

146 /// handle the initialization of a certain kind of entity, e.g.,
179 void CheckImplicitInitList(const InitializedEntity &Entity,
183 void CheckExplicitInitList(const InitializedEntity &Entity,
188 void CheckListElementTypes(const InitializedEntity &Entity,
195 void CheckSubElementType(const InitializedEntity &Entity,
200 void CheckComplexType(const InitializedEntity &Entity,
205 void CheckScalarType(const InitializedEntity &Entity,
210 void CheckReferenceType(const InitializedEntity &Entity,
215 void CheckVectorType(const InitializedEntity &Entity,
219 void CheckStructUnionTypes(const InitializedEntity &Entity,
226 void CheckArrayType(const InitializedEntity &Entity,
232 bool CheckDesignatedInitializer(const InitializedEntity &Entity,
257 void FillInValueInitializations(const InitializedEntity &Entity,
259 bool CheckFlexibleArrayInit(const InitializedEntity &Entity,
262 void CheckValueInitializable(const InitializedEntity &Entity);
265 InitListChecker(Sema &S, const InitializedEntity &Entity,
276 void InitListChecker::CheckValueInitializable(const InitializedEntity &Entity) {
283 InitializationSequence InitSeq(SemaRef, Entity, Kind, 0, 0);
352 InitListChecker::FillInValueInitializations(const InitializedEntity &Entity,
365 Entity, ILE, RequiresSecondPass);
378 FillInValueInitForField(Init, *Field, Entity, ILE, RequiresSecondPass);
395 InitializedEntity ElementEntity = Entity;
403 0, Entity);
408 0, Entity);
472 InitListChecker::InitListChecker(Sema &S, const InitializedEntity &Entity,
482 CheckExplicitInitList(Entity, IL, T, newIndex,
488 FillInValueInitializations(Entity, FullyStructuredList, RequiresSecondPass);
490 FillInValueInitializations(Entity, FullyStructuredList,
520 void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity,
555 CheckListElementTypes(Entity, ParentIList, T,
593 void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity,
604 CheckListElementTypes(Entity, IList, T, /*SubobjectIsDesignatorContext=*/true,
671 void InitListChecker::CheckListElementTypes(const InitializedEntity &Entity,
682 CheckComplexType(Entity, IList, DeclType, Index,
685 CheckScalarType(Entity, IList, DeclType, Index,
688 CheckVectorType(Entity, IList, DeclType, Index,
693 CheckStructUnionTypes(Entity, IList, DeclType, RD->field_begin(),
701 CheckArrayType(Entity, IList, DeclType, Zero,
727 CheckReferenceType(Entity, IList, DeclType, Index,
742 void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
756 CheckExplicitInitList(Entity, SubInitList, ElemType, newIndex,
762 return CheckScalarType(Entity, IList, ElemType, Index,
765 return CheckReferenceType(Entity, IList, ElemType, Index,
795 InitializationSequence Seq(SemaRef, Entity, Kind, &expr, 1);
800 Seq.Perform(SemaRef, Entity, Kind, MultiExprArg(&expr, 1));
850 CheckImplicitInitList(Entity, IList, ElemType, Index, StructuredList,
857 SemaRef.PerformCopyInitialization(Entity, SourceLocation(),
867 void InitListChecker::CheckComplexType(const InitializedEntity &Entity,
882 return CheckScalarType(Entity, IList, DeclType, Index, StructuredList,
894 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
904 void InitListChecker::CheckScalarType(const InitializedEntity &Entity,
929 CheckScalarType(Entity, SubIList, DeclType, Index, StructuredList,
944 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(expr)))
951 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
974 void InitListChecker::CheckReferenceType(const InitializedEntity &Entity,
1007 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(expr)))
1014 SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
1031 void InitListChecker::CheckVectorType(const InitializedEntity &Entity,
1045 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity));
1055 if (!SemaRef.CanPerformCopyInitialization(Entity, SemaRef.Owned(Init)))
1062 SemaRef.PerformCopyInitialization(Entity, Init->getLocStart(),
1087 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1105 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1146 void InitListChecker::CheckArrayType(const InitializedEntity &Entity,
1210 if (CheckDesignatedInitializer(Entity, IList, DIE, 0,
1239 Entity);
1270 SemaRef.Context, 0, Entity));
1274 bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity,
1291 } else if (Entity.getKind() != InitializedEntity::EK_Variable) {
1294 } else if (cast<VarDecl>(Entity.getDecl())->hasLocalStorage()) {
1313 void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity,
1339 InitializedEntity::InitializeMember(*Field, &Entity));
1368 if (CheckDesignatedInitializer(Entity, IList, DIE, 0,
1416 InitializedEntity::InitializeMember(*Field, &Entity);
1452 InitializedEntity::InitializeMember(*Field, &Entity));
1460 if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field,
1468 InitializedEntity::InitializeMember(*Field, &Entity);
1593 InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
1615 CheckSubElementType(Entity, IList, CurrentObjectType, Index,
1831 if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field,
1847 InitializedEntity::InitializeMember(*Field, &Entity);
1866 InitializedEntity::InitializeMember(*Field, &Entity);
1898 CheckStructUnionTypes(Entity, IList, CurrentObjectType, Field, false, Index,
1997 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
2031 CheckArrayType(Entity, IList, CurrentObjectType, DesignatedStartIndex,
2283 // Initialization entity
2686 const InitializedEntity &Entity) {
2691 if (Entity.getKind() == InitializedEntity::EK_Parameter) {
2692 if (!Entity.isParameterConsumed())
2695 assert(Entity.getType()->isObjCRetainableType() &&
2697 Sequence.AddProduceObjCObjectStep(Entity.getType());
2703 } else if (Entity.getKind() == InitializedEntity::EK_Result) {
2704 if (!Entity.getType()->isObjCRetainableType())
2707 Sequence.AddProduceObjCObjectStep(Entity.getType());
2856 /// enumerates the constructors of the initialized entity and performs overload
2861 const InitializedEntity &Entity,
2871 if (DeclaratorDecl *DD = Entity.getDecl())
2959 Entity.getType().isConstQualified() &&
3012 const InitializedEntity &Entity,
3022 const InitializedEntity &Entity,
3029 const InitializedEntity &Entity,
3040 QualType DestType = Entity.getType();
3069 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1,
3093 const InitializedEntity &Entity,
3097 QualType DestType = Entity.getType();
3107 TryReferenceListInitialization(S, Entity, Kind, InitList, Sequence);
3121 TryConstructorInitialization(S, Entity, Kind, &Arg, 1, DestType,
3131 InitListChecker CheckInitList(S, Entity, InitList,
3147 const InitializedEntity &Entity,
3152 QualType DestType = Entity.getType();
3333 const InitializedEntity &Entity,
3338 const InitializedEntity &Entity,
3342 QualType DestType = Entity.getType();
3358 TryReferenceInitializationCore(S, Entity, Kind, Initializer, cv1T1, T1,
3364 const InitializedEntity &Entity,
3372 QualType DestType = Entity.getType();
3435 ConvOvlResult = TryRefInitWithConversionFunction(S, Entity, Kind,
3494 CheckCXX98CompatAccessibleCopy(S, Entity, Initializer);
3517 ConvOvlResult = TryRefInitWithConversionFunction(S, Entity,
3597 const InitializedEntity &Entity,
3601 Sequence.AddStringInitStep(Entity.getType());
3606 const InitializedEntity &Entity,
3612 QualType T = Entity.getType();
3627 // but Entity doesn't have a way to capture that (yet).
3628 return TryConstructorInitialization(S, Entity, Kind, 0, 0,
3637 return TryConstructorInitialization(S, Entity, Kind, 0, 0,
3647 Sequence.AddZeroInitializationStep(Entity.getType());
3648 return TryConstructorInitialization(S, Entity, Kind, 0, 0, T, Sequence);
3653 Sequence.AddZeroInitializationStep(Entity.getType());
3658 const InitializedEntity &Entity,
3666 QualType DestType = S.Context.getBaseElementType(Entity.getType());
3672 TryConstructorInitialization(S, Entity, Kind, 0, 0, DestType, Sequence);
3688 Sequence.AddZeroInitializationStep(Entity.getType());
3697 const InitializedEntity &Entity,
3701 QualType DestType = Entity.getType();
3946 const InitializedEntity &Entity,
3959 if (!S.isObjCWritebackConversion(ArgType, Entity.getType(),
3966 if (ParmVarDecl *param = cast_or_null<ParmVarDecl>(Entity.getDecl()))
3987 Sequence.AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy);
3992 const InitializedEntity &Entity,
4005 QualType DestType = Entity.getType();
4040 TryListInitialization(S, Entity, Kind, InitList, *this);
4055 TryReferenceInitialization(S, Entity, Kind, Args[0], *this);
4062 TryValueInitialization(S, Entity, Kind, *this);
4068 TryDefaultInitialization(S, Entity, Kind, *this);
4084 TryStringLiteralInitialization(S, Entity, Kind, Initializer, *this);
4107 Entity.getKind() == InitializedEntity::EK_Member &&
4109 TryListInitialization(S, Entity, Kind, cast<InitListExpr>(Initializer),
4123 Entity.getKind() == InitializedEntity::EK_Parameter;
4130 tryObjCWritebackConversion(S, *this, Entity, Initializer)) {
4136 MaybeProduceObjCObject(S, *this, Entity);
4152 TryConstructorInitialization(S, Entity, Kind, Args, NumArgs,
4153 Entity.getType(), *this);
4161 TryUserDefinedConversion(S, Entity, Kind, Initializer, *this);
4174 TryUserDefinedConversion(S, Entity, Kind, Initializer, *this);
4175 MaybeProduceObjCObject(S, *this, Entity);
4186 = S.TryImplicitConversion(Initializer, Entity.getType(),
4200 if (ParmVarDecl *Param = cast_or_null<ParmVarDecl>(Entity.getDecl()))
4214 AddPassByIndirectCopyRestoreStep(Entity.getType(), ShouldCopy);
4224 AddConversionSequenceStep(ICS, Entity.getType());
4226 MaybeProduceObjCObject(S, *this, Entity);
4241 getAssignmentAction(const InitializedEntity &Entity) {
4242 switch(Entity.getKind()) {
4251 if (Entity.getDecl() &&
4252 isa<ObjCMethodDecl>(Entity.getDecl()->getDeclContext()))
4277 /// initializing the given entity.
4278 static bool shouldBindAsTemporary(const InitializedEntity &Entity) {
4279 switch (Entity.getKind()) {
4302 /// \brief Whether the given entity, when initialized with an object
4304 static bool shouldDestroyTemporary(const InitializedEntity &Entity) {
4305 switch (Entity.getKind()) {
4373 static SourceLocation getInitializationLoc(const InitializedEntity &Entity,
4375 switch (Entity.getKind()) {
4377 return Entity.getReturnLoc();
4380 return Entity.getThrowLoc();
4383 return Entity.getDecl()->getLocation();
4386 return Entity.getCaptureLoc();
4412 /// \param Enter The entity being initialized.
4425 const InitializedEntity &Entity,
4452 SourceLocation Loc = getInitializationLoc(Entity, CurInit.get());
4476 << (int)Entity.getKind() << CurInitExpr->getType()
4485 << (int)Entity.getKind() << CurInitExpr->getType()
4492 << (int)Entity.getKind() << CurInitExpr->getType()
4502 Entity,
4549 if (!CurInit.isInvalid() && shouldBindAsTemporary(Entity))
4558 const InitializedEntity &Entity,
4566 SourceLocation Loc = getInitializationLoc(Entity, CurInitExpr);
4581 << OR << (int)Entity.getKind() << CurInitExpr->getType()
4587 Entity, Best->FoundDecl.getAccess(), Diag);
4609 const InitializedEntity &Entity) {
4610 if (Entity.getKind() == InitializedEntity::EK_Parameter && Entity.getDecl()) {
4611 if (Entity.getDecl()->getLocation().isInvalid())
4614 if (Entity.getDecl()->getDeclName())
4615 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_named_here)
4616 << Entity.getDecl()->getDeclName();
4618 S.Diag(Entity.getDecl()->getLocation(), diag::note_parameter_here);
4629 const InitializedEntity &Entity,
4675 if (Entity.getKind() == InitializedEntity::EK_Temporary &&
4686 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo();
4688 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc);
4705 if (Entity.getKind() == InitializedEntity::EK_Base) {
4706 ConstructKind = Entity.getBaseSpecifier()->isVirtual() ?
4709 } else if (Entity.getKind() == InitializedEntity::EK_Delegating) {
4718 // If the entity allows NRVO, mark the construction as elidable
4720 if (Entity.allowsNRVO())
4721 CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(),
4729 CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(),
4741 S.CheckConstructorAccess(Loc, Constructor, Entity,
4745 if (shouldBindAsTemporary(Entity))
4753 const InitializedEntity &Entity,
4759 Diagnose(S, Entity, Kind, (Expr **)Args.release(), NumArgs);
4767 if (ResultType && !Entity.getType()->isDependentType() &&
4769 QualType DeclType = Entity.getType();
4782 // Scavange the location of the brackets from the entity, if we can.
4783 if (DeclaratorDecl *DD = Entity.getDecl()) {
4819 QualType DestType = Entity.getType().getNonReferenceType();
4820 // FIXME: Ugly hack around the fact that Entity.getType() is not
4821 // the same as Entity.getDecl()->getType() in cases involving type merging,
4824 *ResultType = Entity.getDecl() ? Entity.getDecl()->getType() :
4825 Entity.getType();
4933 << Entity.getType().isVolatileQualified()
4943 << Entity.getType().isVolatileQualified()
4945 PrintInitLocationNote(S, Entity);
4964 Entity.getType().getNonReferenceType(),
4966 Entity.getType()->isLValueReferenceType());
4977 CurInit = CopyObject(S, Step->Type, Entity, move(CurInit),
5014 S.CheckConstructorAccess(Kind.getLocation(), Constructor, Entity,
5054 bool MaybeBindToTemp = RequiresCopy || shouldBindAsTemporary(Entity);
5056 if (!MaybeBindToTemp && CreatedObject && shouldDestroyTemporary(Entity)) {
5075 CurInit = CopyObject(S, Entity.getType().getNonReferenceType(), Entity,
5102 getAssignmentAction(Entity), CCK);
5118 // We also need to create a InitializeTemporary entity for this.
5120 bool IsTemporary = Entity.getType()->isReferenceType();
5122 InitListChecker PerformInitList(S, IsTemporary ? TempEntity : Entity,
5147 // to object", we don't get an EK_Temporary entity, but instead an
5148 // EK_Parameter entity with reference type.
5153 Entity.getType().getNonReferenceType());
5154 bool UseTemporary = Entity.getType()->isReferenceType();
5158 Entity,
5182 // to object", we don't get an EK_Temporary entity, but instead an
5183 // EK_Parameter entity with reference type.
5188 Entity.getType().getNonReferenceType());
5189 bool UseTemporary = Entity.getType()->isReferenceType();
5191 : Entity,
5208 TypeSourceInfo *TSInfo = Entity.getTypeSourceInfo();
5235 Entity.getKind() == InitializedEntity::EK_Parameter &&
5247 getAssignmentAction(Entity),
5249 PrintInitLocationNote(S, Entity);
5252 PrintInitLocationNote(S, Entity);
5364 if (Entity.getKind() == InitializedEntity::EK_Member &&
5365 cast<FieldDecl>(Entity.getDecl())->isBitField())
5367 cast<FieldDecl>(Entity.getDecl()),
5377 const InitializedEntity &Entity,
5383 QualType DestType = Entity.getType();
5386 // FIXME: Customize for the initialized entity?
5521 << (int)Entity.getKind()
5581 // FIXME: Using "DestType" for the entity we're printing is probably
5593 (Entity.getKind() == InitializedEntity::EK_Base ||
5594 Entity.getKind() == InitializedEntity::EK_Member) &&
5602 if (Entity.getKind() == InitializedEntity::EK_Base) {
5607 << Entity.getType();
5610 = Entity.getBaseSpecifier()->getType()->getAs<RecordType>()
5619 << Entity.getName();
5620 S.Diag(Entity.getDecl()->getLocation(), diag::note_field_decl);
5623 = Entity.getType()->getAs<RecordType>())
5670 if (Entity.getKind() == InitializedEntity::EK_Member &&
5680 << Entity.getName();
5681 S.Diag(Entity.getDecl()->getLocation(), diag::note_previous_decl)
5682 << Entity.getName();
5697 QualType DestType = Entity.getType();
5698 InitListChecker DiagnoseInitList(S, Entity, InitList,
5716 QualType DestType = Entity.getType();
5757 PrintInitLocationNote(S, Entity);
6039 // operator was used, this may be different from both the type of the entity
6125 Sema::CanPerformCopyInitialization(const InitializedEntity &Entity,
6135 InitializationSequence Seq(*this, Entity, Kind, &InitE, 1);
6140 Sema::PerformCopyInitialization(const InitializedEntity &Entity,
6157 InitializationSequence Seq(*this, Entity, Kind, &InitE, 1);
6160 ExprResult Result = Seq.Perform(*this, Entity, Kind, MultiExprArg(&InitE, 1));
6163 DiagnoseNarrowingInInitList(*this, Seq, Entity.getType(),