mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: add the borrowed-from instruction.
It declares from which enclosing values a guaranteed phi argument is borrowed from.
This commit is contained in:
@@ -184,6 +184,13 @@ public struct Builder {
|
||||
return notifyNew(bridged.createBeginBorrow(value.bridged).getAs(BeginBorrowInst.self))
|
||||
}
|
||||
|
||||
public func createBorrowedFrom(borrowedValue: Value, enclosingValues: [Value]) -> BorrowedFromInst {
|
||||
let bfi = enclosingValues.withBridgedValues { valuesRef in
|
||||
return bridged.createBorrowedFrom(borrowedValue.bridged, valuesRef)
|
||||
}
|
||||
return notifyNew(bfi.getAs(BorrowedFromInst.self))
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
public func createEndBorrow(of beginBorrow: Value) -> EndBorrowInst {
|
||||
return notifyNew(bridged.createEndBorrow(beginBorrow.bridged).getAs(EndBorrowInst.self))
|
||||
|
||||
Reference in New Issue
Block a user