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

Function decorate_block

cranelift/codegen/src/write.rs:252–276  ·  view source on GitHub ↗
(
    func_w: &mut FW,
    w: &mut dyn Write,
    func: &Function,
    aliases: &SecondaryMap<Value, Vec<Value>>,
    block: Block,
)

Source from the content-addressed store, hash-verified

250}
251
252fn decorate_block<FW: FuncWriter>(
253 func_w: &mut FW,
254 w: &mut dyn Write,
255 func: &Function,
256 aliases: &SecondaryMap<Value, Vec<Value>>,
257 block: Block,
258) -> fmt::Result {
259 // Indent all instructions if any srclocs or debug tags are present.
260 let indent = if func.rel_srclocs().is_empty() && func.debug_tags.is_empty() {
261 4
262 } else {
263 36
264 };
265
266 func_w.write_block_header(w, func, block, indent)?;
267 for a in func.dfg.block_params(block).iter().cloned() {
268 write_value_aliases(w, aliases, a, indent)?;
269 }
270
271 for inst in func.layout.block_insts(block) {
272 func_w.write_instruction(w, func, aliases, inst, indent)?;
273 }
274
275 Ok(())
276}
277
278//----------------------------------------------------------------------
279//

Callers 1

decorate_functionFunction · 0.85

Calls 9

write_value_aliasesFunction · 0.85
OkFunction · 0.85
rel_srclocsMethod · 0.80
block_instsMethod · 0.80
is_emptyMethod · 0.45
write_block_headerMethod · 0.45
iterMethod · 0.45
block_paramsMethod · 0.45
write_instructionMethod · 0.45

Tested by

no test coverage detected