From f9f709b7c3ed9f9b2c0e34f84a34ebdc23728e45 Mon Sep 17 00:00:00 2001 From: Meghana Gupta Date: Mon, 5 May 2025 11:20:38 -0700 Subject: [PATCH] Fix newly introduced warnings in LifetimeDependenceScopeFixup --- .../LifetimeDependenceScopeFixup.swift | 14 +------------- SwiftCompilerSources/Sources/SIL/Builder.swift | 1 + 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift index 1c881d06fa494..d7293a3f9c08e 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift @@ -194,19 +194,7 @@ private func createEndCOWMutationIfNeeded(lifetimeDep: LifetimeDependence, _ con } scoped = beginApply // None of the below cases can generate a mutable address. - case let .owned: - fallthrough - case let .borrowed: - fallthrough - case let .local: - fallthrough - case let .initialized: - fallthrough - case let .caller: - fallthrough - case let .global: - fallthrough - case let .unknown: + case .owned, .borrowed, .local, .initialized, .caller, .global, .unknown: return } diff --git a/SwiftCompilerSources/Sources/SIL/Builder.swift b/SwiftCompilerSources/Sources/SIL/Builder.swift index 782fea0b10f27..6032ac8c97a30 100644 --- a/SwiftCompilerSources/Sources/SIL/Builder.swift +++ b/SwiftCompilerSources/Sources/SIL/Builder.swift @@ -575,6 +575,7 @@ public struct Builder { return notifyNew(endMutation.getAs(EndCOWMutationInst.self)) } + @discardableResult public func createEndCOWMutationAddr(address: Value) -> EndCOWMutationAddrInst { let endMutation = bridged.createEndCOWMutationAddr(address.bridged) return notifyNew(endMutation.getAs(EndCOWMutationAddrInst.self))