Remove deprecated LLVM-style inline assembly
This commit is contained in:
parent
72e74d7b9c
commit
000b36c505
68 changed files with 27 additions and 1132 deletions
|
@ -1266,7 +1266,7 @@ impl Expr {
|
|||
ExprKind::Break(..) => ExprPrecedence::Break,
|
||||
ExprKind::Continue(..) => ExprPrecedence::Continue,
|
||||
ExprKind::Ret(..) => ExprPrecedence::Ret,
|
||||
ExprKind::InlineAsm(..) | ExprKind::LlvmInlineAsm(..) => ExprPrecedence::InlineAsm,
|
||||
ExprKind::InlineAsm(..) => ExprPrecedence::InlineAsm,
|
||||
ExprKind::MacCall(..) => ExprPrecedence::Mac,
|
||||
ExprKind::Struct(..) => ExprPrecedence::Struct,
|
||||
ExprKind::Repeat(..) => ExprPrecedence::Repeat,
|
||||
|
@ -1423,8 +1423,6 @@ pub enum ExprKind {
|
|||
|
||||
/// Output of the `asm!()` macro.
|
||||
InlineAsm(P<InlineAsm>),
|
||||
/// Output of the `llvm_asm!()` macro.
|
||||
LlvmInlineAsm(P<LlvmInlineAsm>),
|
||||
|
||||
/// A macro invocation; pre-expansion.
|
||||
MacCall(MacCall),
|
||||
|
@ -2076,41 +2074,6 @@ pub struct InlineAsm {
|
|||
pub line_spans: Vec<Span>,
|
||||
}
|
||||
|
||||
/// Inline assembly dialect.
|
||||
///
|
||||
/// E.g., `"intel"` as in `llvm_asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`.
|
||||
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, Copy, Hash, HashStable_Generic)]
|
||||
pub enum LlvmAsmDialect {
|
||||
Att,
|
||||
Intel,
|
||||
}
|
||||
|
||||
/// LLVM-style inline assembly.
|
||||
///
|
||||
/// E.g., `"={eax}"(result)` as in `llvm_asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`.
|
||||
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||
pub struct LlvmInlineAsmOutput {
|
||||
pub constraint: Symbol,
|
||||
pub expr: P<Expr>,
|
||||
pub is_rw: bool,
|
||||
pub is_indirect: bool,
|
||||
}
|
||||
|
||||
/// LLVM-style inline assembly.
|
||||
///
|
||||
/// E.g., `llvm_asm!("NOP");`.
|
||||
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||
pub struct LlvmInlineAsm {
|
||||
pub asm: Symbol,
|
||||
pub asm_str_style: StrStyle,
|
||||
pub outputs: Vec<LlvmInlineAsmOutput>,
|
||||
pub inputs: Vec<(Symbol, P<Expr>)>,
|
||||
pub clobbers: Vec<Symbol>,
|
||||
pub volatile: bool,
|
||||
pub alignstack: bool,
|
||||
pub dialect: LlvmAsmDialect,
|
||||
}
|
||||
|
||||
/// A parameter in a function header.
|
||||
///
|
||||
/// E.g., `bar: usize` as in `fn foo(bar: usize)`.
|
||||
|
|
|
@ -1350,23 +1350,6 @@ pub fn noop_visit_expr<T: MutVisitor>(
|
|||
visit_opt(expr, |expr| vis.visit_expr(expr));
|
||||
}
|
||||
ExprKind::InlineAsm(asm) => noop_visit_inline_asm(asm, vis),
|
||||
ExprKind::LlvmInlineAsm(asm) => {
|
||||
let LlvmInlineAsm {
|
||||
asm: _,
|
||||
asm_str_style: _,
|
||||
outputs,
|
||||
inputs,
|
||||
clobbers: _,
|
||||
volatile: _,
|
||||
alignstack: _,
|
||||
dialect: _,
|
||||
} = asm.deref_mut();
|
||||
for out in outputs {
|
||||
let LlvmInlineAsmOutput { constraint: _, expr, is_rw: _, is_indirect: _ } = out;
|
||||
vis.visit_expr(expr);
|
||||
}
|
||||
visit_vec(inputs, |(_c, expr)| vis.visit_expr(expr));
|
||||
}
|
||||
ExprKind::MacCall(mac) => vis.visit_mac_call(mac),
|
||||
ExprKind::Struct(se) => {
|
||||
let StructExpr { qself, path, fields, rest } = se.deref_mut();
|
||||
|
|
|
@ -864,14 +864,6 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
|
|||
ExprKind::MacCall(ref mac) => visitor.visit_mac_call(mac),
|
||||
ExprKind::Paren(ref subexpression) => visitor.visit_expr(subexpression),
|
||||
ExprKind::InlineAsm(ref asm) => walk_inline_asm(visitor, asm),
|
||||
ExprKind::LlvmInlineAsm(ref ia) => {
|
||||
for &(_, ref input) in &ia.inputs {
|
||||
visitor.visit_expr(input)
|
||||
}
|
||||
for output in &ia.outputs {
|
||||
visitor.visit_expr(&output.expr)
|
||||
}
|
||||
}
|
||||
ExprKind::Yield(ref optional_expression) => {
|
||||
walk_list!(visitor, visit_expr, optional_expression);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue