@@ -249,7 +249,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
249249 args : & [ OpTy < ' tcx > ] ,
250250 dest : & PlaceTy < ' tcx > ,
251251 ret : Option < mir:: BasicBlock > ,
252- unwind : mir:: UnwindAction ,
253252 ) -> InterpResult < ' tcx > {
254253 let this = self . eval_context_mut ( ) ;
255254
@@ -258,7 +257,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
258257 // FIXME: avoid allocating memory
259258 let dest = this. force_allocation ( dest) ?;
260259
261- let res = match link_name. as_str ( ) {
260+ let handled = match link_name. as_str ( ) {
262261 // LLVM intrinsics
263262 "llvm.prefetch.p0" => {
264263 let [ p, rw, loc, ty] = this. check_shim_sig_unadjusted ( link_name, args) ?;
@@ -285,7 +284,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
285284 throw_unsup_format ! ( "unsupported `llvm.prefetch` type argument: {}" , ty) ;
286285 }
287286
288- EmulateItemResult :: NeedsReturn
287+ true
289288 }
290289 // Used to implement the x86 `_mm{,256,512}_popcnt_epi{8,16,32,64}` and wasm
291290 // `{i,u}8x16_popcnt` functions.
@@ -311,7 +310,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
311310 ) ?;
312311 }
313312
314- EmulateItemResult :: NeedsReturn
313+ true
315314 }
316315
317316 // Target-specific shims
@@ -331,26 +330,18 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
331330 shims:: loongarch:: EvalContextExt :: emulate_loongarch_intrinsic (
332331 this, link_name, args, & dest,
333332 ) ?,
334- _ => EmulateItemResult :: NotSupported ,
333+ _ => false ,
335334 } ;
336335
337336 // The rest either implements the logic, or falls back to `lookup_exported_symbol`.
338- match res {
339- EmulateItemResult :: NeedsReturn => {
340- trace ! ( "{:?}" , this. dump_place( & dest. clone( ) . into( ) ) ) ;
341- this. return_to_block ( ret)
342- }
343- EmulateItemResult :: NeedsUnwind => {
344- // Jump to the unwind block to begin unwinding.
345- this. unwind_to_block ( unwind)
346- }
347- EmulateItemResult :: AlreadyJumped => interp_ok ( ( ) ) ,
348- EmulateItemResult :: NotSupported => {
349- throw_machine_stop ! ( TerminationInfo :: UnsupportedForeignItem ( format!(
350- "can't call LLVM intrinsic `{link_name}` on architecture `{arch}`" ,
351- arch = this. tcx. sess. target. arch,
352- ) ) ) ;
353- }
337+ if handled {
338+ trace ! ( "{:?}" , this. dump_place( & dest. clone( ) . into( ) ) ) ;
339+ this. return_to_block ( ret)
340+ } else {
341+ throw_machine_stop ! ( TerminationInfo :: UnsupportedForeignItem ( format!(
342+ "can't call LLVM intrinsic `{link_name}` on architecture `{arch}`" ,
343+ arch = this. tcx. sess. target. arch,
344+ ) ) ) ;
354345 }
355346 }
356347}
0 commit comments