Merge branch 'sync_from_rust'
This commit is contained in:
commit
77dae8c881
16
src/base.rs
16
src/base.rs
@ -445,7 +445,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
|
|||||||
template,
|
template,
|
||||||
operands,
|
operands,
|
||||||
options,
|
options,
|
||||||
destination,
|
targets,
|
||||||
line_spans: _,
|
line_spans: _,
|
||||||
unwind: _,
|
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(
|
crate::inline_asm::codegen_inline_asm_terminator(
|
||||||
fx,
|
fx,
|
||||||
source_info.span,
|
source_info.span,
|
||||||
template,
|
template,
|
||||||
operands,
|
operands,
|
||||||
*options,
|
*options,
|
||||||
*destination,
|
targets.get(0).copied(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
TerminatorKind::UnwindTerminate(reason) => {
|
TerminatorKind::UnwindTerminate(reason) => {
|
||||||
|
@ -78,7 +78,8 @@ pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String,
|
|||||||
InlineAsmOperand::In { .. }
|
InlineAsmOperand::In { .. }
|
||||||
| InlineAsmOperand::Out { .. }
|
| InlineAsmOperand::Out { .. }
|
||||||
| InlineAsmOperand::InOut { .. }
|
| InlineAsmOperand::InOut { .. }
|
||||||
| InlineAsmOperand::SplitInOut { .. } => {
|
| InlineAsmOperand::SplitInOut { .. }
|
||||||
|
| InlineAsmOperand::Label { .. } => {
|
||||||
span_bug!(op_sp, "invalid operand type for global_asm!")
|
span_bug!(op_sp, "invalid operand type for global_asm!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,9 @@ pub(crate) fn codegen_inline_asm_terminator<'tcx>(
|
|||||||
let instance = Instance::mono(fx.tcx, def_id).polymorphize(fx.tcx);
|
let instance = Instance::mono(fx.tcx, def_id).polymorphize(fx.tcx);
|
||||||
CInlineAsmOperand::Symbol { symbol: fx.tcx.symbol_name(instance).name.to_owned() }
|
CInlineAsmOperand::Symbol { symbol: fx.tcx.symbol_name(instance).name.to_owned() }
|
||||||
}
|
}
|
||||||
|
InlineAsmOperand::Label { .. } => {
|
||||||
|
span_bug!(span, "asm! label operands are not yet supported");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user