diff options
| author | Gary Guo <gary@garyguo.net> | 2023-12-26 15:28:42 +0000 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2024-02-24 18:50:09 +0000 |
| commit | b044aaa905f8a97e67ea72b490ee46d6420c4680 (patch) | |
| tree | 8295ee7af568898a8a2da15d9710dab5c44b3480 /compiler/rustc_codegen_cranelift/src/base.rs | |
| parent | 7152993aa859819d67b9f01e41e1f389e52043de (diff) | |
| download | rust-b044aaa905f8a97e67ea72b490ee46d6420c4680.tar.gz rust-b044aaa905f8a97e67ea72b490ee46d6420c4680.zip | |
Change InlineAsm to allow multiple targets instead
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/base.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/base.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs index a7e76fbc128..1ce920f3bdb 100644 --- a/compiler/rustc_codegen_cranelift/src/base.rs +++ b/compiler/rustc_codegen_cranelift/src/base.rs @@ -445,7 +445,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) { template, operands, options, - destination, + targets, line_spans: _, unwind: _, } => { @@ -456,13 +456,25 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) { ); } + let have_labels = if options.contains(InlineAsmOptions::NORETURN) { + !targets.is_empty() + } else { + targets.len() > 1 + }; + if have_labels { + fx.tcx.dcx().span_fatal( + source_info.span, + "cranelift doesn't support labels in inline assembly.", + ); + } + crate::inline_asm::codegen_inline_asm_terminator( fx, source_info.span, template, operands, *options, - *destination, + targets.get(0).copied(), ); } TerminatorKind::UnwindTerminate(reason) => { |
