@@ -1256,44 +1256,10 @@ class Parser {
12561256 return isLifetimeDependenceToken ();
12571257 }
12581258
1259- struct ParsedTypeAttributeList {
1260- ParamDecl::Specifier Specifier = ParamDecl::Specifier::Default;
1261- SourceLoc SpecifierLoc;
1262- SourceLoc IsolatedLoc;
1263- SourceLoc ConstLoc;
1264- SourceLoc SendingLoc;
1265- SmallVector<TypeOrCustomAttr> Attributes;
1266- SmallVector<LifetimeDependenceSpecifier> lifetimeDependenceSpecifiers;
1267-
1268- // / Main entry point for parsing.
1269- // /
1270- // / Inline we just have the fast path of failing to match. We call slowParse
1271- // / that contains the outline of more complex implementation. This is HOT
1272- // / code!
1273- ParserStatus parse (Parser &P) {
1274- auto &Tok = P.Tok ;
1275- if (Tok.is (tok::at_sign) || P.isParameterSpecifier ())
1276- return slowParse (P);
1277- return makeParserSuccess ();
1278- }
1279-
1280- TypeRepr *applyAttributesToType (Parser &P, TypeRepr *Type) const ;
1281-
1282- private:
1283- // / An out of line implementation of the more complicated cases. This
1284- // / ensures on the inlined fast path we handle the case of not matching.
1285- ParserStatus slowParse (Parser &P);
1286- };
1287-
12881259 bool parseConventionAttributeInternal (SourceLoc atLoc, SourceLoc attrLoc,
12891260 ConventionTypeAttr *&result,
12901261 bool justChecking);
12911262
1292- ParserStatus parseTypeAttribute (TypeOrCustomAttr &result, SourceLoc AtLoc,
1293- SourceLoc AtEndLoc,
1294- PatternBindingInitializer *&initContext,
1295- bool justChecking = false );
1296-
12971263 ParserStatus parseLifetimeDependenceSpecifiers (
12981264 SmallVectorImpl<LifetimeDependenceSpecifier> &specifierList);
12991265
@@ -1488,6 +1454,40 @@ class Parser {
14881454 // / Parse a dotted type, e.g. 'Foo<X>.Y.Z', 'P.Type', '[X].Y'.
14891455 ParserResult<TypeRepr> parseTypeDotted (ParserResult<TypeRepr> Base);
14901456
1457+ struct ParsedTypeAttributeList {
1458+ ParamDecl::Specifier Specifier = ParamDecl::Specifier::Default;
1459+ SourceLoc SpecifierLoc;
1460+ SourceLoc IsolatedLoc;
1461+ SourceLoc ConstLoc;
1462+ SourceLoc SendingLoc;
1463+ SmallVector<TypeOrCustomAttr> Attributes;
1464+ SmallVector<LifetimeDependenceSpecifier> lifetimeDependenceSpecifiers;
1465+
1466+ // / Main entry point for parsing.
1467+ // /
1468+ // / Inline we just have the fast path of failing to match. We call slowParse
1469+ // / that contains the outline of more complex implementation. This is HOT
1470+ // / code!
1471+ ParserStatus parse (Parser &P) {
1472+ auto &Tok = P.Tok ;
1473+ if (Tok.is (tok::at_sign) || P.isParameterSpecifier ())
1474+ return slowParse (P);
1475+ return makeParserSuccess ();
1476+ }
1477+
1478+ TypeRepr *applyAttributesToType (Parser &P, TypeRepr *Type) const ;
1479+
1480+ private:
1481+ // / An out of line implementation of the more complicated cases. This
1482+ // / ensures on the inlined fast path we handle the case of not matching.
1483+ ParserStatus slowParse (Parser &P);
1484+ };
1485+
1486+ ParserStatus parseTypeAttribute (TypeOrCustomAttr &result, SourceLoc AtLoc,
1487+ SourceLoc AtEndLoc,
1488+ PatternBindingInitializer *&initContext,
1489+ bool justChecking = false );
1490+
14911491 ParserResult<TypeRepr> parseOldStyleProtocolComposition ();
14921492 ParserResult<TypeRepr> parseAnyType ();
14931493 ParserResult<TypeRepr> parseSILBoxType (GenericParamList *generics,
0 commit comments