Home | History | Annotate | Download | only in Parse

Lines Matching refs:DS

51   DeclSpec DS(AttrFactory);
53 DS.addAttributes(Attrs->getList());
54 ParseSpecifierQualifierList(DS, AS, DSC);
56 *OwnedType = DS.isTypeSpecOwned() ? DS.getRepAsDecl() : nullptr;
59 Declarator DeclaratorInfo(DS, Context);
1357 ParsingDeclSpec DS(*this);
1360 ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS_none, DSContext);
1364 if (DS.hasTagDefinition() &&
1365 DiagnoseMissingSemiAfterTagDefinition(DS, AS_none, DSContext))
1375 DS);
1376 DS.complete(TheDecl);
1380 DS.takeAttributesFrom(Attrs);
1381 return ParseDeclGroup(DS, Context, /*FunctionDefs=*/ false, &DeclEnd, FRI);
1534 Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
1540 ParsingDeclarator D(*this, DS, static_cast<Declarator::TheContext>(Context));
1565 if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
1569 DS.ClearStorageClassSpecs();
1621 return Actions.FinalizeDeclaratorGroup(getCurScope(), DS, ThisDecl);
1687 return Actions.FinalizeDeclaratorGroup(getCurScope(), DS, DeclsInGroup);
1940 void Parser::ParseSpecifierQualifierList(DeclSpec &DS, AccessSpecifier AS,
1945 ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS, DSC);
1948 unsigned Specs = DS.getParsedSpecifiers();
1949 if (isTypeSpecifier(DSC) && !DS.hasTypeSpecifier()) {
1951 DS.SetTypeSpecError();
1952 } else if (Specs == DeclSpec::PQ_None && !DS.getNumProtocolQualifiers() &&
1953 !DS.hasAttributes()) {
1955 if (!DS.hasTypeSpecifier())
1956 DS.SetTypeSpecError();
1961 if (DS.getStorageClassSpecLoc().isValid())
1962 Diag(DS.getStorageClassSpecLoc(),diag::err_typename_invalid_storageclass);
1964 Diag(DS.getThreadStorageClassSpecLoc(),
1966 DS.ClearStorageClassSpecs();
1971 if (DS.isInlineSpecified())
1972 Diag(DS.getInlineSpecLoc(), diag::err_typename_invalid_functionspec);
1973 if (DS.isVirtualSpecified())
1974 Diag(DS.getVirtualSpecLoc(), diag::err_typename_invalid_functionspec);
1975 if (DS.isExplicitSpecified())
1976 Diag(DS.getExplicitSpecLoc(), diag::err_typename_invalid_functionspec);
1977 DS.ClearFunctionSpecs();
1981 if (DS.isConstexprSpecified()) {
1982 Diag(DS.getConstexprSpecLoc(), diag::err_typename_invalid_constexpr);
1983 DS.ClearConstexprSpec();
2021 bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
2040 assert(!DS.hasTypeSpecifier() && "Type specifier checked above");
2056 DS.getStorageClassSpec() == DeclSpec::SCS_auto) {
2107 ParseEnumSpecifier(Loc, DS, TemplateInfo, AS, DSC_normal);
2109 ParseClassSpecifier(TagKind, Loc, DS, TemplateInfo, AS,
2186 DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec, DiagID, T,
2188 DS.SetRangeEnd(Tok.getLocation());
2200 DS.SetTypeSpecError();
2201 DS.SetRangeEnd(Tok.getLocation());
2303 Parser::DiagnoseMissingSemiAfterTagDefinition(DeclSpec &DS, AccessSpecifier AS,
2306 assert(DS.hasTagDefinition() && "shouldn't call this");
2386 Diag(PP.getLocForEndOfToken(DS.getRepAsDecl()->getLocEnd()),
2388 << DeclSpec::getSpecifierName(DS.getTypeSpecType(), PPol) << tok::semi;
2397 DS.ClearTypeSpecType();
2399 ParseDeclarationSpecifiers(DS, NotATemplate, AS, DSContext, LateAttrs);
2431 void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
2436 if (DS.getSourceRange().isInvalid()) {
2437 DS.SetRangeStart(Tok.getLocation());
2438 DS.SetRangeEnd(Tok.getLocation());
2463 DS.takeAttributesFrom(attrs);
2468 DS.Finish(Diags, PP, Policy);
2489 if (DS.hasTypeSpecifier()) {
2498 (DSContext == DSC_class && DS.isFriendSpecified());
2500 Actions.CodeCompleteDeclSpec(getCurScope(), DS,
2523 if (!DS.hasTypeSpecifier())
2524 DS.SetTypeSpecError();
2532 if (DS.hasTypeSpecifier() || DS.isTypeAltiVecVector())
2587 DS.getTypeSpecScope() = SS;
2596 DS.getTypeSpecScope() = SS;
2600 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename,
2607 DS.SetTypeSpecError();
2608 DS.SetRangeEnd(Tok.getAnnotationEndLoc());
2647 if (ParseImplicitInt(DS, &SS, TemplateInfo, AS, DSContext, Attrs)) {
2657 DS.getTypeSpecScope() = SS;
2660 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec,
2665 DS.SetRangeEnd(Tok.getLocation());
2674 if (DS.hasTypeSpecifier() && DS.hasTagDefinition())
2679 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec,
2682 DS.SetTypeSpecError();
2687 DS.SetRangeEnd(Tok.getAnnotationEndLoc());
2694 ParseObjCProtocolQualifiers(DS);
2707 if (DS.getTypeSpecType() == TST_bool &&
2708 DS.getTypeQualifiers() == DeclSpec::TQ_const &&
2709 DS.getStorageClassSpec() == DeclSpec::SCS_static)
2722 if (!DS.hasTypeSpecifier())
2723 DS.SetTypeSpecError();
2733 if (DS.hasTypeSpecifier())
2737 if (TryAltiVecToken(DS, Loc, PrevSpec, DiagID, isInvalid))
2742 if (DS.isTypeAltiVecVector())
2763 if (ParseImplicitInt(DS, nullptr, TemplateInfo, AS, DSContext, Attrs)) {
2780 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typename, Loc, PrevSpec,
2785 DS.SetRangeEnd(Tok.getLocation());
2792 ParseObjCProtocolQualifiers(DS);
2824 ParseGNUAttributes(DS.getAttributes(), nullptr, LateAttrs);
2829 ParseMicrosoftDeclSpec(DS.getAttributes());
2834 isInvalid = DS.setFunctionSpecForceInline(Loc, PrevSpec, DiagID);
2837 DS.getAttributes().addNew(AttrName, AttrNameLoc, nullptr, AttrNameLoc,
2852 ParseMicrosoftTypeAttributes(DS.getAttributes());
2857 ParseBorlandTypeAttributes(DS.getAttributes());
2862 ParseOpenCLAttributes(DS.getAttributes());
2867 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_typedef, Loc,
2871 if (DS.getThreadStorageClassSpec() == DeclSpec::TSCS___thread)
2873 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_extern, Loc,
2877 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_private_extern,
2881 if (DS.getThreadStorageClassSpec() == DeclSpec::TSCS___thread)
2883 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_static, Loc,
2889 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto, Loc,
2893 << FixItHint::CreateRemoval(DS.getStorageClassSpecLoc());
2895 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec,
2898 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto, Loc,
2902 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_register, Loc,
2906 isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_mutable, Loc,
2910 isInvalid = DS.SetStorageClassSpecThread(DeclSpec::TSCS___thread, Loc,
2914 isInvalid = DS.SetStorageClassSpecThread(DeclSpec::TSCS_thread_local, Loc,
2918 isInvalid = DS.SetStorageClassSpecThread(DeclSpec::TSCS__Thread_local,
2924 isInvalid = DS.setFunctionSpecInline(Loc, PrevSpec, DiagID);
2927 isInvalid = DS.setFunctionSpecVirtual(Loc, PrevSpec, DiagID);
2930 isInvalid = DS.setFunctionSpecExplicit(Loc, PrevSpec, DiagID);
2935 isInvalid = DS.setFunctionSpecNoreturn(Loc, PrevSpec, DiagID);
2942 ParseAlignmentSpecifier(DS.getAttributes());
2948 isInvalid = DS.SetFriendSpec(Loc, PrevSpec, DiagID);
2958 isInvalid = DS.setModulePrivateSpec(Loc, PrevSpec, DiagID);
2963 isInvalid = DS.SetConstexprSpec(Loc, PrevSpec, DiagID);
2968 isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_short, Loc, PrevSpec,
2972 if (DS.getTypeSpecWidth() != DeclSpec::TSW_long)
2973 isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_long, Loc, PrevSpec,
2976 isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec,
2980 isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec,
2984 isInvalid = DS.SetTypeSpecSign(DeclSpec::TSS_signed, Loc, PrevSpec,
2988 isInvalid = DS.SetTypeSpecSign(DeclSpec::TSS_unsigned, Loc, PrevSpec,
2992 isInvalid = DS.SetTypeSpecComplex(DeclSpec::TSC_complex, Loc, PrevSpec,
2996 isInvalid = DS.SetTypeSpecComplex(DeclSpec::TSC_imaginary, Loc, PrevSpec,
3000 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_void, Loc, PrevSpec,
3004 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_char, Loc, PrevSpec,
3008 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_int, Loc, PrevSpec,
3012 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_int128, Loc, PrevSpec,
3016 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_half, Loc, PrevSpec,
3020 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_float, Loc, PrevSpec,
3024 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_double, Loc, PrevSpec,
3028 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_wchar, Loc, PrevSpec,
3032 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_char16, Loc, PrevSpec,
3036 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_char32, Loc, PrevSpec,
3042 DS.getTypeSpecType() != DeclSpec::TST_unspecified &&
3043 DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
3050 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_bool, Loc, PrevSpec,
3055 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_decimal32, Loc, PrevSpec,
3059 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_decimal64, Loc, PrevSpec,
3063 isInvalid = DS.SetTypeSpecType(DeclSpec::TST_decimal128, Loc, PrevSpec,
3067 isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID, Policy);
3070 isInvalid = DS.SetTypeAltiVecPixel(true, Loc, PrevSpec, DiagID, Policy);
3073 isInvalid = DS.SetTypeSpecType(TST_unknown_anytype, Loc,
3089 ParseClassSpecifier(Kind, Loc, DS, TemplateInfo, AS,
3104 ParseEnumSpecifier(Loc, DS, TemplateInfo, AS, DSContext);
3109 isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
3113 isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
3117 isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
3124 DS.SetTypeSpecError();
3133 ParseTypeofSpecifier(DS);
3137 ParseDecltypeSpecifier(DS);
3141 ParseUnderlyingTypeSpecifier(DS);
3150 ParseAtomicSpecifier(DS);
3153 isInvalid = DS.SetTypeQual(DeclSpec::TQ_atomic, Loc, PrevSpec, DiagID,
3165 ParseOpenCLQualifiers(DS.getAttributes());
3172 if (DS.hasTypeSpecifier() || !getLangOpts().ObjC1)
3175 if (!ParseObjCProtocolQualifiers(DS))
3178 << SourceRange(Loc, DS.getSourceRange().getEnd());
3196 DS.SetRangeEnd(Tok.getLocation());
3222 ParseStructDeclaration(ParsingDeclSpec &DS, FieldCallback &Fields) {
3228 return ParseStructDeclaration(DS, Fields);
3232 ParseSpecifierQualifierList(DS);
3238 DS);
3239 DS.complete(TheDecl);
3247 ParsingFieldDeclarator DeclaratorInfo(*this, DS);
3358 ParsingDeclSpec DS(*this);
3359 ParseStructDeclaration(DS, Callback);
3442 void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
3500 CXXScopeSpec &SS = DS.getTypeSpecScope();
3641 if (DS.isFriendSpecified()) {
3643 << SourceRange(DS.getFriendSpecLoc());
3654 TUK = DS.isFriendSpecified() ? Sema::TUK_Friend : Sema::TUK_Declaration;
3683 DS.SetTypeSpecError();
3710 AS, DS.getModulePrivateSpecLoc(), TParams,
3719 DS.SetTypeSpecError();
3727 DS.SetTypeSpecError();
3731 if (DS.SetTypeSpecType(DeclSpec::TST_typename, StartLoc,
3748 DS.SetTypeSpecError();
3755 if (DS.SetTypeSpecType(DeclSpec::TST_enum, StartLoc,
4370 void Parser::ParseTypeQualifierListOpt(DeclSpec &DS,
4379 DS.takeAttributesFrom(attrs);
4392 Actions.CodeCompleteTypeQualifiers(DS);
4396 isInvalid = DS.SetTypeQual(DeclSpec::TQ_const , Loc, PrevSpec, DiagID,
4400 isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
4404 isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
4410 isInvalid = DS.SetTypeQual(DeclSpec::TQ_atomic, Loc, PrevSpec, DiagID,
4422 ParseOpenCLQualifiers(DS.getAttributes());
4429 IdentifierRequired && DS.isEmpty() && NextToken().is(tok::semi)) {
4443 ParseMicrosoftTypeAttributes(DS.getAttributes());
4449 ParseBorlandTypeAttributes(DS.getAttributes());
4455 ParseGNUAttributes(DS.getAttributes());
4463 DS.Finish(Diags, PP, Actions.getASTContext().getPrintingPolicy());
4465 DS.SetRangeEnd(EndLoc);
4554 DeclSpec DS(AttrFactory);
4555 ParseTypeQualifierListOpt(DS);
4556 D.ExtendWithDeclSpec(DS);
4563 D.AddTypeInfo(DeclaratorChunk::getMemberPointer(SS,DS.getTypeQualifiers(),
4565 DS.getAttributes(),
4586 DeclSpec DS(AttrFactory);
4589 ParseTypeQualifierListOpt(DS, true, true, true, !D.mayOmitIdentifier());
4590 D.ExtendWithDeclSpec(DS);
4596 D.AddTypeInfo(DeclaratorChunk::getPointer(DS.getTypeQualifiers(), Loc,
4597 DS.getConstSpecLoc(),
4598 DS.getVolatileSpecLoc(),
4599 DS.getRestrictSpecLoc()),
4600 DS.getAttributes(),
4604 D.AddTypeInfo(DeclaratorChunk::getBlockPointer(DS.getTypeQualifiers(),
4606 DS.getAttributes(),
4610 DeclSpec DS(AttrFactory);
4620 ParseTypeQualifierListOpt(DS);
4621 D.ExtendWithDeclSpec(DS);
4626 if (DS.getTypeQualifiers() != DeclSpec::TQ_unspecified) {
4627 if (DS.getTypeQualifiers() & DeclSpec::TQ_const)
4628 Diag(DS.getConstSpecLoc(),
4630 if (DS.getTypeQualifiers() & DeclSpec::TQ_volatile)
4631 Diag(DS.getVolatileSpecLoc(),
4634 if (DS.getTypeQualifiers() & DeclSpec::TQ_atomic)
4635 Diag(DS.getAtomicSpecLoc(),
4660 D.AddTypeInfo(DeclaratorChunk::getReference(DS.getTypeQualifiers(), Loc,
4662 DS.getAttributes(),
5076 DeclSpec DS(AttrFactory);
5128 ParseTypeQualifierListOpt(DS, /*VendorAttributesAllowed*/ false,
5131 if (!DS.getSourceRange().getEnd().isInvalid()) {
5132 EndLoc = DS.getSourceRange().getEnd();
5133 ConstQualifierLoc = DS.getConstSpecLoc();
5134 VolatileQualifierLoc = DS.getVolatileSpecLoc();
5165 DS.getTypeQualifiers() |
5203 DS.getTypeQualifiers(),
5344 DeclSpec DS(AttrFactory);
5347 MaybeParseCXX11Attributes(DS.getAttributes());
5350 MaybeParseMicrosoftAttributes(DS.getAttributes());
5359 DS.takeAttributesFrom(FirstArgAttrs);
5361 ParseDeclarationSpecifiers(DS);
5367 Declarator ParmDeclarator(DS,
5385 if (DS.isEmpty() && ParmDeclarator.getIdentifier() == nullptr &&
5524 DeclSpec DS(AttrFactory);
5525 ParseTypeQualifierListOpt(DS, false /*no attributes*/);
5579 D.AddTypeInfo(DeclaratorChunk::getArray(DS.getTypeQualifiers(),
5682 void Parser::ParseTypeofSpecifier(DeclSpec &DS) {
5698 DS.setTypeofParensRange(CastRange);
5702 DS.SetRangeEnd(Tok.getLocation());
5704 DS.SetRangeEnd(CastRange.getEnd());
5708 DS.SetTypeSpecError();
5715 if (DS.SetTypeSpecType(DeclSpec::TST_typeofType, StartLoc, PrevSpec,
5724 DS.SetTypeSpecError();
5731 DS.SetTypeSpecError();
5738 if (DS.SetTypeSpecType(DeclSpec::TST_typeofExpr, StartLoc, PrevSpec,
5747 void Parser::ParseAtomicSpecifier(DeclSpec &DS) {
5768 DS.setTypeofParensRange(T.getRange());
5769 DS.SetRangeEnd(T.getCloseLocation());
5773 if (DS.SetTypeSpecType(DeclSpec::TST_atomic, StartLoc, PrevSpec,
5812 bool Parser::TryAltiVecTokenOutOfLine(DeclSpec &DS, SourceLocation Loc,
5830 isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID, Policy);
5834 isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID,Policy);
5838 isInvalid = DS.SetTypeAltiVecVector(true, Loc, PrevSpec, DiagID,Policy);
5846 DS.isTypeAltiVecVector()) {
5847 isInvalid = DS.SetTypeAltiVecPixel(true, Loc, PrevSpec, DiagID, Policy);
5850 DS.isTypeAltiVecVector()) {
5851 isInvalid = DS.SetTypeAltiVecBool(true, Loc, PrevSpec, DiagID, Policy);