Skip to content

Commit 37c715c

Browse files
committed
SwiftCompilerSources: add EndLifetimeInst
1 parent b948ccf commit 37c715c

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

SwiftCompilerSources/Sources/SIL/Builder.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ public struct Builder {
187187
return notifyNew(bridged.createDestroyAddr(address.bridged).getAs(DestroyAddrInst.self))
188188
}
189189

190+
@discardableResult
191+
public func createEndLifetime(of value: Value) -> EndLifetimeInst {
192+
return notifyNew(bridged.createEndLifetime(value.bridged).getAs(EndLifetimeInst.self))
193+
}
194+
190195
@discardableResult
191196
public func createDebugStep() -> DebugStepInst {
192197
return notifyNew(bridged.createDebugStep().getAs(DebugStepInst.self))

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ final public class DestroyAddrInst : Instruction, UnaryInstruction {
438438
public var destroyedAddress: Value { operand.value }
439439
}
440440

441+
final public class EndLifetimeInst : Instruction, UnaryInstruction {}
442+
441443
final public class InjectEnumAddrInst : Instruction, UnaryInstruction, EnumInstruction {
442444
public var `enum`: Value { operand.value }
443445
public var caseIndex: Int { bridged.InjectEnumAddrInst_caseIndex() }

SwiftCompilerSources/Sources/SIL/Registration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public func registerSILClasses() {
6464
register(ReleaseValueInst.self)
6565
register(DestroyValueInst.self)
6666
register(DestroyAddrInst.self)
67+
register(EndLifetimeInst.self)
6768
register(StrongCopyUnownedValueInst.self)
6869
register(StrongCopyUnmanagedValueInst.self)
6970
register(InjectEnumAddrInst.self)

include/swift/SIL/SILBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ struct BridgedBuilder{
912912
bool takeSource, bool initializeDest) const;
913913
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createDestroyValue(BridgedValue op) const;
914914
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createDestroyAddr(BridgedValue op) const;
915+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createEndLifetime(BridgedValue op) const;
915916
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createDebugStep() const;
916917
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createApply(BridgedValue function,
917918
BridgedSubstitutionMap subMap,

include/swift/SIL/SILBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,10 @@ BridgedInstruction BridgedBuilder::createDestroyAddr(BridgedValue op) const {
13421342
return {unbridged().createDestroyAddr(regularLoc(), op.getSILValue())};
13431343
}
13441344

1345+
BridgedInstruction BridgedBuilder::createEndLifetime(BridgedValue op) const {
1346+
return {unbridged().createEndLifetime(regularLoc(), op.getSILValue())};
1347+
}
1348+
13451349
BridgedInstruction BridgedBuilder::createDebugStep() const {
13461350
return {unbridged().createDebugStep(regularLoc())};
13471351
}

0 commit comments

Comments
 (0)