mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The previous code made the assumption that the ASTScope for a variable declaration should be the one of the declaration's source location. That is not necessarily the case, in some cases it should be an ancestor scope. This patch introduces a map from ValueDecl -> ASTScope that is derived from querying each ASTScope for its locals, which matches also what happens in name lookup. This patch also fixes the nesting of SILDebugScopes created for guard statement bodies, which are incorrectly nested in the ASTScope hierarchy. rdar://108940570
9 lines
331 B
Swift
9 lines
331 B
Swift
// RUN: %target-swift-frontend -g -emit-sil %s -parse-as-library -module-name a | %FileCheck %s
|
|
func use<T>(_ t: T) {}
|
|
public func f(value: (Int, Int)) {
|
|
let (x, y) = value
|
|
// CHECK: debug_value {{.*}}let, name "x", {{.*}}, scope [[LET:[0-9]+]]
|
|
// CHECK: debug_value {{.*}}let, name "y", {{.*}}, scope [[LET]]
|
|
use((x,y))
|
|
}
|