Skip to content

Commit 7cfe4a5

Browse files
committed
LifetimeDependenceDiagnostics: fix global sourceLoc.
1 parent e871ce9 commit 7cfe4a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private struct LifetimeVariable {
320320
self = Self(introducer: allocStack)
321321
case .global(let globalVar):
322322
self.varDecl = globalVar.varDecl
323-
self.sourceLoc = nil
323+
self.sourceLoc = varDecl?.nameLoc
324324
case .class(let refAddr):
325325
self.varDecl = refAddr.varDecl
326326
self.sourceLoc = refAddr.location.sourceLoc

0 commit comments

Comments
 (0)