Skip to content

Commit 09b1c31

Browse files
committed
[NFC] Mem2Reg: Remove unused parameter.
1 parent 3728c77 commit 09b1c31

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ class LiveValues {
123123
}
124124

125125
void endLexicalLifetimeBeforeInst(AllocStackInst *asi,
126-
SILInstruction *beforeInstruction,
127-
SILBuilderContext &ctx);
126+
SILInstruction *beforeInstruction);
128127
};
129128
struct Guaranteed {
130129
SILValue stored = SILValue();
@@ -173,8 +172,7 @@ class LiveValues {
173172
}
174173

175174
void endLexicalLifetimeBeforeInst(AllocStackInst *asi,
176-
SILInstruction *beforeInstruction,
177-
SILBuilderContext &ctx);
175+
SILInstruction *beforeInstruction);
178176
};
179177
struct None {
180178
SILValue stored = SILValue();
@@ -190,8 +188,7 @@ class LiveValues {
190188
bool canEndLexicalLifetime() { return false; }
191189

192190
void endLexicalLifetimeBeforeInst(AllocStackInst *asi,
193-
SILInstruction *beforeInstruction,
194-
SILBuilderContext &ctx);
191+
SILInstruction *beforeInstruction);
195192
};
196193

197194
private:
@@ -289,23 +286,22 @@ class LiveValues {
289286
}
290287

291288
void endLexicalLifetimeBeforeInst(AllocStackInst *asi,
292-
SILInstruction *beforeInstruction,
293-
SILBuilderContext &ctx) {
289+
SILInstruction *beforeInstruction) {
294290
if (auto *owned = storage.dyn_cast<Owned>()) {
295-
return owned->endLexicalLifetimeBeforeInst(asi, beforeInstruction, ctx);
291+
return owned->endLexicalLifetimeBeforeInst(asi, beforeInstruction);
296292
} else if (auto *none = storage.dyn_cast<None>()) {
297-
return none->endLexicalLifetimeBeforeInst(asi, beforeInstruction, ctx);
293+
return none->endLexicalLifetimeBeforeInst(asi, beforeInstruction);
298294
}
299295
auto &guaranteed = storage.get<Guaranteed>();
300-
return guaranteed.endLexicalLifetimeBeforeInst(asi, beforeInstruction, ctx);
296+
return guaranteed.endLexicalLifetimeBeforeInst(asi, beforeInstruction);
301297
}
302298

303299
bool endLexicalLifetimeBeforeInstIfPossible(AllocStackInst *asi,
304300
SILInstruction *beforeInstruction,
305301
SILBuilderContext &ctx) {
306302
if (!canEndLexicalLifetime())
307303
return false;
308-
endLexicalLifetimeBeforeInst(asi, beforeInstruction, ctx);
304+
endLexicalLifetimeBeforeInst(asi, beforeInstruction);
309305
return true;
310306
}
311307
};
@@ -811,17 +807,15 @@ beginGuaranteedLexicalLifetimeAfterStore(AllocStackInst *asi,
811807
/// it will already have been ended naturally by destroy_addrs (or equivalent)
812808
/// of the alloc_stack.
813809
void LiveValues::Owned::endLexicalLifetimeBeforeInst(
814-
AllocStackInst *asi, SILInstruction *beforeInstruction,
815-
SILBuilderContext &ctx) {
810+
AllocStackInst *asi, SILInstruction *beforeInstruction) {
816811
assert(lexicalLifetimeEnsured(asi));
817812
assert(beforeInstruction);
818813
}
819814

820815
/// End the lexical borrow scope for an @guaranteed stored value described by
821816
/// the provided LiveValues struct before the specified instruction.
822817
void LiveValues::Guaranteed::endLexicalLifetimeBeforeInst(
823-
AllocStackInst *asi, SILInstruction *beforeInstruction,
824-
SILBuilderContext &ctx) {
818+
AllocStackInst *asi, SILInstruction *beforeInstruction) {
825819
assert(lexicalLifetimeEnsured(asi));
826820
assert(beforeInstruction);
827821
assert(borrow);
@@ -831,8 +825,7 @@ void LiveValues::Guaranteed::endLexicalLifetimeBeforeInst(
831825
}
832826

833827
void LiveValues::None::endLexicalLifetimeBeforeInst(
834-
AllocStackInst *asi, SILInstruction *beforeInstruction,
835-
SILBuilderContext &ctx) {
828+
AllocStackInst *asi, SILInstruction *beforeInstruction) {
836829
llvm::report_fatal_error(
837830
"can't have lexical lifetime for ownership none value");
838831
}
@@ -1061,7 +1054,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
10611054
if (runningVals && runningVals->value.canEndLexicalLifetime()) {
10621055
// End it right now if we have enough information.
10631056
runningVals->value.getOwned().endLexicalLifetimeBeforeInst(
1064-
asi, /*beforeInstruction=*/li, ctx);
1057+
asi, /*beforeInstruction=*/li);
10651058
} else {
10661059
// If we don't have enough information, end it endLexicalLifetime.
10671060
assert(!deinitializationPoints[blockPromotingWithin]);
@@ -1143,7 +1136,7 @@ SILInstruction *StackAllocationPromoter::promoteAllocationInBlock(
11431136
if (oldRunningVals && oldRunningVals->isStorageValid &&
11441137
oldRunningVals->value.canEndLexicalLifetime()) {
11451138
oldRunningVals->value.getOwned().endLexicalLifetimeBeforeInst(
1146-
asi, /*beforeInstruction=*/si, ctx);
1139+
asi, /*beforeInstruction=*/si);
11471140
}
11481141
runningVals = beginOwnedLexicalLifetimeAfterStore(asi, si);
11491142
}

0 commit comments

Comments
 (0)