@@ -34,6 +34,7 @@ class ProtocolConformanceRef;
3434class ProtocolType ;
3535class SubstitutionMap ;
3636class GenericEnvironment ;
37+ class GenericTypeParamType ;
3738
3839namespace rewriting {
3940 class RequirementMachine ;
@@ -118,16 +119,13 @@ class GenericSignature {
118119 static GenericSignature get (ArrayRef<GenericTypeParamType *> params,
119120 ArrayRef<Requirement> requirements,
120121 bool isKnownCanonical = false );
121- static GenericSignature get (TypeArrayView<GenericTypeParamType> params,
122- ArrayRef<Requirement> requirements,
123- bool isKnownCanonical = false );
124122
125123 // / Produce a new generic signature which drops all of the marker
126124 // / protocol conformance requirements associated with this one.
127125 GenericSignature withoutMarkerProtocols () const ;
128126
129127public:
130- static ASTContext &getASTContext (TypeArrayView <GenericTypeParamType> params,
128+ static ASTContext &getASTContext (ArrayRef <GenericTypeParamType * > params,
131129 ArrayRef<Requirement> requirements);
132130
133131public:
@@ -164,7 +162,7 @@ class GenericSignature {
164162 void Profile (llvm::FoldingSetNodeID &id) const ;
165163
166164 static void Profile (llvm::FoldingSetNodeID &ID,
167- TypeArrayView <GenericTypeParamType> genericParams,
165+ ArrayRef <GenericTypeParamType * > genericParams,
168166 ArrayRef<Requirement> requirements);
169167public:
170168 using RequiredProtocols = SmallVector<ProtocolDecl *, 2 >;
@@ -191,13 +189,13 @@ class GenericSignature {
191189
192190public:
193191 // / Retrieve the generic parameters.
194- TypeArrayView <GenericTypeParamType> getGenericParams () const ;
192+ ArrayRef <GenericTypeParamType * > getGenericParams () const ;
195193
196194 // / Retrieve the innermost generic parameters.
197195 // /
198196 // / Given a generic signature for a nested generic type, produce an
199197 // / array of the generic parameters for the innermost generic type.
200- TypeArrayView <GenericTypeParamType> getInnermostGenericParams () const ;
198+ ArrayRef <GenericTypeParamType * > getInnermostGenericParams () const ;
201199
202200 // / Retrieve the requirements.
203201 ArrayRef<Requirement> getRequirements () const ;
@@ -240,7 +238,7 @@ class CanGenericSignature : public GenericSignature {
240238 // / Create a new generic signature with the given type parameters and
241239 // / requirements, first canonicalizing the types.
242240 static CanGenericSignature
243- getCanonical (TypeArrayView <GenericTypeParamType> params,
241+ getCanonical (ArrayRef <GenericTypeParamType * > params,
244242 ArrayRef<Requirement> requirements);
245243
246244public:
@@ -267,7 +265,8 @@ class CanGenericSignature : public GenericSignature {
267265// / The underlying implementation of generic signatures.
268266class alignas (1 << TypeAlignInBits) GenericSignatureImpl final
269267 : public llvm::FoldingSetNode,
270- private llvm::TrailingObjects<GenericSignatureImpl, Type, Requirement> {
268+ private llvm::TrailingObjects<GenericSignatureImpl, GenericTypeParamType *,
269+ Requirement> {
271270 friend class ASTContext ;
272271 friend GenericSignature;
273272 friend TrailingObjects;
@@ -286,14 +285,14 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
286285 void *operator new (size_t Bytes) = delete ;
287286 void operator delete (void *Data) = delete ;
288287
289- size_t numTrailingObjects (OverloadToken<Type >) const {
288+ size_t numTrailingObjects (OverloadToken<GenericTypeParamType * >) const {
290289 return NumGenericParams;
291290 }
292291 size_t numTrailingObjects (OverloadToken<Requirement>) const {
293292 return NumRequirements;
294293 }
295294
296- GenericSignatureImpl (TypeArrayView <GenericTypeParamType> params,
295+ GenericSignatureImpl (ArrayRef <GenericTypeParamType * > params,
297296 ArrayRef<Requirement> requirements,
298297 bool isKnownCanonical);
299298
@@ -326,6 +325,9 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
326325 // / concrete.
327326 bool areAllParamsConcrete () const ;
328327
328+ // / Check if the generic signature has a parameter pack.
329+ bool hasParameterPack () const ;
330+
329331 // / Compute the number of conformance requirements in this signature.
330332 unsigned getNumConformanceRequirements () const {
331333 unsigned result = 0 ;
@@ -470,7 +472,7 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
470472 Type getDependentUpperBounds (Type type) const ;
471473
472474 static void Profile (llvm::FoldingSetNodeID &ID,
473- TypeArrayView <GenericTypeParamType> genericParams,
475+ ArrayRef <GenericTypeParamType * > genericParams,
474476 ArrayRef<Requirement> requirements);
475477
476478 void print (raw_ostream &OS, PrintOptions Options = PrintOptions ()) const ;
@@ -483,16 +485,16 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
483485 friend CanGenericSignature;
484486
485487 // / Retrieve the generic parameters.
486- TypeArrayView <GenericTypeParamType> getGenericParams () const {
487- return TypeArrayView <GenericTypeParamType>(
488- {getTrailingObjects<Type >(), NumGenericParams});
488+ ArrayRef <GenericTypeParamType * > getGenericParams () const {
489+ return ArrayRef <GenericTypeParamType * >(
490+ {getTrailingObjects<GenericTypeParamType * >(), NumGenericParams});
489491 }
490492
491493 // / Retrieve the innermost generic parameters.
492494 // /
493495 // / Given a generic signature for a nested generic type, produce an
494496 // / array of the generic parameters for the innermost generic type.
495- TypeArrayView <GenericTypeParamType> getInnermostGenericParams () const ;
497+ ArrayRef <GenericTypeParamType * > getInnermostGenericParams () const ;
496498
497499 // / Retrieve the requirements.
498500 ArrayRef<Requirement> getRequirements () const {
0 commit comments