@@ -10,8 +10,8 @@ target triple = "x86_64-apple-macosx10.9"
10
10
11
11
declare %swift.refcounted* @swift_unknownObjectRetain (%swift.refcounted* returned )
12
12
declare void @swift_unknownObjectRelease (%swift.refcounted* )
13
- declare %objc_object * @objc_retain ( %objc_object * )
14
- declare void @objc_release ( %objc_object * )
13
+ declare i8 * @llvm.objc.retain ( i8 * )
14
+ declare void @llvm.objc.release ( i8 * )
15
15
declare %swift.refcounted* @swift_allocObject (%swift.heapmetadata* , i64 , i64 ) nounwind
16
16
declare void @swift_release (%swift.refcounted* nocapture )
17
17
declare %swift.refcounted* @swift_retain (%swift.refcounted* returned ) nounwind
@@ -20,7 +20,7 @@ declare void @swift_bridgeObjectRelease(%swift.bridge*)
20
20
declare %swift.refcounted* @swift_retainUnowned (%swift.refcounted* returned )
21
21
22
22
declare void @user (%swift.refcounted * ) nounwind
23
- declare void @user_objc (%objc_object * ) nounwind
23
+ declare void @user_objc (i8 * ) nounwind
24
24
declare void @unknown_func ()
25
25
26
26
define private void @__swift_fixLifetime (%swift.refcounted* ) noinline nounwind {
@@ -30,16 +30,16 @@ entry:
30
30
31
31
; CHECK-LABEL: @trivial_objc_canonicalization(
32
32
; CHECK-NEXT: entry:
33
- ; CHECK-NEXT: [[RET0:%.+]] = bitcast i8* %O to %objc_object *
34
- ; CHECK-NEXT: [[RET1:%.+]] = tail call %objc_object * @objc_retain(%objc_object * [[RET0:%.+]])
35
- ; CHECK-NEXT: call void @user_objc(%objc_object * [[RET0:%.+]])
33
+ ; CHECK-NEXT: [[RET0:%.+]] = bitcast i8* %O to i8 *
34
+ ; CHECK-NEXT: [[RET1:%.+]] = tail call i8 * @llvm.objc.retain(i8 * [[RET0:%.+]])
35
+ ; CHECK-NEXT: call void @user_objc(i8 * [[RET0:%.+]])
36
36
; CHECK-NEXT: ret void
37
37
38
38
define void @trivial_objc_canonicalization (i8* %O ) {
39
39
entry:
40
- %0 = bitcast i8* %O to %objc_object *
41
- %1 = tail call %objc_object * @objc_retain ( %objc_object * %0 )
42
- call void @user_objc (%objc_object * %1 ) nounwind
40
+ %0 = bitcast i8* %O to i8 *
41
+ %1 = tail call i8 * @llvm.objc.retain ( i8 * %0 )
42
+ call void @user_objc (i8 * %1 ) nounwind
43
43
ret void
44
44
}
45
45
@@ -48,14 +48,14 @@ entry:
48
48
; CHECK-NEXT: call void @user
49
49
; CHECK-NEXT: ret void
50
50
51
- define void @trivial_retain_release (%swift.refcounted* %P , %objc_object * %O , %swift.bridge * %B ) {
51
+ define void @trivial_retain_release (%swift.refcounted* %P , i8 * %O , %swift.bridge * %B ) {
52
52
entry:
53
53
tail call %swift.refcounted* @swift_retain (%swift.refcounted* %P )
54
54
tail call void @swift_release (%swift.refcounted* %P ) nounwind
55
55
tail call %swift.refcounted* @swift_unknownObjectRetain (%swift.refcounted* %P )
56
56
tail call void @swift_unknownObjectRelease (%swift.refcounted* %P )
57
- tail call %objc_object * @objc_retain ( %objc_object * %O )
58
- tail call void @objc_release ( %objc_object * %O )
57
+ tail call i8 * @llvm.objc.retain ( i8 * %O )
58
+ tail call void @llvm.objc.release ( i8 * %O )
59
59
%v = tail call %swift.bridge* @swift_bridgeObjectRetain (%swift.bridge* %B )
60
60
tail call void @swift_bridgeObjectRelease (%swift.bridge* %v )
61
61
call void @user (%swift.refcounted* %P ) nounwind
@@ -66,21 +66,21 @@ entry:
66
66
; CHECK-NEXT: entry:
67
67
; CHECK-NEXT: [[RET0:%.+]] = bitcast %swift.refcounted* %P to %swift.refcounted*
68
68
; CHECK-NEXT: [[RET1:%.+]] = bitcast %swift.refcounted* %P to %swift.refcounted*
69
- ; CHECK-NEXT: [[RET2:%.+]] = bitcast %objc_object * %O to %objc_object *
69
+ ; CHECK-NEXT: [[RET2:%.+]] = bitcast i8 * %O to i8 *
70
70
; CHECK-NEXT: call void @user
71
71
; CHECK-NEXT: ret void
72
72
73
- define void @trivial_retain_release_with_rcidentity (%swift.refcounted* %P , %objc_object * %O , %swift.bridge * %B ) {
73
+ define void @trivial_retain_release_with_rcidentity (%swift.refcounted* %P , i8 * %O , %swift.bridge * %B ) {
74
74
entry:
75
75
tail call %swift.refcounted* @swift_retain (%swift.refcounted* %P )
76
76
%1 = bitcast %swift.refcounted* %P to %swift.refcounted*
77
77
tail call void @swift_release (%swift.refcounted* %1 ) nounwind
78
78
tail call %swift.refcounted* @swift_unknownObjectRetain (%swift.refcounted* %P )
79
79
%3 = bitcast %swift.refcounted* %P to %swift.refcounted*
80
80
tail call void @swift_unknownObjectRelease (%swift.refcounted* %3 )
81
- tail call %objc_object * @objc_retain ( %objc_object * %O )
82
- %5 = bitcast %objc_object * %O to %objc_object *
83
- tail call void @objc_release ( %objc_object * %5 )
81
+ tail call i8 * @llvm.objc.retain ( i8 * %O )
82
+ %5 = bitcast i8 * %O to i8 *
83
+ tail call void @llvm.objc.release ( i8 * %5 )
84
84
call void @user (%swift.refcounted* %P ) nounwind
85
85
ret void
86
86
}
@@ -110,8 +110,8 @@ define void @retain_motion1(%swift.refcounted* %A) {
110
110
111
111
define void @objc_retain_release_null () {
112
112
entry:
113
- tail call void @objc_release ( %objc_object * null ) nounwind
114
- tail call %objc_object * @objc_retain ( %objc_object * null )
113
+ tail call void @llvm.objc.release ( i8 * null ) nounwind
114
+ tail call i8 * @llvm.objc.retain ( i8 * null )
115
115
ret void
116
116
}
117
117
@@ -132,10 +132,10 @@ entry:
132
132
; CHECK-NEXT: store i32 42
133
133
; CHECK-NEXT: ret void
134
134
135
- define void @objc_retain_release_opt (%objc_object * %P , i32* %IP ) {
136
- tail call %objc_object * @objc_retain ( %objc_object * %P ) nounwind
135
+ define void @objc_retain_release_opt (i8 * %P , i32* %IP ) {
136
+ tail call i8 * @llvm.objc.retain ( i8 * %P ) nounwind
137
137
store i32 42 , i32* %IP
138
- tail call void @objc_release ( %objc_object * %P ) nounwind
138
+ tail call void @llvm.objc.release ( i8 * %P ) nounwind
139
139
ret void
140
140
}
141
141
@@ -165,12 +165,12 @@ define void @move_retain_across_unknown_retain(%swift.refcounted* %A, %swift.ref
165
165
166
166
; CHECK-LABEL: @move_retain_across_objc_retain
167
167
; CHECK-NOT: swift_retain
168
- ; CHECK: objc_retain
168
+ ; CHECK: llvm.objc.retain
169
169
; CHECK-NOT: swift_release
170
170
; CHECK: ret
171
- define void @move_retain_across_objc_retain (%swift.refcounted* %A , %objc_object * %B ) {
171
+ define void @move_retain_across_objc_retain (%swift.refcounted* %A , i8 * %B ) {
172
172
tail call %swift.refcounted* @swift_retain (%swift.refcounted* %A )
173
- tail call %objc_object * @objc_retain ( %objc_object * %B )
173
+ tail call i8 * @llvm.objc.retain ( i8 * %B )
174
174
tail call void @swift_release (%swift.refcounted* %A ) nounwind
175
175
ret void
176
176
}
0 commit comments