Skip to content

Commit e40fd35

Browse files
committed
SwiftCompilerSources: add Value.nextInstruction
1 parent 33ed895 commit e40fd35

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

SwiftCompilerSources/Sources/SIL/Value.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ extension Value {
138138
}
139139
}
140140

141+
public var nextInstruction: Instruction {
142+
if self is Argument {
143+
return parentBlock.instructions.first!
144+
}
145+
// Block terminators do not directly produce values.
146+
return definingInstruction!.next!
147+
}
148+
141149
public var hashable: HashableValue { ObjectIdentifier(self) }
142150

143151
public var bridged: BridgedValue {

0 commit comments

Comments
 (0)