various fixes for naked_asm!
implementation
- fix for divergence - fix error message - fix another cranelift test - fix some cranelift things - don't set the NORETURN option for naked asm - fix use of naked_asm! in doc comment - fix use of naked_asm! in run-make test - use `span_bug` in unreachable branch
This commit is contained in:
parent
10fa482906
commit
5fc60d1e52
29 changed files with 116 additions and 73 deletions
|
@ -3,7 +3,9 @@ use std::cmp;
|
|||
use rustc_ast as ast;
|
||||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_middle::mir::{self, AssertKind, BasicBlock, SwitchTargets, UnwindTerminateReason};
|
||||
use rustc_middle::mir::{
|
||||
self, AssertKind, BasicBlock, InlineAsmMacro, SwitchTargets, UnwindTerminateReason,
|
||||
};
|
||||
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, ValidityRequirement};
|
||||
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
|
||||
use rustc_middle::ty::{self, Instance, Ty};
|
||||
|
@ -1133,6 +1135,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
&mut self,
|
||||
helper: TerminatorCodegenHelper<'tcx>,
|
||||
bx: &mut Bx,
|
||||
asm_macro: InlineAsmMacro,
|
||||
terminator: &mir::Terminator<'tcx>,
|
||||
template: &[ast::InlineAsmTemplatePiece],
|
||||
operands: &[mir::InlineAsmOperand<'tcx>],
|
||||
|
@ -1203,11 +1206,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
&operands,
|
||||
options,
|
||||
line_spans,
|
||||
if options.contains(InlineAsmOptions::NORETURN) {
|
||||
None
|
||||
} else {
|
||||
targets.get(0).copied()
|
||||
},
|
||||
if asm_macro.diverges(options) { None } else { targets.get(0).copied() },
|
||||
unwind,
|
||||
instance,
|
||||
mergeable_succ,
|
||||
|
@ -1381,6 +1380,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
}
|
||||
|
||||
mir::TerminatorKind::InlineAsm {
|
||||
asm_macro,
|
||||
template,
|
||||
ref operands,
|
||||
options,
|
||||
|
@ -1390,6 +1390,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
} => self.codegen_asm_terminator(
|
||||
helper,
|
||||
bx,
|
||||
asm_macro,
|
||||
terminator,
|
||||
template,
|
||||
operands,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue