MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / block_nodes

Method block_nodes

cranelift/codegen/src/cfg_printer.rs:43–63  ·  view source on GitHub ↗
(&self, w: &mut dyn Write)

Source from the content-addressed store, hash-verified

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 {

Callers 1

writeMethod · 0.80

Calls 8

write_block_headerFunction · 0.85
OkFunction · 0.85
last_instMethod · 0.80
newFunction · 0.50
valuesMethod · 0.45
pushMethod · 0.45
write_instructionMethod · 0.45

Tested by

no test coverage detected