Remove deprecated LLVM-style inline assembly
This commit is contained in:
parent
72e74d7b9c
commit
000b36c505
68 changed files with 27 additions and 1132 deletions
|
@ -211,7 +211,6 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
|
||||
PlaceContext::MutatingUse(
|
||||
MutatingUseContext::Store
|
||||
| MutatingUseContext::LlvmAsmOutput
|
||||
| MutatingUseContext::AsmOutput
|
||||
| MutatingUseContext::Borrow
|
||||
| MutatingUseContext::AddressOf
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
use rustc_errors::struct_span_err;
|
||||
use rustc_middle::mir;
|
||||
|
||||
use super::FunctionCx;
|
||||
use super::LocalRef;
|
||||
use super::OperandValue;
|
||||
use crate::traits::BuilderMethods;
|
||||
use crate::traits::*;
|
||||
|
||||
|
@ -66,51 +64,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
}
|
||||
bx
|
||||
}
|
||||
mir::StatementKind::LlvmInlineAsm(ref asm) => {
|
||||
let outputs = asm
|
||||
.outputs
|
||||
.iter()
|
||||
.map(|output| self.codegen_place(&mut bx, output.as_ref()))
|
||||
.collect();
|
||||
|
||||
let input_vals = asm.inputs.iter().fold(
|
||||
Vec::with_capacity(asm.inputs.len()),
|
||||
|mut acc, (span, input)| {
|
||||
let op = self.codegen_operand(&mut bx, input);
|
||||
if let OperandValue::Immediate(_) = op.val {
|
||||
acc.push(op.immediate());
|
||||
} else {
|
||||
struct_span_err!(
|
||||
bx.sess(),
|
||||
span.to_owned(),
|
||||
E0669,
|
||||
"invalid value for constraint in inline assembly"
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
acc
|
||||
},
|
||||
);
|
||||
|
||||
if input_vals.len() == asm.inputs.len() {
|
||||
let res = bx.codegen_llvm_inline_asm(
|
||||
&asm.asm,
|
||||
outputs,
|
||||
input_vals,
|
||||
statement.source_info.span,
|
||||
);
|
||||
if !res {
|
||||
struct_span_err!(
|
||||
bx.sess(),
|
||||
statement.source_info.span,
|
||||
E0668,
|
||||
"malformed inline assembly"
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
bx
|
||||
}
|
||||
mir::StatementKind::Coverage(box ref coverage) => {
|
||||
self.codegen_coverage(&mut bx, coverage.clone(), statement.source_info.scope);
|
||||
bx
|
||||
|
|
|
@ -3,7 +3,6 @@ use crate::mir::operand::OperandRef;
|
|||
use crate::mir::place::PlaceRef;
|
||||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::LlvmInlineAsmInner;
|
||||
use rustc_middle::ty::Instance;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::asm::InlineAsmRegOrRegClass;
|
||||
|
@ -42,15 +41,6 @@ pub enum GlobalAsmOperandRef {
|
|||
}
|
||||
|
||||
pub trait AsmBuilderMethods<'tcx>: BackendTypes {
|
||||
/// Take an inline assembly expression and splat it out via LLVM
|
||||
fn codegen_llvm_inline_asm(
|
||||
&mut self,
|
||||
ia: &LlvmInlineAsmInner,
|
||||
outputs: Vec<PlaceRef<'tcx, Self::Value>>,
|
||||
inputs: Vec<Self::Value>,
|
||||
span: Span,
|
||||
) -> bool;
|
||||
|
||||
/// Take an inline assembly expression and splat it out via LLVM
|
||||
fn codegen_inline_asm(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue