Skip to content

Commit 72c1064

Browse files
committed
Swift SIL: add the Deallocation.allocatedValue instruction API
1 parent 26b2309 commit 72c1064

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,14 @@ final public class UnimplementedRefCountingInst : RefCountingInst {}
345345
// no-value deallocation instructions
346346
//===----------------------------------------------------------------------===//
347347

348-
public protocol Deallocation : Instruction { }
348+
public protocol Deallocation : Instruction {
349+
var allocatedValue: Value { get }
350+
}
351+
352+
extension Deallocation {
353+
public var allocatedValue: Value { operands[0].value }
354+
}
355+
349356

350357
final public class DeallocStackInst : Instruction, UnaryInstruction, Deallocation {
351358
public var allocstack: AllocStackInst {

0 commit comments

Comments
 (0)