Support tail calls in mir via TerminatorKind::TailCall

This commit is contained in:
Maybe Waffle 2024-02-15 19:54:37 +00:00 committed by Maybe Lapkin
parent c6b883bb2e
commit 9978261a6e
2 changed files with 6 additions and 0 deletions

View File

@ -491,6 +491,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
)
});
}
// FIXME(explicit_tail_calls): add support for tail calls to the cranelift backend, once cranelift supports tail calls
TerminatorKind::TailCall { fn_span, .. } => span_bug!(
*fn_span,
"tail calls are not yet supported in `rustc_codegen_cranelift` backend"
),
TerminatorKind::InlineAsm {
template,
operands,

View File

@ -565,6 +565,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
{
return None;
}
TerminatorKind::TailCall { .. } => return None,
TerminatorKind::Call { .. } => {}
}
}