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

Function decorate_function

cranelift/codegen/src/write.rs:177–195  ·  view source on GitHub ↗

Writes `func` to `w` as text. write_function_plain is passed as 'closure' to print instructions as text. pretty_function_error is passed as 'closure' to add error decoration.

(
    func_w: &mut FW,
    w: &mut dyn Write,
    func: &Function,
)

Source from the content-addressed store, hash-verified

175/// write_function_plain is passed as 'closure' to print instructions as text.
176/// pretty_function_error is passed as 'closure' to add error decoration.
177pub fn decorate_function<FW: FuncWriter>(
178 func_w: &mut FW,
179 w: &mut dyn Write,
180 func: &Function,
181) -> fmt::Result {
182 write!(w, "function ")?;
183 write_function_spec(w, func)?;
184 writeln!(w, " {{")?;
185 let aliases = alias_map(func);
186 let mut any = func_w.write_preamble(w, func)?;
187 for block in &func.layout {
188 if any {
189 writeln!(w)?;
190 }
191 decorate_block(func_w, w, func, &aliases, block)?;
192 any = true;
193 }
194 writeln!(w, "}}")
195}
196
197//----------------------------------------------------------------------
198//

Callers 2

write_functionFunction · 0.85
pretty_verifier_errorFunction · 0.85

Calls 4

write_function_specFunction · 0.85
alias_mapFunction · 0.85
decorate_blockFunction · 0.85
write_preambleMethod · 0.80

Tested by

no test coverage detected