(&self, w: &mut dyn Write)
| 41 | } |
| 42 | |
| 43 | fn block_nodes(&self, w: &mut dyn Write) -> Result { |
| 44 | let mut aliases = SecondaryMap::<_, Vec<_>>::new(); |
| 45 | for v in self.func.dfg.values() { |
| 46 | // VADFS returns the immediate target of an alias |
| 47 | if let Some(k) = self.func.dfg.value_alias_dest_for_serialization(v) { |
| 48 | aliases[k].push(v); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | for block in &self.func.layout { |
| 53 | write!(w, " {block} [shape=record, label=\"{{")?; |
| 54 | crate::write::write_block_header(w, self.func, block, 4)?; |
| 55 | // Add all outgoing branch instructions to the label. |
| 56 | if let Some(inst) = self.func.layout.last_inst(block) { |
| 57 | write!(w, " | <{inst}>")?; |
| 58 | PlainWriter.write_instruction(w, self.func, &aliases, inst, 0)?; |
| 59 | } |
| 60 | writeln!(w, "}}\"]")? |
| 61 | } |
| 62 | Ok(()) |
| 63 | } |
| 64 | |
| 65 | fn cfg_connections(&self, w: &mut dyn Write) -> Result { |
| 66 | for block in &self.func.layout { |
no test coverage detected