@@ -51,12 +51,6 @@ namespace {
51
51
52
52
struct SILMoveOnlyWrappedTypeEliminatorVisitor
53
53
: SILInstructionVisitor<SILMoveOnlyWrappedTypeEliminatorVisitor, bool > {
54
- const llvm::SmallSetVector<SILArgument *, 8 > &touchedArgs;
55
-
56
- SILMoveOnlyWrappedTypeEliminatorVisitor (
57
- const llvm::SmallSetVector<SILArgument *, 8 > &touchedArgs)
58
- : touchedArgs(touchedArgs) {}
59
-
60
54
bool visitSILInstruction (SILInstruction *inst) {
61
55
llvm::errs () << " Unhandled SIL Instruction: " << *inst;
62
56
llvm_unreachable (" error" );
@@ -295,7 +289,6 @@ static bool isMoveOnlyWrappedTrivial(SILValue value) {
295
289
bool SILMoveOnlyWrappedTypeEliminator::process () {
296
290
bool madeChange = true ;
297
291
298
- llvm::SmallSetVector<SILArgument *, 8 > touchedArgs;
299
292
llvm::SmallSetVector<SILInstruction *, 8 > touchedInsts;
300
293
301
294
auto recordValue = [&touchedInsts, fn = fn,
@@ -320,12 +313,6 @@ bool SILMoveOnlyWrappedTypeEliminator::process() {
320
313
if (!relevant)
321
314
continue ;
322
315
323
- // If our new type is trivial, convert the arguments ownership to
324
- // None. Otherwise, preserve the ownership kind of the argument.
325
- if (arg->getType ().isTrivial (*fn))
326
- arg->setOwnershipKind (OwnershipKind::None);
327
- touchedArgs.insert (arg);
328
-
329
316
madeChange = true ;
330
317
}
331
318
@@ -346,7 +333,7 @@ bool SILMoveOnlyWrappedTypeEliminator::process() {
346
333
}
347
334
}
348
335
349
- SILMoveOnlyWrappedTypeEliminatorVisitor visitor (touchedArgs) ;
336
+ SILMoveOnlyWrappedTypeEliminatorVisitor visitor;
350
337
while (!touchedInsts.empty ()) {
351
338
visitor.visit (touchedInsts.pop_back_val ());
352
339
}
0 commit comments