Skip to content

Commit 98dcd85

Browse files
committed
Change InlineAsm to allow multiple targets instead
1 parent ac8c8b6 commit 98dcd85

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/base.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
445445
template,
446446
operands,
447447
options,
448-
destination,
448+
targets,
449449
line_spans: _,
450450
unwind: _,
451451
} => {
@@ -456,13 +456,25 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
456456
);
457457
}
458458

459+
let have_labels = if options.contains(InlineAsmOptions::NORETURN) {
460+
!targets.is_empty()
461+
} else {
462+
targets.len() > 1
463+
};
464+
if have_labels {
465+
fx.tcx.dcx().span_fatal(
466+
source_info.span,
467+
"cranelift doesn't support labels in inline assembly.",
468+
);
469+
}
470+
459471
crate::inline_asm::codegen_inline_asm_terminator(
460472
fx,
461473
source_info.span,
462474
template,
463475
operands,
464476
*options,
465-
*destination,
477+
targets.get(0).copied(),
466478
);
467479
}
468480
TerminatorKind::UnwindTerminate(reason) => {

0 commit comments

Comments
 (0)