3
3
@inline ( never)
4
4
func yes( ) -> Bool { return true }
5
5
6
- @ inline ( never )
7
- func use< V> ( _ v: V ) { }
6
+ #sourceLocation(file: "use.swift", line: 1 )
7
+ @ inline ( never ) func use< V> ( _ v: V ) { }
8
8
9
- @ inline ( __always )
10
- func h< U> ( _ u: U ) {
9
+ #sourceLocation(file: "h.swift", line: 1 )
10
+ @ inline ( __always ) func h< U> ( _ u: U ) {
11
11
yes ( )
12
12
use ( u)
13
13
}
14
14
15
15
#sourceLocation(file: "g.swift", line: 1)
16
16
@inline ( __always) func g< T> ( _ t: T ) {
17
17
if ( yes ( ) ) {
18
- use ( t)
18
+ h ( t)
19
19
}
20
20
}
21
21
22
22
// SIL: sil_scope [[F:.*]] { {{.*}}parent @$S1A1CC1fyyqd__lF
23
- // SIL: sil_scope [[F0:.*]] { loc "f.swift":1:29 parent [[F]] }
24
- // SIL: sil_scope [[F_G_S:.*]] { loc "f.swift":5:5 parent [[F0]] }
25
- // SIL: sil_scope [[G_S:.*]] { loc "g.swift":2:3 {{.*}} inlined_at [[F_G_S]] }
23
+ // SIL: sil_scope [[F1:.*]] { loc "f.swift":1:29 parent [[F]] }
24
+ // SIL: sil_scope [[F1G:.*]] { loc "f.swift":5:5 parent [[F1]] }
25
+ // SIL: sil_scope [[F1G1:.*]] { loc "g.swift":2:3 {{.*}}inlined_at [[F1G]] }
26
+ // SIL: sil_scope [[F1G3:.*]] { loc "g.swift":3:5 {{.*}}inlined_at [[F1G]] }
27
+ // SIL: sil_scope [[F1G3H2:.*]] { loc "h.swift":3:3{{.*}} inlined_at 12 }
28
+ // SIL: sil_scope [[F1G3H2_THUNK:.*]] { loc "use.swift":1:21
29
+ // SIL-SAME: inlined_at [[F1G3H2]] }
26
30
27
31
#sourceLocation(file: "C.swift", line: 1)
28
32
public class C < R> {
@@ -32,9 +36,9 @@ public class C<R> {
32
36
// SIL: // C.f<A>(_:)
33
37
#sourceLocation(file: "f.swift", line: 1)
34
38
public func f< S> ( _ s: S ) {
35
- // SIL: debug_value_addr %0 : $*S, let, name "s", argno 1,
36
- // SIL-SAME: scope [[F ]]
37
- // SIL: function_ref {{.*}}yes {{.*}} scope [[G_S ]]
39
+ // SIL: debug_value_addr %0 : $*S, let, name "s", argno 1,{{.*}} scope [[F]]
40
+ // SIL: function_ref {{.*}}yes{{.*}} scope [[F1G1 ]]
41
+ // SIL: function_ref {{.*}}use {{.*}}:0:0, scope [[F1G3H2_THUNK ]]
38
42
g ( s)
39
43
g ( r)
40
44
g ( ( s, s) )
0 commit comments