pub fn write_block_header(
    w: &mut dyn Write,
    func: &Function,
    block: Block,
    indent: usize
) -> Result
Expand description

Write out the basic block header, outdented:

block1: block1(v1: i32): block10(v4: f64, v5: b1):

Examples found in repository?
src/write.rs (line 157)
150
151
152
153
154
155
156
157
158
    fn write_block_header(
        &mut self,
        w: &mut dyn Write,
        func: &Function,
        block: Block,
        indent: usize,
    ) -> fmt::Result {
        write_block_header(w, func, block, indent)
    }
More examples
Hide additional examples
src/cfg_printer.rs (line 54)
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    fn block_nodes(&self, w: &mut dyn Write) -> Result {
        let mut aliases = SecondaryMap::<_, Vec<_>>::new();
        for v in self.func.dfg.values() {
            // VADFS returns the immediate target of an alias
            if let Some(k) = self.func.dfg.value_alias_dest_for_serialization(v) {
                aliases[k].push(v);
            }
        }

        for block in &self.func.layout {
            write!(w, "    {} [shape=record, label=\"{{", block)?;
            crate::write::write_block_header(w, self.func, block, 4)?;
            // Add all outgoing branch instructions to the label.
            for inst in self.func.layout.block_likely_branches(block) {
                write!(w, " | <{}>", inst)?;
                PlainWriter.write_instruction(w, self.func, &aliases, inst, 0)?;
            }
            writeln!(w, "}}\"]")?
        }
        Ok(())
    }