File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1266,6 +1266,7 @@ bool SILInstruction::mayTrap() const {
1266
1266
case SILInstructionKind::CondFailInst:
1267
1267
case SILInstructionKind::UnconditionalCheckedCastInst:
1268
1268
case SILInstructionKind::UnconditionalCheckedCastAddrInst:
1269
+ case SILInstructionKind::UnconditionalCheckedCastValueInst:
1269
1270
return true ;
1270
1271
default :
1271
1272
return false ;
Original file line number Diff line number Diff line change @@ -210,6 +210,23 @@ bb0(%0 : $Builtin.NativeObject):
210
210
return %r : $()
211
211
}
212
212
213
+ // CHECK-LABEL: sil @checkedaddr
214
+ // CHECK: <func=rw+-,param0=,param1=;alloc;trap;readrc>
215
+ sil @checkedaddr : $@convention(thin) (Builtin.NativeObject, X) -> () {
216
+ bb0(%0 : $Builtin.NativeObject, %1 : $X):
217
+ unconditional_checked_cast_addr Builtin.NativeObject in %0 : $Builtin.NativeObject to X in %1 : $X
218
+ %r = tuple ()
219
+ return %r : $()
220
+ }
221
+
222
+ // CHECK-LABEL: sil @checkedcastvalue
223
+ // CHECK: <func=r,param0=;trap>
224
+ sil @checkedcastvalue : $@convention(thin) (Builtin.NativeObject) -> () {
225
+ bb0(%0 : $Builtin.NativeObject):
226
+ %1 = unconditional_checked_cast_value Builtin.NativeObject in %0 : $Builtin.NativeObject to X
227
+ %r = tuple ()
228
+ return %r : $()
229
+ }
213
230
214
231
sil_global public @sil_global1 : $Int32
215
232
You can’t perform that action at this time.
0 commit comments