File: cf.sil

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (69 lines) | stat: -rw-r--r-- 3,695 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// RUN: %empty-directory(%t)
// RUN: %{python} %utils/chex.py < %s > %t/cf.sil
// RUN: %target-swift-frontend -enable-objc-interop -sdk %S/Inputs %t/cf.sil -emit-ir -import-cf-types | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize %t/cf.sil -DINT=i%target-ptrsize -check-prefix CHECK-%target-import-type -check-prefix CHECK-%target-import-type-%target-ptrsize

// REQUIRES: CPU=i386 || CPU=x86_64

// CHECK: [[TYPE:%swift.type]] = type

// CHECK: [[MUTABLE_REFRIGERATOR_NAME:@.*]] = private constant [52 x i8] c"CCMutableRefrigerator\00NCCMutableRefrigeratorRef\00St\00\00"

// CHECK: @"$sSo24CCMutableRefrigeratorRefaMn" = linkonce_odr hidden constant
// -- is imported, foreign init, is class, is nonunique
// CHECK-SAME: <i32 0x0006_0010>
// CHECK-SAME: [[MUTABLE_REFRIGERATOR_NAME]]
// CHECK-SAME: @"$sSo24CCMutableRefrigeratorRefaMa"
// CHECK-SAME: @"$sSo24CCMutableRefrigeratorRefaMr"

// CHECK: @"$sSo24CCMutableRefrigeratorRefaMf" = linkonce_odr hidden global <{ {{.*}} }> <{
// -- value witness table
// CHECK-DIRECT-SAME: ptr @"$sBOWV",
// CHECK-INDIRECT-SAME: ptr null,
// CHECK-64-SAME: i64 515, {{.*}}"$sSo24CCMutableRefrigeratorRefaMn", ptr null, ptr null }>

// CHECK: @"$sSo17CCRefrigeratorRefaMf" = linkonce_odr hidden
// CHECK-DIRECT-SAME: constant
// CHECK-INDIRECT-SAME: global
// CHECK-SAME: <{ {{.*}} }> <{
// -- value witness table
// CHECK-DIRECT-SAME: ptr @"$sBOWV",
// CHECK-INDIRECT-SAME: ptr null,
// CHECK-SAME: [[INT]] 515, {{.*}}"$sSo17CCRefrigeratorRefaMn", ptr null, ptr null }>

sil_stage canonical

import CoreCooling
import Swift

sil public_external @generic_function : $@convention(thin) <T where T : AnyObject> (@owned T) -> ()

sil @call_generic : $@convention(thin) (@owned CCRefrigerator, @owned CCMutableRefrigerator) -> () {
bb0(%0 : $CCRefrigerator, %1: $CCMutableRefrigerator):
  %2 = function_ref @generic_function : $@convention(thin) <τ_0_0 where τ_0_0 : AnyObject> (@owned τ_0_0) -> ()
  %3 = apply %2<CCRefrigerator>(%0) : $@convention(thin) <τ_0_0 where τ_0_0 : AnyObject> (@owned τ_0_0) -> ()
  %4 = apply %2<CCMutableRefrigerator>(%1) : $@convention(thin) <τ_0_0 where τ_0_0 : AnyObject> (@owned τ_0_0) -> ()
  %5 = tuple ()
  return %5 : $()
}

// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @call_generic
// CHECK-SAME:    (ptr %0, ptr %1) {{.*}} {
// CHECK: [[T1:%.*]] = call swiftcc %swift.metadata_response @"$sSo17CCRefrigeratorRefaMa"([[INT]] 0)
// CHECK-NEXT: [[T2:%.*]] = extractvalue %swift.metadata_response [[T1]], 0
// CHECK-NEXT: call swiftcc void @generic_function(ptr %0, ptr [[T2]])
// CHECK: [[T1:%.*]] = call swiftcc %swift.metadata_response @"$sSo24CCMutableRefrigeratorRefaMa"([[INT]] 0)
// CHECK-NEXT: [[T2:%.*]] = extractvalue %swift.metadata_response [[T1]], 0
// CHECK-NEXT: call swiftcc void @generic_function(ptr %1, ptr [[T2]])
// CHECK-NEXT: ret void

// CHECK-LABEL: define linkonce_odr hidden swiftcc %swift.metadata_response @"$sSo17CCRefrigeratorRefaMa"(
// CHECK:      call swiftcc %swift.metadata_response @swift_getForeignTypeMetadata([[INT]] %0,
// CHECK-SAME: @"$sSo17CCRefrigeratorRefaMf"

// CHECK-LABEL:    define internal swiftcc %swift.metadata_response @"$sSo24CCMutableRefrigeratorRefaMr"(ptr %0, ptr %1, ptr %2)
// CHECK:      [[T0:%.*]] = call swiftcc %swift.metadata_response @"$sSo17CCRefrigeratorRefaMa"([[INT]] 255)
// CHECK-NEXT: [[T1:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
// CHECK-NEXT: extractvalue %swift.metadata_response [[T0]], 1
// CHECK-NEXT: [[T3:%.*]] = getelementptr inbounds ptr, ptr %0, i32 2
// CHECK-NEXT: store ptr [[T1]], ptr [[T3]], align
// CHECK-NEXT: ret %swift.metadata_response zeroinitializer