Skip to content

Commit f952b0c

Browse files
committed
[PrunedLiveness] Removed invalidate.
The method doesn't do what clients expect.
1 parent 3e08f51 commit f952b0c

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

include/swift/SIL/PrunedLiveness.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ class PrunedLiveBlocks {
202202

203203
bool isInitialized() const { return initializedFlag; }
204204

205-
void invalidate() {
206-
initializedFlag = false;
207-
}
208-
209205
void initializeDiscoveredBlocks(
210206
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks) {
211207
assert(!isInitialized() && "cannot reinitialize after blocks are live");
@@ -371,11 +367,6 @@ class PrunedLiveness {
371367

372368
bool empty() const { return users.empty(); }
373369

374-
void invalidate() {
375-
liveBlocks.invalidate();
376-
users.clear();
377-
}
378-
379370
void initializeDiscoveredBlocks(
380371
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks) {
381372
liveBlocks.initializeDiscoveredBlocks(discoveredBlocks);
@@ -639,12 +630,6 @@ class SSAPrunedLiveness : public PrunedLiveRange<SSAPrunedLiveness> {
639630

640631
SILValue getDef() const { return def; }
641632

642-
void invalidate() {
643-
def = SILValue();
644-
defInst = nullptr;
645-
PrunedLiveRange::invalidate();
646-
}
647-
648633
void initializeDef(SILValue def) {
649634
assert(!this->def && "reinitialization");
650635

@@ -710,10 +695,6 @@ class MultiDefPrunedLiveness : public PrunedLiveRange<MultiDefPrunedLiveness> {
710695
: PrunedLiveRange(function, discoveredBlocks), defs(function),
711696
defBlocks(function) {}
712697

713-
void invalidate() {
714-
PrunedLiveRange::invalidate();
715-
}
716-
717698
void initializeDef(SILInstruction *defInst) {
718699
initializeDefNode(cast<SILNode>(defInst));
719700
}
@@ -800,12 +781,6 @@ class DiagnosticPrunedLiveness : public SSAPrunedLiveness {
800781
: SSAPrunedLiveness(function, discoveredBlocks),
801782
nonLifetimeEndingUsesInLiveOut(nonLifetimeEndingUsesInLiveOut) {}
802783

803-
void invalidate() {
804-
SSAPrunedLiveness::invalidate();
805-
if (nonLifetimeEndingUsesInLiveOut)
806-
nonLifetimeEndingUsesInLiveOut->clear();
807-
}
808-
809784
void updateForUse(SILInstruction *user, bool lifetimeEnding);
810785

811786
using NonLifetimeEndingUsesInLiveOutRange =

include/swift/SILOptimizer/Utils/OwnershipOptUtils.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,6 @@ class GuaranteedOwnershipExtension {
115115
: deleter(deleter), deBlocks(deBlocks),
116116
guaranteedLiveness(function), ownedLifetime(function) {}
117117

118-
void invalidate() {
119-
guaranteedLiveness.invalidate();
120-
ownedLifetime.invalidate();
121-
ownedConsumeBlocks.clear();
122-
beginBorrow = nullptr;
123-
}
124-
125118
/// Invalid indicates that the current guaranteed scope is insufficient, and
126119
/// it does not meet the precondition for scope extension.
127120
///

0 commit comments

Comments
 (0)