mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Before this change, stepping through the code 1 foo(x, 2 f(a) 3 f(b) 4 ) would visit the code in the order 2, 3, 4, with the function call being on line 4. After this patch the order is 2, 3, 1 with the function call being on line 1. This is both closer to what clang generates for simialar C code and more useful to the programmer since it is easier to understand which function is being called in a nested expression. rdar://problem/35430708
18 lines
564 B
Swift
18 lines
564 B
Swift
// RUN: %target-swift-frontend %s -g -emit-ir -o - | %FileCheck %s
|
|
|
|
func markUsed<T>(_ t: T) {}
|
|
|
|
func foo(_ a : Int64, _ b : Int64) -> Int64 {
|
|
return a+b
|
|
}
|
|
|
|
// CHECK: call {{.*}}foo{{.*}}, !dbg ![[ARG1:.*]]
|
|
// CHECK: call {{.*}}foo{{.*}}, !dbg ![[ARG2:.*]]
|
|
// CHECK: call {{.*}}foo{{.*}}, !dbg ![[OUTER:.*]]
|
|
let r = foo(
|
|
foo(1, 23), // CHECK: ![[ARG1]] = !DILocation(line: [[@LINE]],
|
|
foo(2, 42) // CHECK: ![[ARG2]] = !DILocation(line: [[@LINE]],
|
|
) // CHECK: ![[OUTER]] = !DILocation(line: [[@LINE-3]],
|
|
markUsed(r)
|
|
|