1
Fork 0

Retain assembly operands span when lowering AST to HIR

This commit is contained in:
Tomasz Miąsko 2020-11-27 00:00:00 +00:00
parent 0f6f2d681b
commit 91fe548825
13 changed files with 18 additions and 20 deletions

View file

@ -347,7 +347,7 @@ impl ExprVisitor<'tcx> {
}
fn check_asm(&self, asm: &hir::InlineAsm<'tcx>) {
for (idx, op) in asm.operands.iter().enumerate() {
for (idx, (op, _op_sp)) in asm.operands.iter().enumerate() {
match *op {
hir::InlineAsmOperand::In { reg, ref expr } => {
self.check_asm_operand_type(idx, reg, expr, asm.template, None);

View file

@ -1174,7 +1174,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
};
// Do a first pass for writing outputs only
for op in asm.operands.iter().rev() {
for (op, _op_sp) in asm.operands.iter().rev() {
match op {
hir::InlineAsmOperand::In { .. }
| hir::InlineAsmOperand::Const { .. }
@ -1197,7 +1197,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
// Then do a second pass for inputs
let mut succ = succ;
for op in asm.operands.iter().rev() {
for (op, _op_sp) in asm.operands.iter().rev() {
match op {
hir::InlineAsmOperand::In { expr, .. }
| hir::InlineAsmOperand::Const { expr, .. }
@ -1454,7 +1454,7 @@ fn check_expr<'tcx>(this: &mut Liveness<'_, 'tcx>, expr: &'tcx Expr<'tcx>) {
}
hir::ExprKind::InlineAsm(ref asm) => {
for op in asm.operands {
for (op, _op_sp) in asm.operands {
match op {
hir::InlineAsmOperand::Out { expr, .. } => {
if let Some(expr) = expr {