Skip to content

Commit 2bdaa68

Browse files
committed
SwiftCompilerSources: add IgnoredUseInst as incidental
Fixes rdar://148540048 (Assigning span value to `_` results in an incorrect escape diagnostic)
1 parent e454c0a commit 2bdaa68

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ extension LifetimeDependenceDefUseWalker {
638638
is DestroyNotEscapedClosureInst, is ClassMethodInst, is SuperMethodInst,
639639
is ClassifyBridgeObjectInst, is DebugValueInst,
640640
is ObjCMethodInst, is ObjCSuperMethodInst, is UnmanagedRetainValueInst,
641-
is UnmanagedReleaseValueInst, is SelectEnumInst:
641+
is UnmanagedReleaseValueInst, is SelectEnumInst, is IgnoredUseInst:
642642
// Catch .instantaneousUse operations that are dependence leaf uses.
643643
return leafUse(of: operand)
644644

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ public class Instruction : CustomStringConvertible, Hashable {
149149
/// their operand.
150150
public final var isIncidentalUse: Bool {
151151
switch self {
152-
case is DebugValueInst, is FixLifetimeInst, is EndLifetimeInst:
152+
case is DebugValueInst, is FixLifetimeInst, is EndLifetimeInst,
153+
is IgnoredUseInst:
153154
return true
154155
default:
155156
return isEndOfScopeMarker

0 commit comments

Comments
 (0)