Skip to content

Commit 6334c77

Browse files
committed
[NFC] MOWTE: Deleted dead array.
The modified arguments were recorded but never used.
1 parent 0ebe825 commit 6334c77

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ namespace {
5151

5252
struct SILMoveOnlyWrappedTypeEliminatorVisitor
5353
: SILInstructionVisitor<SILMoveOnlyWrappedTypeEliminatorVisitor, bool> {
54-
const llvm::SmallSetVector<SILArgument *, 8> &touchedArgs;
55-
56-
SILMoveOnlyWrappedTypeEliminatorVisitor(
57-
const llvm::SmallSetVector<SILArgument *, 8> &touchedArgs)
58-
: touchedArgs(touchedArgs) {}
59-
6054
bool visitSILInstruction(SILInstruction *inst) {
6155
llvm::errs() << "Unhandled SIL Instruction: " << *inst;
6256
llvm_unreachable("error");
@@ -295,7 +289,6 @@ static bool isMoveOnlyWrappedTrivial(SILValue value) {
295289
bool SILMoveOnlyWrappedTypeEliminator::process() {
296290
bool madeChange = true;
297291

298-
llvm::SmallSetVector<SILArgument *, 8> touchedArgs;
299292
llvm::SmallSetVector<SILInstruction *, 8> touchedInsts;
300293

301294
auto recordValue = [&touchedInsts, fn = fn,
@@ -320,12 +313,6 @@ bool SILMoveOnlyWrappedTypeEliminator::process() {
320313
if (!relevant)
321314
continue;
322315

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-
329316
madeChange = true;
330317
}
331318

@@ -346,7 +333,7 @@ bool SILMoveOnlyWrappedTypeEliminator::process() {
346333
}
347334
}
348335

349-
SILMoveOnlyWrappedTypeEliminatorVisitor visitor(touchedArgs);
336+
SILMoveOnlyWrappedTypeEliminatorVisitor visitor;
350337
while (!touchedInsts.empty()) {
351338
visitor.visit(touchedInsts.pop_back_val());
352339
}

0 commit comments

Comments
 (0)