(&self, f: &mut fmt::Formatter)
| 1433 | |
| 1434 | impl<'a> fmt::Display for DisplayInst<'a> { |
| 1435 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 1436 | let dfg = self.0; |
| 1437 | let inst = self.1; |
| 1438 | |
| 1439 | if let Some((first, rest)) = dfg.inst_results(inst).split_first() { |
| 1440 | write!(f, "{first}")?; |
| 1441 | for v in rest { |
| 1442 | write!(f, ", {v}")?; |
| 1443 | } |
| 1444 | write!(f, " = ")?; |
| 1445 | } |
| 1446 | |
| 1447 | let typevar = dfg.ctrl_typevar(inst); |
| 1448 | if typevar.is_invalid() { |
| 1449 | write!(f, "{}", dfg.insts[inst].opcode())?; |
| 1450 | } else { |
| 1451 | write!(f, "{}.{}", dfg.insts[inst].opcode(), typevar)?; |
| 1452 | } |
| 1453 | write_operands(f, dfg, inst) |
| 1454 | } |
| 1455 | } |
| 1456 | |
| 1457 | /// Parser routines. These routines should not be used outside the parser. |
nothing calls this directly
no test coverage detected