Skip to content

Commit 5c95576

Browse files
committed
impl janky codegen
1 parent c19a4f3 commit 5c95576

File tree

1 file changed

+7
-8
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+7
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
342342

343343
/// Codegen implementations for some terminator variants.
344344
impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
345-
#[allow(dead_code)]
346345
fn codegen_tail_call_terminator(
347346
&mut self,
348347
bx: &mut Bx,
349348
func: &mir::Operand<'tcx>,
350349
args: &[Spanned<mir::Operand<'tcx>>],
351350
fn_span: Span,
352-
) {
351+
mergeable_succ: bool,
352+
) -> MergingSucc {
353353
// We don't need source_info as we already have fn_span for diagnostics
354354
let func = self.codegen_operand(bx, func);
355355
let fn_ty = func.layout.ty;
@@ -433,6 +433,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
433433

434434
// Return the result - musttail requires ret immediately after the call
435435
bx.ret(llret);
436+
437+
assert_eq!(mergeable_succ, false);
438+
MergingSucc::False
436439
}
437440

438441
/// Generates code for a `Resume` terminator.
@@ -1483,12 +1486,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
14831486
fn_span,
14841487
mergeable_succ(),
14851488
),
1486-
mir::TerminatorKind::TailCall { .. } => {
1487-
// FIXME(explicit_tail_calls): implement tail calls in ssa backend
1488-
span_bug!(
1489-
terminator.source_info.span,
1490-
"`TailCall` terminator is not yet supported by `rustc_codegen_ssa`"
1491-
)
1489+
mir::TerminatorKind::TailCall { ref func, ref args, fn_span } => {
1490+
self.codegen_tail_call_terminator(bx, func, args, fn_span, mergeable_succ())
14921491
}
14931492
mir::TerminatorKind::CoroutineDrop | mir::TerminatorKind::Yield { .. } => {
14941493
bug!("coroutine ops in codegen")

0 commit comments

Comments
 (0)