@@ -1249,45 +1249,10 @@ class Parser {
12491249 return isLifetimeDependenceToken ();
12501250 }
12511251
1252- struct ParsedTypeAttributeList {
1253- ParamDecl::Specifier Specifier = ParamDecl::Specifier::Default;
1254- SourceLoc SpecifierLoc;
1255- SourceLoc IsolatedLoc;
1256- SourceLoc ConstLoc;
1257- SourceLoc ResultDependsOnLoc;
1258- SourceLoc SendingLoc;
1259- SmallVector<TypeOrCustomAttr> Attributes;
1260- SmallVector<LifetimeDependenceSpecifier> lifetimeDependenceSpecifiers;
1261-
1262- // / Main entry point for parsing.
1263- // /
1264- // / Inline we just have the fast path of failing to match. We call slowParse
1265- // / that contains the outline of more complex implementation. This is HOT
1266- // / code!
1267- ParserStatus parse (Parser &P) {
1268- auto &Tok = P.Tok ;
1269- if (Tok.is (tok::at_sign) || P.isParameterSpecifier ())
1270- return slowParse (P);
1271- return makeParserSuccess ();
1272- }
1273-
1274- TypeRepr *applyAttributesToType (Parser &P, TypeRepr *Type) const ;
1275-
1276- private:
1277- // / An out of line implementation of the more complicated cases. This
1278- // / ensures on the inlined fast path we handle the case of not matching.
1279- ParserStatus slowParse (Parser &P);
1280- };
1281-
12821252 bool parseConventionAttributeInternal (SourceLoc atLoc, SourceLoc attrLoc,
12831253 ConventionTypeAttr *&result,
12841254 bool justChecking);
12851255
1286- ParserStatus parseTypeAttribute (TypeOrCustomAttr &result, SourceLoc AtLoc,
1287- SourceLoc AtEndLoc,
1288- PatternBindingInitializer *&initContext,
1289- bool justChecking = false );
1290-
12911256 ParserStatus parseLifetimeDependenceSpecifiers (
12921257 SmallVectorImpl<LifetimeDependenceSpecifier> &specifierList);
12931258
@@ -1482,6 +1447,41 @@ class Parser {
14821447 // / Parse a dotted type, e.g. 'Foo<X>.Y.Z', 'P.Type', '[X].Y'.
14831448 ParserResult<TypeRepr> parseTypeDotted (ParserResult<TypeRepr> Base);
14841449
1450+ struct ParsedTypeAttributeList {
1451+ ParamDecl::Specifier Specifier = ParamDecl::Specifier::Default;
1452+ SourceLoc SpecifierLoc;
1453+ SourceLoc IsolatedLoc;
1454+ SourceLoc ConstLoc;
1455+ SourceLoc ResultDependsOnLoc;
1456+ SourceLoc SendingLoc;
1457+ SmallVector<TypeOrCustomAttr> Attributes;
1458+ SmallVector<LifetimeDependenceSpecifier> lifetimeDependenceSpecifiers;
1459+
1460+ // / Main entry point for parsing.
1461+ // /
1462+ // / Inline we just have the fast path of failing to match. We call slowParse
1463+ // / that contains the outline of more complex implementation. This is HOT
1464+ // / code!
1465+ ParserStatus parse (Parser &P) {
1466+ auto &Tok = P.Tok ;
1467+ if (Tok.is (tok::at_sign) || P.isParameterSpecifier ())
1468+ return slowParse (P);
1469+ return makeParserSuccess ();
1470+ }
1471+
1472+ TypeRepr *applyAttributesToType (Parser &P, TypeRepr *Type) const ;
1473+
1474+ private:
1475+ // / An out of line implementation of the more complicated cases. This
1476+ // / ensures on the inlined fast path we handle the case of not matching.
1477+ ParserStatus slowParse (Parser &P);
1478+ };
1479+
1480+ ParserStatus parseTypeAttribute (TypeOrCustomAttr &result, SourceLoc AtLoc,
1481+ SourceLoc AtEndLoc,
1482+ PatternBindingInitializer *&initContext,
1483+ bool justChecking = false );
1484+
14851485 ParserResult<TypeRepr> parseOldStyleProtocolComposition ();
14861486 ParserResult<TypeRepr> parseAnyType ();
14871487 ParserResult<TypeRepr> parseSILBoxType (GenericParamList *generics,
0 commit comments