diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-04-24 13:02:28 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-04-24 13:02:28 +0000 |
| commit | eef57cb4e290ea44bae26a1320c37c76b13275b6 (patch) | |
| tree | a62cb0539431dda07bb3ed78726b9b950e9c0c66 | |
| parent | 0103c583fa01dd21d49fa9d5b2009e4c217659e2 (diff) | |
| download | rust-eef57cb4e290ea44bae26a1320c37c76b13275b6.tar.gz rust-eef57cb4e290ea44bae26a1320c37c76b13275b6.zip | |
Pass Option<Span> to codegen_unwind_terminate
In preparation for unwinding support.
| -rw-r--r-- | src/base.rs | 14 | ||||
| -rw-r--r-- | src/compiler_builtins.rs | 1 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/base.rs b/src/base.rs index 6b850a9a6e6..7c02b3f48f9 100644 --- a/src/base.rs +++ b/src/base.rs @@ -566,7 +566,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) { ); } TerminatorKind::UnwindTerminate(reason) => { - codegen_unwind_terminate(fx, source_info, *reason); + codegen_unwind_terminate(fx, Some(source_info.span), *reason); } TerminatorKind::UnwindResume => { // FIXME implement unwinding @@ -1117,18 +1117,10 @@ pub(crate) fn codegen_panic_nounwind<'tcx>( pub(crate) fn codegen_unwind_terminate<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, - source_info: mir::SourceInfo, + span: Option<Span>, reason: UnwindTerminateReason, ) { - let args = []; - - codegen_panic_inner( - fx, - reason.lang_item(), - &args, - UnwindAction::Terminate(UnwindTerminateReason::Abi), - Some(source_info.span), - ); + codegen_panic_inner(fx, reason.lang_item(), &[], UnwindAction::Unreachable, span); } fn codegen_panic_inner<'tcx>( diff --git a/src/compiler_builtins.rs b/src/compiler_builtins.rs index bf16e81a06f..5b6d0ef6ddf 100644 --- a/src/compiler_builtins.rs +++ b/src/compiler_builtins.rs @@ -67,5 +67,4 @@ builtin_functions! { fn malloc(size: size_t) -> *mut c_void; fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; fn free(p: *mut c_void) -> (); - } |
