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

Function gen_display

cranelift/codegen/meta/src/gen_settings.rs:364–384  ·  view source on GitHub ↗
(group: &SettingGroup, fmt: &mut Formatter)

Source from the content-addressed store, hash-verified

362}
363
364fn gen_display(group: &SettingGroup, fmt: &mut Formatter) {
365 fmt.add_block("impl fmt::Display for Flags", |fmt| {
366 fmt.add_block(
367 "fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result",
368 |fmt| {
369 fmtln!(fmt, "writeln!(f, \"[{}]\")?;", group.name);
370 fmt.add_block("for d in &DESCRIPTORS", |fmt| {
371 fmt.add_block("if !d.detail.is_preset()", |fmt| {
372 fmtln!(fmt, "write!(f, \"{{}} = \", d.name)?;");
373 fmtln!(
374 fmt,
375 "TEMPLATE.format_toml_value(d.detail, self.bytes[d.offset as usize], f)?;",
376 );
377 fmtln!(fmt, "writeln!(f)?;");
378 });
379 });
380 fmtln!(fmt, "Ok(())");
381 },
382 );
383 });
384}
385
386fn gen_hash_key(fmt: &mut Formatter) {
387 fmt.add_block("impl Flags", |fmt| {

Callers 1

gen_groupFunction · 0.85

Calls 1

add_blockMethod · 0.45

Tested by

no test coverage detected