SwiftCompilerSources: move SIL-related Context APIs from Optimizer to the SIL module

This commit is contained in:
Erik Eckstein
2025-07-28 10:38:45 +02:00
parent 319f49ad9f
commit 41a6b8e257
20 changed files with 361 additions and 430 deletions

View File

@@ -53,7 +53,12 @@ extension ForwardingInstruction {
public var forwardingOwnership: Ownership {
Ownership(bridged: bridged.ForwardingInst_forwardingOwnership())
}
public func setForwardingOwnership(to ownership: Ownership, _ context: some MutatingContext) {
context.notifyInstructionsChanged()
bridged.ForwardingInst_setForwardingOwnership(ownership._bridged)
}
/// A forwarding instruction preserves reference counts if it has a dynamically non-trivial result in which all references are forwarded from the operand.
///
/// A cast can only forward guaranteed values if it preserves reference counts. Such casts cannot release any references within their operand's value and cannot retain any references owned by their result.