diff options
| author | bors <bors@rust-lang.org> | 2022-01-17 09:40:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-17 09:40:29 +0000 |
| commit | a34c0797528172ede89480e3033f7a5e71ea4735 (patch) | |
| tree | 2040a76ba69e7102179c469e0cc35a0884e628d7 /compiler/rustc_mir_build | |
| parent | 128417f40f80ce585414bf5a017540447e6be775 (diff) | |
| parent | b085eb0b107a2dc4f426811d000ca4ac82bb71b6 (diff) | |
| download | rust-a34c0797528172ede89480e3033f7a5e71ea4735.tar.gz rust-a34c0797528172ede89480e3033f7a5e71ea4735.zip | |
Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes #70173. Closes #92794. Closes #87612. Closes #82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
Diffstat (limited to 'compiler/rustc_mir_build')
7 files changed, 3 insertions, 47 deletions
diff --git a/compiler/rustc_mir_build/src/build/expr/as_place.rs b/compiler/rustc_mir_build/src/build/expr/as_place.rs index 2433a00232d..1e94c41d88d 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_place.rs @@ -569,7 +569,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::ConstBlock { .. } | ExprKind::StaticRef { .. } | ExprKind::InlineAsm { .. } - | ExprKind::LlvmInlineAsm { .. } | ExprKind::Yield { .. } | ExprKind::ThreadLocalRef(_) | ExprKind::Call { .. } => { diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 9a86d465f98..1dc49256a6a 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -350,7 +350,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::Continue { .. } | ExprKind::Return { .. } | ExprKind::InlineAsm { .. } - | ExprKind::LlvmInlineAsm { .. } | ExprKind::PlaceTypeAscription { .. } | ExprKind::ValueTypeAscription { .. } => { // these do not have corresponding `Rvalue` variants, diff --git a/compiler/rustc_mir_build/src/build/expr/category.rs b/compiler/rustc_mir_build/src/build/expr/category.rs index fcda52e5581..d31f6ed9384 100644 --- a/compiler/rustc_mir_build/src/build/expr/category.rs +++ b/compiler/rustc_mir_build/src/build/expr/category.rs @@ -67,8 +67,7 @@ impl Category { | ExprKind::Repeat { .. } | ExprKind::Assign { .. } | ExprKind::AssignOp { .. } - | ExprKind::ThreadLocalRef(_) - | ExprKind::LlvmInlineAsm { .. } => Some(Category::Rvalue(RvalueFunc::AsRvalue)), + | ExprKind::ThreadLocalRef(_) => Some(Category::Rvalue(RvalueFunc::AsRvalue)), ExprKind::ConstBlock { .. } | ExprKind::Literal { .. } | ExprKind::StaticRef { .. } => { Some(Category::Constant) diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs index d9896ff5ac9..43060ecfced 100644 --- a/compiler/rustc_mir_build/src/build/expr/into.rs +++ b/compiler/rustc_mir_build/src/build/expr/into.rs @@ -477,9 +477,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } // These cases don't actually need a destination - ExprKind::Assign { .. } - | ExprKind::AssignOp { .. } - | ExprKind::LlvmInlineAsm { .. } => { + ExprKind::Assign { .. } | ExprKind::AssignOp { .. } => { unpack!(block = this.stmt_expr(block, expr, None)); this.cfg.push_assign_unit(block, source_info, destination, this.tcx); block.unit() diff --git a/compiler/rustc_mir_build/src/build/expr/stmt.rs b/compiler/rustc_mir_build/src/build/expr/stmt.rs index 4245535450a..7419c5b2f75 100644 --- a/compiler/rustc_mir_build/src/build/expr/stmt.rs +++ b/compiler/rustc_mir_build/src/build/expr/stmt.rs @@ -101,38 +101,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { BreakableTarget::Return, source_info, ), - ExprKind::LlvmInlineAsm { asm, ref outputs, ref inputs } => { - debug!("stmt_expr LlvmInlineAsm block_context.push(SubExpr) : {:?}", expr); - this.block_context.push(BlockFrame::SubExpr); - let outputs = outputs - .into_iter() - .copied() - .map(|output| unpack!(block = this.as_place(block, &this.thir[output]))) - .collect::<Vec<_>>() - .into_boxed_slice(); - let inputs = inputs - .into_iter() - .copied() - .map(|input| { - let input = &this.thir[input]; - (input.span, unpack!(block = this.as_local_operand(block, &input))) - }) - .collect::<Vec<_>>() - .into_boxed_slice(); - this.cfg.push( - block, - Statement { - source_info, - kind: StatementKind::LlvmInlineAsm(Box::new(LlvmInlineAsm { - asm: asm.clone(), - outputs, - inputs, - })), - }, - ); - this.block_context.pop(); - block.unit() - } _ => { assert!( statement_scope.is_some(), diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index 7940bd1f33d..8ca2449cea9 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -329,7 +329,6 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { | ExprKind::Box { .. } | ExprKind::If { .. } | ExprKind::InlineAsm { .. } - | ExprKind::LlvmInlineAsm { .. } | ExprKind::LogicalOp { .. } | ExprKind::Use { .. } => { // We don't need to save the old value and restore it @@ -377,7 +376,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { self.requires_unsafe(expr.span, DerefOfRawPointer); } } - ExprKind::InlineAsm { .. } | ExprKind::LlvmInlineAsm { .. } => { + ExprKind::InlineAsm { .. } => { self.requires_unsafe(expr.span, UseOfInlineAssembly); } ExprKind::Adt(box Adt { diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index c62de154388..750677f161e 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -570,12 +570,6 @@ impl<'tcx> Cx<'tcx> { line_spans: asm.line_spans, }, - hir::ExprKind::LlvmInlineAsm(ref asm) => ExprKind::LlvmInlineAsm { - asm: &asm.inner, - outputs: self.mirror_exprs(asm.outputs_exprs), - inputs: self.mirror_exprs(asm.inputs_exprs), - }, - hir::ExprKind::ConstBlock(ref anon_const) => { let anon_const_def_id = self.tcx.hir().local_def_id(anon_const.hir_id); let value = ty::Const::from_inline_const(self.tcx, anon_const_def_id); |
