Skip to content

Commit b3e169b

Browse files
committed
[NFC] Rename a variable for clarity.
1 parent eb1d5f4 commit b3e169b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,12 +838,13 @@ extension ExtendableScope {
838838
// Collect the original end instructions and extend the range to to cover them. The resulting access scope
839839
// must cover the original scope because it may protect other memory operations.
840840
let endsToErase = self.endInstructions
841-
var unusedEnds = InstructionSet(context)
841+
// Track range ending instructions that have not been reused for later deletion.
842+
var unreusedEnds = InstructionSet(context)
842843
for end in endsToErase {
843844
assert(range.inclusiveRangeContains(end))
844-
unusedEnds.insert(end)
845+
unreusedEnds.insert(end)
845846
}
846-
defer { unusedEnds.deinitialize() }
847+
defer { unreusedEnds.deinitialize() }
847848
for end in range.ends {
848849
let location = end.location.asAutoGenerated
849850
switch end {
@@ -861,9 +862,9 @@ extension ExtendableScope {
861862
default:
862863
break
863864
}
864-
if unusedEnds.contains(end) {
865-
unusedEnds.erase(end)
866-
assert(!unusedEnds.contains(end))
865+
if unreusedEnds.contains(end) {
866+
unreusedEnds.erase(end)
867+
assert(!unreusedEnds.contains(end))
867868
continue
868869
}
869870
Builder.insert(after: end, location: location, context) {
@@ -875,7 +876,7 @@ extension ExtendableScope {
875876
let builder = Builder(before: exitInst, location: location, context)
876877
range.insert(createEndInstruction(builder, context))
877878
}
878-
return endsToErase.filter { unusedEnds.contains($0) }
879+
return endsToErase.filter { unreusedEnds.contains($0) }
879880
}
880881

881882
/// Create a scope-ending instruction at 'builder's insertion point.

0 commit comments

Comments
 (0)