@@ -184,7 +184,7 @@ getBuiltinFunction(Identifier Id, ArrayRef<Type> argTypes, Type ResType,
184
184
// / Build a builtin function declaration.
185
185
static FuncDecl *
186
186
getBuiltinGenericFunction (Identifier Id,
187
- ArrayRef<TupleTypeElt > ArgParamTypes,
187
+ ArrayRef<AnyFunctionType::Param > ArgParamTypes,
188
188
Type ResType,
189
189
GenericParamList *GenericParams,
190
190
GenericEnvironment *Env) {
@@ -196,7 +196,7 @@ getBuiltinGenericFunction(Identifier Id,
196
196
197
197
SmallVector<ParamDecl*, 4 > params;
198
198
for (unsigned i = 0 , e = ArgParamTypes.size (); i < e; i++) {
199
- auto paramIfaceType = ArgParamTypes[i].getRawType ();
199
+ auto paramIfaceType = ArgParamTypes[i].getPlainType ();
200
200
auto specifier = (ArgParamTypes[i].getParameterFlags ().isInOut ())
201
201
? VarDecl::Specifier::InOut
202
202
: VarDecl::Specifier::Default;
@@ -211,7 +211,7 @@ getBuiltinGenericFunction(Identifier Id,
211
211
}
212
212
213
213
auto *paramList = ParameterList::create (Context, params);
214
-
214
+
215
215
DeclName Name (Context, Id, paramList);
216
216
auto func = FuncDecl::create (Context, /* StaticLoc=*/ SourceLoc (),
217
217
StaticSpellingKind::None,
@@ -222,7 +222,7 @@ getBuiltinGenericFunction(Identifier Id,
222
222
/* SelfDecl=*/ nullptr ,
223
223
paramList,
224
224
TypeLoc::withoutLoc (ResType), DC);
225
-
225
+
226
226
func->setGenericEnvironment (Env);
227
227
func->computeType ();
228
228
func->setValidationToChecked ();
@@ -456,7 +456,7 @@ namespace {
456
456
GenericParamList *TheGenericParamList;
457
457
SmallVector<GenericTypeParamDecl*, 2 > GenericTypeParams;
458
458
GenericEnvironment *GenericEnv = nullptr ;
459
- SmallVector<TupleTypeElt , 4 > InterfaceParams;
459
+ SmallVector<AnyFunctionType::Param , 4 > InterfaceParams;
460
460
Type InterfaceResult;
461
461
462
462
public:
@@ -478,16 +478,15 @@ namespace {
478
478
template <class G >
479
479
void addParameter (const G &generator) {
480
480
Type gTyIface = generator.build (*this );
481
- InterfaceParams. push_back ({ gTyIface ,
482
- Identifier (), ParameterTypeFlags ()} );
481
+ auto flags = ParameterTypeFlags ();
482
+ InterfaceParams. emplace_back ( gTyIface , Identifier (), flags );
483
483
}
484
484
485
485
template <class G >
486
486
void addInOutParameter (const G &generator) {
487
487
Type gTyIface = generator.build (*this );
488
- auto iFaceflags = ParameterTypeFlags ().withInOut (true );
489
- InterfaceParams.push_back (TupleTypeElt (gTyIface ,
490
- Identifier (), iFaceflags));
488
+ auto flags = ParameterTypeFlags ().withInOut (true );
489
+ InterfaceParams.emplace_back (gTyIface , Identifier (), flags);
491
490
}
492
491
493
492
template <class G >
@@ -523,17 +522,6 @@ namespace {
523
522
return TheFunction (builder);
524
523
}
525
524
};
526
- template <class T , class U >
527
- struct FunctionGenerator {
528
- T Arg;
529
- U Result;
530
- FunctionType::ExtInfo ExtInfo;
531
- Type build (BuiltinGenericSignatureBuilder &builder) const {
532
- return FunctionType::get (Arg.build (builder),
533
- Result.build (builder),
534
- ExtInfo);
535
- }
536
- };
537
525
template <class T >
538
526
struct MetatypeGenerator {
539
527
T Object;
@@ -568,13 +556,6 @@ makeTuple(const Gs & ...elementGenerators) {
568
556
};
569
557
}
570
558
571
- template <class T , class U >
572
- static BuiltinGenericSignatureBuilder::FunctionGenerator<T,U>
573
- makeFunction (const T &arg, const U &result,
574
- FunctionType::ExtInfo extInfo = FunctionType::ExtInfo()) {
575
- return { arg, result, extInfo };
576
- }
577
-
578
559
template <class T >
579
560
static BuiltinGenericSignatureBuilder::MetatypeGenerator<T>
580
561
makeMetatype (const T &object, Optional<MetatypeRepresentation> repr = None) {
0 commit comments