Skip to content

Commit af878cc

Browse files
committed
LifetimeDependenceInsertion: support '@'_addressable parameters
1 parent bc6200e commit af878cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceInsertion.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ private extension LifetimeDependentApply.LifetimeSourceInfo {
217217
// A coroutine creates its own borrow scope, nested within its borrowed operand.
218218
bases.append(source.value)
219219
case .result, .inParameter, .inoutParameter:
220+
// addressable dependencies directly depend on the incoming address.
221+
if source.convention.isAddressable {
222+
bases.append(source.value)
223+
return
224+
}
220225
// Create a new dependence on the apply's access to the argument.
221226
for varIntoducer in gatherVariableIntroducers(for: source.value, context) {
222227
let scope = LifetimeDependence.Scope(base: varIntoducer, context)

0 commit comments

Comments
 (0)