Debug output for Operands: omit default/most common positions.
This commit is contained in:
13
src/lib.rs
13
src/lib.rs
@@ -403,11 +403,18 @@ impl std::fmt::Debug for Operand {
|
|||||||
|
|
||||||
impl std::fmt::Display for Operand {
|
impl std::fmt::Display for Operand {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
match (self.kind(), self.pos()) {
|
||||||
|
(OperandKind::Def, OperandPos::After)
|
||||||
|
| (OperandKind::Mod | OperandKind::Use, OperandPos::Before) => {
|
||||||
|
write!(f, "{:?}", self.kind())?;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
write!(f, "{:?}@{:?}", self.kind(), self.pos())?;
|
||||||
|
}
|
||||||
|
}
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{:?}@{:?}: {}{} {}",
|
": {}{} {}",
|
||||||
self.kind(),
|
|
||||||
self.pos(),
|
|
||||||
self.vreg(),
|
self.vreg(),
|
||||||
match self.class() {
|
match self.class() {
|
||||||
RegClass::Int => "i",
|
RegClass::Int => "i",
|
||||||
|
|||||||
Reference in New Issue
Block a user