@@ -3331,17 +3331,18 @@ class GenericTypeParamDecl final
33313331 // /
33323332 // / \param name The name of the generic parameter.
33333333 // / \param nameLoc The location of the name.
3334- // / \param ellipsisLoc The location of the ellipsis for a type parameter pack.
3334+ // / \param eachLoc The location of the 'each' keyword for a type parameter
3335+ // / pack.
33353336 // / \param depth The generic signature depth.
33363337 // / \param index The index of the parameter in the generic signature.
33373338 // / \param isParameterPack Whether the generic parameter is for a type
3338- // / parameter pack, denoted by \c <T... >.
3339+ // / parameter pack, denoted by \c <each T >.
33393340 // / \param isOpaqueType Whether the generic parameter is written as an opaque
33403341 // / parameter e.g 'some Collection'.
33413342 // / \param opaqueTypeRepr The TypeRepr of an opaque generic parameter.
33423343 // /
33433344 GenericTypeParamDecl (DeclContext *dc, Identifier name, SourceLoc nameLoc,
3344- SourceLoc ellipsisLoc , unsigned depth, unsigned index,
3345+ SourceLoc eachLoc , unsigned depth, unsigned index,
33453346 bool isParameterPack, bool isOpaqueType,
33463347 TypeRepr *opaqueTypeRepr);
33473348
@@ -3353,17 +3354,18 @@ class GenericTypeParamDecl final
33533354 // /
33543355 // / \param name The name of the generic parameter.
33553356 // / \param nameLoc The location of the name.
3356- // / \param ellipsisLoc The location of the ellipsis for a type parameter pack.
3357+ // / \param eachLoc The location of the 'each' keyword for a type parameter
3358+ // / pack.
33573359 // / \param depth The generic signature depth.
33583360 // / \param index The index of the parameter in the generic signature.
33593361 // / \param isParameterPack Whether the generic parameter is for a type
3360- // / parameter pack, denoted by \c <T... >.
3362+ // / parameter pack, denoted by \c <each T >.
33613363 // / \param isOpaqueType Whether the generic parameter is written as an opaque
33623364 // / parameter e.g 'some Collection'.
33633365 // / \param opaqueTypeRepr The TypeRepr of an opaque generic parameter.
33643366 // /
33653367 static GenericTypeParamDecl *create (DeclContext *dc, Identifier name,
3366- SourceLoc nameLoc, SourceLoc ellipsisLoc ,
3368+ SourceLoc nameLoc, SourceLoc eachLoc ,
33673369 unsigned depth, unsigned index,
33683370 bool isParameterPack, bool isOpaqueType,
33693371 TypeRepr *opaqueTypeRepr);
@@ -3374,9 +3376,9 @@ class GenericTypeParamDecl final
33743376 // / Construct a new generic type parameter. This should only be used by the
33753377 // / ClangImporter, use \c GenericTypeParamDecl::create[...] instead.
33763378 GenericTypeParamDecl (DeclContext *dc, Identifier name, SourceLoc nameLoc,
3377- SourceLoc ellipsisLoc , unsigned depth, unsigned index,
3379+ SourceLoc eachLoc , unsigned depth, unsigned index,
33783380 bool isParameterPack)
3379- : GenericTypeParamDecl(dc, name, nameLoc, ellipsisLoc , depth, index,
3381+ : GenericTypeParamDecl(dc, name, nameLoc, eachLoc , depth, index,
33803382 isParameterPack, /* isOpaqueType*/ false , nullptr ) {
33813383 }
33823384
@@ -3390,7 +3392,7 @@ class GenericTypeParamDecl final
33903392 // / \param depth The generic signature depth.
33913393 // / \param index The index of the parameter in the generic signature.
33923394 // / \param isParameterPack Whether the generic parameter is for a type
3393- // / parameter pack, denoted by \c <T... >.
3395+ // / parameter pack, denoted by \c <each T >.
33943396 // / \param isOpaqueType Whether the generic parameter is written as an opaque
33953397 // / parameter e.g 'some Collection'.
33963398 // /
@@ -3406,14 +3408,16 @@ class GenericTypeParamDecl final
34063408 // /
34073409 // / \param name The name of the generic parameter.
34083410 // / \param nameLoc The location of the name.
3409- // / \param ellipsisLoc The location of the ellipsis for a type parameter pack.
3411+ // / \param eachLoc The location of the 'each' keyword for a type parameter
3412+ // / pack.
34103413 // / \param index The index of the parameter in the generic signature.
34113414 // / \param isParameterPack Whether the generic parameter is for a type
3412- // / parameter pack, denoted by \c <T... >.
3415+ // / parameter pack, denoted by \c <each T >.
34133416 // /
3414- static GenericTypeParamDecl *
3415- createParsed (DeclContext *dc, Identifier name, SourceLoc nameLoc,
3416- SourceLoc ellipsisLoc, unsigned index, bool isParameterPack);
3417+ static GenericTypeParamDecl *createParsed (DeclContext *dc, Identifier name,
3418+ SourceLoc nameLoc,
3419+ SourceLoc eachLoc, unsigned index,
3420+ bool isParameterPack);
34173421
34183422 // / Construct a new implicit generic type parameter.
34193423 // /
@@ -3425,19 +3429,19 @@ class GenericTypeParamDecl final
34253429 // / \param depth The generic signature depth.
34263430 // / \param index The index of the parameter in the generic signature.
34273431 // / \param isParameterPack Whether the generic parameter is for a type
3428- // / parameter pack, denoted by \c <T... >.
3432+ // / parameter pack, denoted by \c <each T >.
34293433 // / \param isOpaqueType Whether the generic parameter is written as an opaque
34303434 // / parameter e.g 'some Collection'.
34313435 // / \param opaqueTypeRepr The TypeRepr of an opaque generic parameter.
34323436 // / \param nameLoc The location of the name.
3433- // / \param ellipsisLoc The location of the ellipsis for a type parameter pack.
3437+ // / \param eachLoc The location of the 'each' keyword for a type parameter
3438+ // / pack.
34343439 // /
34353440 static GenericTypeParamDecl *
34363441 createImplicit (DeclContext *dc, Identifier name, unsigned depth,
34373442 unsigned index, bool isParameterPack = false ,
34383443 bool isOpaqueType = false , TypeRepr *opaqueTypeRepr = nullptr ,
3439- SourceLoc nameLoc = SourceLoc(),
3440- SourceLoc ellipsisLoc = SourceLoc());
3444+ SourceLoc nameLoc = {}, SourceLoc eachLoc = {});
34413445
34423446 // / The depth of this generic type parameter, i.e., the number of outer
34433447 // / levels of generic parameter lists that enclose this type parameter.
@@ -3463,8 +3467,8 @@ class GenericTypeParamDecl final
34633467 // / parameter pack.
34643468 // /
34653469 // / \code
3466- // / func foo<T... >(_ : T... ) { }
3467- // / struct Foo<T... > { }
3470+ // / func foo<each T >(_ : for each T ) { }
3471+ // / struct Foo<each T > { }
34683472 // / \endcode
34693473 bool isParameterPack () const { return Bits.GenericTypeParamDecl .ParameterPack ; }
34703474
@@ -3504,8 +3508,8 @@ class GenericTypeParamDecl final
35043508 // / Here 'T' and 'U' have indexes 0 and 1, respectively. 'V' has index 0.
35053509 unsigned getIndex () const { return Bits.GenericTypeParamDecl .Index ; }
35063510
3507- // / Retrieve the ellipsis location for a type parameter pack \c T...
3508- SourceLoc getEllipsisLoc () const {
3511+ // / Retrieve the 'each' keyword location for a type parameter pack \c each T
3512+ SourceLoc getEachLoc () const {
35093513 if (!isParameterPack ())
35103514 return SourceLoc ();
35113515
0 commit comments