@@ -220,7 +220,9 @@ namespace {
220
220
// / Helper class for emitting code to dispatch to a specialized function.
221
221
class EagerDispatch {
222
222
SILFunction *GenericFunc;
223
+ #if 0
223
224
const SILSpecializeAttr &SA;
225
+ #endif
224
226
const ReabstractionInfo &ReInfo;
225
227
226
228
SILBuilder Builder;
@@ -231,12 +233,11 @@ class EagerDispatch {
231
233
// original generic function.
232
234
EagerDispatch (SILFunction *GenericFunc, const SILSpecializeAttr &SA,
233
235
const ReabstractionInfo &ReInfo)
234
- : GenericFunc(GenericFunc), SA(SA), ReInfo(ReInfo), Builder(*GenericFunc),
235
- Loc (GenericFunc->getLocation ()) {
236
-
236
+ : GenericFunc(GenericFunc), ReInfo(ReInfo), Builder(*GenericFunc),
237
+ Loc (GenericFunc->getLocation ()) {
237
238
Builder.setCurrentDebugScope (GenericFunc->getDebugScope ());
238
239
}
239
-
240
+
240
241
void emitDispatchTo (SILFunction *NewFunc);
241
242
242
243
protected:
@@ -264,12 +265,12 @@ void EagerDispatch::emitDispatchTo(SILFunction *NewFunc) {
264
265
// Iterate over all dependent types in the generic signature, which will match
265
266
// the specialized attribute's substitution list. Visit only
266
267
// SubstitutableTypes, skipping DependentTypes.
267
- auto GenericSig =
268
- GenericFunc->getLoweredFunctionType ()->getGenericSignature ();
269
-
270
268
// TODO: Uncomment when Generics.cpp is updated to use the
271
269
// new @_specialize attribute for partial specializations.
272
270
#if 0
271
+ auto GenericSig =
272
+ GenericFunc->getLoweredFunctionType()->getGenericSignature();
273
+
273
274
auto SubIt = SA.getSubstitutions().begin();
274
275
auto SubEnd = SA.getSubstitutions().end();
275
276
for (auto DepTy : GenericSig->getAllDependentTypes()) {
@@ -281,6 +282,8 @@ void EagerDispatch::emitDispatchTo(SILFunction *NewFunc) {
281
282
}
282
283
assert(SubIt == SubEnd && "Too many substitutions.");
283
284
(void) SubEnd;
285
+ #else
286
+ static_cast <void >(FailedTypeCheckBB);
284
287
#endif
285
288
// 2. Convert call arguments, casting and adjusting for calling convention.
286
289
@@ -432,6 +435,9 @@ class EagerSpecializerTransform : public SILModuleTransform {
432
435
};
433
436
} // end anonymous namespace
434
437
438
+ // TODO: Uncomment when Generics.cpp is updated to use the
439
+ // new @_specialize attribute for partial specializations.
440
+ #if 0
435
441
/// Specializes a generic function for a concrete type list.
436
442
static SILFunction *eagerSpecialize(SILFunction *GenericFunc,
437
443
const SILSpecializeAttr &SA,
@@ -466,6 +472,7 @@ static SILFunction *eagerSpecialize(SILFunction *GenericFunc,
466
472
return nullptr;
467
473
#endif
468
474
}
475
+ #endif
469
476
470
477
// / Run the pass.
471
478
void EagerSpecializerTransform::run () {
0 commit comments