• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/llvm-project/clang/lib/Sema/

Lines Matching defs:SemaRef

280   Sema &SemaRef;
290 DummyExpr = new (SemaRef.Context) NoInitExpr(SemaRef.Context.VoidTy);
381 unsigned DiagID = SemaRef.getLangOpts().CPlusPlus
385 if (InOverloadResolution && SemaRef.getLangOpts().CPlusPlus) {
425 SemaRef.Diag(NewInitRange.getBegin(), DiagID)
427 SemaRef.Diag(OldInit->getBeginLoc(), diag::note_previous_initializer)
428 << (OldInit->HasSideEffects(SemaRef.Context) && FullyOverwritten)
489 InitListExpr DummyInitList(SemaRef.Context, Loc, None, Loc);
495 bool EmptyInitList = SemaRef.getLangOpts().CPlusPlus11 &&
508 InitExpr = VerifyOnly ? &DummyInitList : new (SemaRef.Context)
509 InitListExpr(SemaRef.Context, Loc, None, Loc);
510 InitExpr->setType(SemaRef.Context.VoidTy);
518 InitializationSequence InitSeq(SemaRef, Entity, Kind, SubInit);
529 .BestViableFunction(SemaRef, Kind.getLocation(), Best);
537 SemaRef.SourceMgr.isInSystemHeader(CtorDecl->getLocation())) {
541 if (SemaRef.getStdNamespace()->InEnclosingNamespaceSetOf(ND))
552 SemaRef, Entity,
559 SemaRef.Diag(CtorDecl->getLocation(),
562 SemaRef.Diag(Entity.getDecl()->getLocation(),
565 SemaRef.Diag(Loc, diag::note_used_in_initialization_here);
572 InitSeq.Diagnose(SemaRef, Entity, Kind, SubInit);
574 SemaRef.Diag(Entity.getDecl()->getLocation(),
581 SemaRef.Diag(Loc, diag::note_in_omitted_aggregate_initializer)
591 : InitSeq.Perform(SemaRef, Entity, Kind, SubInit);
609 SemaRef.Context, &Base, false, &ParentEntity);
613 ? new (SemaRef.Context) NoInitExpr(Base.getType())
654 Expr *Filler = new (SemaRef.Context) NoInitExpr(Field->getType());
658 ILE->updateInit(SemaRef.Context, Init, Filler);
669 ExprResult DIE = SemaRef.BuildCXXDefaultInitExpr(Loc, Field);
674 SemaRef.checkInitializerLifetime(MemberEntity, DIE.get());
678 ILE->updateInit(SemaRef.Context, Init, DIE.get());
690 SemaRef.Diag(Loc, diag::err_init_reference_member_uninitialized)
693 SemaRef.Diag(Field->getLocation(),
715 ILE->updateInit(SemaRef.Context, Init, MemberInit.getAs<Expr>());
740 assert((ILE->getType() != SemaRef.Context.VoidTy) &&
791 ILE->resizeInits(SemaRef.Context, NumElems);
834 if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) {
842 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
847 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
876 Filler = new (SemaRef.Context) NoInitExpr(ElementType);
912 ILE->updateInit(SemaRef.Context, Init, Filler);
940 : SemaRef(S), VerifyOnly(VerifyOnly),
970 SemaRef.Context.getAsConstantArrayType(DeclType)) {
1042 SemaRef.Diag(ParentIList->getInit(Index)->getBeginLoc(),
1078 !ParentIList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()) &&
1080 SemaRef.Diag(StructuredSubobjectInitList->getBeginLoc(),
1086 SemaRef.getLocForEndOfToken(
1094 SemaRef.Diag(StructuredSubobjectInitList->getBeginLoc(),
1180 ExprTy = ExprTy.getNonLValueExprType(SemaRef.Context);
1191 bool ExtraInitsIsError = SemaRef.getLangOpts().CPlusPlus ||
1192 (SemaRef.getLangOpts().OpenCL && T->isVectorType());
1197 IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) ==
1203 SemaRef.Diag(IList->getInit(Index)->getBeginLoc(), DK)
1214 SemaRef.Diag(IList->getInit(Index)->getBeginLoc(), DK)
1222 warnBracedScalarInit(SemaRef, Entity, IList->getSourceRange());
1232 auto *CD = SemaRef.LookupDefaultConstructor(CXXRD);
1237 SemaRef.Diag(IList->getBeginLoc(),
1278 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()),
1287 SemaRef.Diag(IList->getBeginLoc(), diag::err_illegal_initializer_type)
1295 SemaRef.Diag(IList->getBeginLoc(), diag::err_init_objc_class) << DeclType;
1303 SemaRef.Diag(IList->getBeginLoc(), diag::err_illegal_initializer_type)
1323 IsStringInit(SubInitList->getInit(0), ElemType, SemaRef.Context) ==
1333 assert(SemaRef.Context.hasSameType(expr->getType(), ElemType) &&
1340 if (SemaRef.getLangOpts().CPlusPlus || isa<InitListExpr>(expr)) {
1357 InitializationSequence Seq(SemaRef, TmpEntity, Kind, expr,
1368 ExprResult Result = Seq.Perform(SemaRef, TmpEntity, Kind, expr);
1390 SemaRef.Context.getAsArrayType(ElemType)) {
1395 if (IsStringInit(expr, arrayType, SemaRef.Context) == SIF_None) {
1398 CheckStringInit(expr, ElemType, arrayType, SemaRef);
1420 if (SemaRef.CheckSingleAssignmentConstraints(
1425 ExprRes = SemaRef.DefaultFunctionArrayLvalueConversion(ExprRes.get());
1445 if ((!SemaRef.getLangOpts().OpenCL && ElemType->isVectorType()) ||
1456 SemaRef.PerformCopyInitialization(Entity, SourceLocation(), expr,
1488 if (!SemaRef.getLangOpts().CPlusPlus && !VerifyOnly)
1489 SemaRef.Diag(IList->getBeginLoc(), diag::ext_complex_component_init)
1495 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1511 SemaRef.Diag(IList->getBeginLoc(),
1512 SemaRef.getLangOpts().CPlusPlus11
1516 hadError = !SemaRef.getLangOpts().CPlusPlus11;
1527 SemaRef.Diag(SubIList->getBeginLoc(),
1536 SemaRef.Diag(expr->getBeginLoc(), diag::err_designator_for_scalar_init)
1546 if (SemaRef.CanPerformCopyInitialization(Entity, expr))
1552 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr,
1587 SemaRef.Diag(IList->getBeginLoc(),
1597 if (isa<InitListExpr>(expr) && !SemaRef.getLangOpts().CPlusPlus11) {
1599 SemaRef.Diag(IList->getBeginLoc(), diag::err_init_non_aggr_init_list)
1609 if (SemaRef.CanPerformCopyInitialization(Entity,expr))
1615 SemaRef.PerformCopyInitialization(Entity, expr->getBeginLoc(), expr,
1647 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
1652 if (!SemaRef.getLangOpts().OpenCL) {
1659 if (SemaRef.CanPerformCopyInitialization(Entity, Init))
1665 SemaRef.PerformCopyInitialization(Entity, Init->getBeginLoc(), Init,
1691 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1708 bool isBigEndian = SemaRef.Context.getTargetInfo().isBigEndian();
1722 SemaRef.Diag(IList->getBeginLoc(),
1726 unsigned typeSize = SemaRef.Context.getTypeSize(elementType);
1737 SemaRef.Diag(IList->getBeginLoc(),
1738 SemaRef.Context.getTypeSize(VT) > 64
1748 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1769 VecType = SemaRef.Context.getExtVectorType(elementType, numIElts);
1771 VecType = SemaRef.Context.getVectorType(elementType, numIElts,
1782 SemaRef.Diag(IList->getBeginLoc(),
1800 Sema &SemaRef) {
1805 CXXDestructorDecl *Destructor = SemaRef.LookupDestructor(CXXRD);
1806 SemaRef.CheckDestructorAccess(Loc, Destructor,
1807 SemaRef.PDiag(diag::err_access_dtor_temp)
1809 SemaRef.MarkFunctionReferenced(Loc, Destructor);
1810 return SemaRef.DiagnoseUseOfDecl(Destructor, Loc);
1820 const ArrayType *arrayType = SemaRef.Context.getAsArrayType(DeclType);
1824 IList->getEndLoc(), SemaRef)) {
1832 if (IsStringInit(IList->getInit(Index), arrayType, SemaRef.Context) ==
1841 CheckStringInit(IList->getInit(Index), DeclType, arrayType, SemaRef);
1845 StructuredList->resizeInits(SemaRef.Context, StructuredIndex);
1856 SemaRef.Diag(VAT->getSizeExpr()->getBeginLoc(),
1916 InitializedEntity::InitializeElement(SemaRef.Context, StructuredIndex,
1935 SemaRef.Diag(IList->getBeginLoc(), diag::ext_typecheck_zero_array_size);
1938 DeclType = SemaRef.Context.getConstantArrayType(
1949 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
1964 } else if (SemaRef.getLangOpts().CPlusPlus) {
1983 SemaRef.Diag(InitExpr->getBeginLoc(), FlexArrayDiag)
1985 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
2014 QualType ET = SemaRef.Context.getBaseElementType(FD->getType());
2015 if (checkDestructorReference(ET, IList->getEndLoc(), SemaRef)) {
2065 SemaRef.Context, &Base, false, &Entity);
2075 if (checkDestructorReference(Base.getType(), InitLoc, SemaRef)) {
2088 !IList->isIdiomaticZeroInitializer(SemaRef.getLangOpts());
2116 QualType ET = SemaRef.Context.getBaseElementType(F->getType());
2117 if (checkDestructorReference(ET, InitLoc, SemaRef)) {
2153 InvalidUse = !SemaRef.CanUseDecl(*Field, TreatUnavailableAsInvalid);
2155 InvalidUse = SemaRef.DiagnoseUseOfDecl(
2165 QualType ET = SemaRef.Context.getBaseElementType(Field->getType());
2166 if (checkDestructorReference(ET, InitLoc, SemaRef)) {
2195 SemaRef.Diag(IList->getSourceRange().getEnd(),
2221 QualType ET = SemaRef.Context.getBaseElementType(I->getType());
2222 if (checkDestructorReference(ET, IList->getEndLoc(), SemaRef)) {
2255 static void ExpandAnonymousFieldDesignator(Sema &SemaRef,
2279 DIE->ExpandDesignator(SemaRef.Context, DesigIdx, &Replacements[0],
2283 static DesignatedInitExpr *CloneDesignatedInitExpr(Sema &SemaRef,
2289 return DesignatedInitExpr::Create(SemaRef.Context, DIE->designators(),
2380 InitializationSequence Seq(SemaRef, Entity, Kind, Init,
2385 : Seq.Perform(SemaRef, Entity, Kind, Init);
2454 DesignatedInitUpdateExpr *DIUE = new (SemaRef.Context)
2455 DesignatedInitUpdateExpr(SemaRef.Context, D->getBeginLoc(),
2457 StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE);
2488 SemaRef.Diag(Loc, diag::err_field_designator_non_aggr)
2489 << SemaRef.getLangOpts().CPlusPlus << CurrentObjectType;
2506 DIE = CloneDesignatedInitExpr(SemaRef, DIE);
2507 ExpandAnonymousFieldDesignator(SemaRef, DIE, DesigIdx, IFD);
2521 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_nonfield)
2523 SemaRef.Diag(Lookup.front()->getLocation(),
2532 if (TypoCorrection Corrected = SemaRef.CorrectTypo(
2536 SemaRef.diagnoseTypo(
2538 SemaRef.PDiag(diag::err_field_designator_unknown_suggest)
2544 SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_unknown)
2589 StructuredList->resizeInits(SemaRef.Context, 0);
2600 InvalidUse = !SemaRef.CanUseDecl(*Field, TreatUnavailableAsInvalid);
2602 InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field, D->getFieldLoc());
2623 if (IsFirstDesignator && !VerifyOnly && SemaRef.getLangOpts().CPlusPlus &&
2641 SemaRef.Diag(DIE->getBeginLoc(), diag::ext_designated_init_reordered)
2647 SemaRef.Diag(PrevInit->getBeginLoc(),
2663 StructuredList->resizeInits(SemaRef.Context, FieldIndex + 1);
2674 SemaRef.Diag(NextD->getBeginLoc(),
2677 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
2687 SemaRef.Diag(DIE->getInit()->getBeginLoc(),
2690 SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
2787 const ArrayType *AT = SemaRef.Context.getAsArrayType(CurrentObjectType);
2790 SemaRef.Diag(D->getLBracketLoc(), diag::err_array_designator_non_array)
2800 DesignatedStartIndex = IndexExpr->EvaluateKnownConstInt(SemaRef.Context);
2806 DIE->getArrayRangeStart(*D)->EvaluateKnownConstInt(SemaRef.Context);
2808 DIE->getArrayRangeEnd(*D)->EvaluateKnownConstInt(SemaRef.Context);
2817 DIE->getInit()->HasSideEffects(SemaRef.Context) && !VerifyOnly)
2831 SemaRef.Diag(IndexExpr->getBeginLoc(),
2840 ConstantArrayType::getMaxSizeBits(SemaRef.Context);
2858 ASTContext &Context = SemaRef.Context;
2917 StructuredList->resizeInits(SemaRef.Context,
2928 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
3032 StructuredList->updateInit(SemaRef.Context, StructuredIndex, Result);
3041 = new (SemaRef.Context) InitListExpr(SemaRef.Context,
3047 ResultType = ResultType.getNonLValueExprType(SemaRef.Context);
3054 = SemaRef.Context.getAsArrayType(CurrentObjectType)) {
3068 Result->reserveInits(SemaRef.Context, NumElements);
3082 if (Expr *PrevInit = StructuredList->updateInit(SemaRef.Context,