@@ -201,27 +201,13 @@ class DeadFunctionAndGlobalElimination {
201
201
}
202
202
} break ;
203
203
204
- case SILWitnessTable::AssociatedConformance: {
205
- ProtocolConformanceRef CRef =
206
- entry.getAssociatedConformanceWitness ().Witness ;
207
- if (CRef.isConcrete ())
208
- ensureAliveConformance (CRef.getConcrete ());
209
- break ;
210
- }
204
+ case SILWitnessTable::AssociatedConformance:
211
205
case SILWitnessTable::BaseProtocol:
212
- ensureAliveConformance (entry.getBaseProtocolWitness ().Witness );
213
- break ;
214
-
215
206
case SILWitnessTable::Invalid:
216
207
case SILWitnessTable::AssociatedType:
217
208
break ;
218
209
}
219
210
}
220
-
221
- for (const auto &conf : WT->getConditionalConformances ()) {
222
- if (conf.isConcrete ())
223
- ensureAliveConformance (conf.getConcrete ());
224
- }
225
211
}
226
212
227
213
// / Marks the \p global and all functions, which are referenced from its
@@ -279,14 +265,6 @@ class DeadFunctionAndGlobalElimination {
279
265
makeAlive (global);
280
266
}
281
267
282
- // / Marks a witness table as alive if it is not alive yet.
283
- void ensureAliveConformance (const ProtocolConformance *C) {
284
- SILWitnessTable *WT = Module->lookUpWitnessTable (C);
285
- if (!WT || isAlive (WT))
286
- return ;
287
- makeAlive (WT);
288
- }
289
-
290
268
// / Returns true if the implementation of method \p FD in class \p ImplCl
291
269
// / may be called when the type of the class_method's operand is \p MethodCl.
292
270
// / Both, \p MethodCl and \p ImplCl, may by null if not known or if it's a
@@ -322,7 +300,7 @@ class DeadFunctionAndGlobalElimination {
322
300
if (!isAlive (FImpl.F ) &&
323
301
canHaveSameImplementation (FD, MethodCl,
324
302
FImpl.Impl .get <ClassDecl *>())) {
325
- makeAlive (FImpl.F );
303
+ ensureAlive (FImpl.F );
326
304
} else {
327
305
allImplsAreCalled = false ;
328
306
}
@@ -341,9 +319,9 @@ class DeadFunctionAndGlobalElimination {
341
319
if (auto Conf = FImpl.Impl .dyn_cast <ProtocolConformance *>()) {
342
320
SILWitnessTable *WT = Module->lookUpWitnessTable (Conf);
343
321
if (!WT || isAlive (WT))
344
- makeAlive (FImpl.F );
322
+ ensureAlive (FImpl.F );
345
323
} else {
346
- makeAlive (FImpl.F );
324
+ ensureAlive (FImpl.F );
347
325
}
348
326
}
349
327
}
0 commit comments