diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-12 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-12 18:51:31 +0100 |
| commit | 000b36c505a8865322c376486791cdee8f38d0c5 (patch) | |
| tree | 3efb3d84c08ebe0f3d2e43eeeac59dbc5f79b0b2 /compiler/rustc_ast | |
| parent | 72e74d7b9cf1a7901650227e74650f1fcc797600 (diff) | |
| download | rust-000b36c505a8865322c376486791cdee8f38d0c5.tar.gz rust-000b36c505a8865322c376486791cdee8f38d0c5.zip | |
Remove deprecated LLVM-style inline assembly
Diffstat (limited to 'compiler/rustc_ast')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 39 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/mut_visit.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/visit.rs | 8 |
3 files changed, 1 insertions, 63 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index a2d32cdc00f..079b9e43373 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -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)`. diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 9ef78aaf667..564a8a8c872 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -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(); diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs index 6840f092da6..0b95270a4e1 100644 --- a/compiler/rustc_ast/src/visit.rs +++ b/compiler/rustc_ast/src/visit.rs @@ -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); } |
