Add asm label support to THIR
This commit is contained in:
parent
93fa8579c6
commit
040ab7d4b6
@ -565,6 +565,9 @@ pub enum InlineAsmOperand<'tcx> {
|
|||||||
SymStatic {
|
SymStatic {
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
},
|
},
|
||||||
|
Label {
|
||||||
|
block: BlockId,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, HashStable)]
|
#[derive(Copy, Clone, Debug, PartialEq, HashStable)]
|
||||||
|
@ -162,6 +162,7 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
|
|||||||
| Const { value: _, span: _ }
|
| Const { value: _, span: _ }
|
||||||
| SymFn { value: _, span: _ }
|
| SymFn { value: _, span: _ }
|
||||||
| SymStatic { def_id: _ } => {}
|
| SymStatic { def_id: _ } => {}
|
||||||
|
Label { block } => visitor.visit_block(&visitor.thir()[*block]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,6 +455,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
thir::InlineAsmOperand::SymStatic { def_id } => {
|
thir::InlineAsmOperand::SymStatic { def_id } => {
|
||||||
mir::InlineAsmOperand::SymStatic { def_id }
|
mir::InlineAsmOperand::SymStatic { def_id }
|
||||||
}
|
}
|
||||||
|
thir::InlineAsmOperand::Label { .. } => {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
@ -656,8 +656,8 @@ impl<'tcx> Cx<'tcx> {
|
|||||||
hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
|
hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
|
||||||
InlineAsmOperand::SymStatic { def_id }
|
InlineAsmOperand::SymStatic { def_id }
|
||||||
}
|
}
|
||||||
hir::InlineAsmOperand::Label { .. } => {
|
hir::InlineAsmOperand::Label { block } => {
|
||||||
todo!()
|
InlineAsmOperand::Label { block: self.mirror_block(block) }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
@ -889,6 +889,12 @@ impl<'a, 'tcx> ThirPrinter<'a, 'tcx> {
|
|||||||
print_indented!(self, format!("def_id: {:?}", def_id), depth_lvl + 1);
|
print_indented!(self, format!("def_id: {:?}", def_id), depth_lvl + 1);
|
||||||
print_indented!(self, "}", depth_lvl + 1);
|
print_indented!(self, "}", depth_lvl + 1);
|
||||||
}
|
}
|
||||||
|
InlineAsmOperand::Label { block } => {
|
||||||
|
print_indented!(self, "InlineAsmOperand::Block {", depth_lvl);
|
||||||
|
print_indented!(self, "block:", depth_lvl + 1);
|
||||||
|
self.print_block(*block, depth_lvl + 2);
|
||||||
|
print_indented!(self, "}", depth_lvl + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user