Skip to content

Commit 1fcfa11

Browse files
committed
Optimizer: add InstructionRange.init(begin:,ends:) API
1 parent b4ba750 commit 1fcfa11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/DataStructures/InstructionRange.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ struct InstructionRange : CustomStringConvertible, NoReflectionChildren {
5959
self.inExclusiveRange.insert(beginInst)
6060
}
6161

62+
init<S: Sequence>(begin beginInst: Instruction, ends: S, _ context: some Context) where S.Element: Instruction {
63+
self = InstructionRange(begin: beginInst, context)
64+
insert(contentsOf: ends)
65+
}
66+
6267
init(for value: Value, _ context: some Context) {
6368
self = InstructionRange(begin: InstructionRange.beginningInstruction(for: value), context)
6469
}

0 commit comments

Comments
 (0)