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 {
12661266 case SILInstructionKind::CondFailInst:
12671267 case SILInstructionKind::UnconditionalCheckedCastInst:
12681268 case SILInstructionKind::UnconditionalCheckedCastAddrInst:
1269+ case SILInstructionKind::UnconditionalCheckedCastValueInst:
12691270 return true ;
12701271 default :
12711272 return false ;
Original file line number Diff line number Diff line change @@ -210,6 +210,23 @@ bb0(%0 : $Builtin.NativeObject):
210210 return %r : $()
211211}
212212
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+ }
213230
214231sil_global public @sil_global1 : $Int32
215232
You can’t perform that action at this time.
0 commit comments