Swift SIL: add some instruction classes and APIs

* add `UnownedRetainInst` and `UnownedReleaseInst`
* add `var value` to `RetainValueInst` and `ReleaseValueInst`
* make the protocol `UnaryInstruction` be an `Instruction`
* add `var Type.isValueTypeWithDeinit`
* add `var Type.isUnownedStorageType`
* add `var OperandArray.values`
This commit is contained in:
Erik Eckstein
2023-06-06 19:12:47 +02:00
parent ae9a0c1007
commit 5325a4fe21
9 changed files with 65 additions and 2 deletions

View File

@@ -136,6 +136,18 @@ public struct Builder {
return notifyNew(release.getAs(StrongReleaseInst.self))
}
@discardableResult
public func createUnownedRetain(operand: Value) -> UnownedRetainInst {
let retain = bridged.createUnownedRetain(operand.bridged)
return notifyNew(retain.getAs(UnownedRetainInst.self))
}
@discardableResult
public func createUnownedRelease(operand: Value) -> UnownedReleaseInst {
let release = bridged.createUnownedRelease(operand.bridged)
return notifyNew(release.getAs(UnownedReleaseInst.self))
}
public func createFunctionRef(_ function: Function) -> FunctionRefInst {
let functionRef = bridged.createFunctionRef(function.bridged)
return notifyNew(functionRef.getAs(FunctionRefInst.self))