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

Function generate

cranelift/codegen/meta/src/gen_inst.rs:1486–1511  ·  view source on GitHub ↗
(
    formats: &[Rc<InstructionFormat>],
    all_inst: &AllInstructions,
    opcode_filename: &str,
    inst_builder_filename: &str,
    out_dir: &std::path::Path,
)

Source from the content-addressed store, hash-verified

1484}
1485
1486pub(crate) fn generate(
1487 formats: &[Rc<InstructionFormat>],
1488 all_inst: &AllInstructions,
1489 opcode_filename: &str,
1490 inst_builder_filename: &str,
1491 out_dir: &std::path::Path,
1492) -> Result<(), error::Error> {
1493 // Opcodes.
1494 let mut fmt = Formatter::new(Language::Rust);
1495 gen_formats(&formats, &mut fmt);
1496 gen_instruction_data(&formats, &mut fmt);
1497 fmt.empty_line();
1498 gen_instruction_data_impl(&formats, &mut fmt);
1499 fmt.empty_line();
1500 gen_opcodes(all_inst, &mut fmt);
1501 fmt.empty_line();
1502 gen_type_constraints(all_inst, &mut fmt);
1503 fmt.write(opcode_filename, out_dir)?;
1504
1505 // Instruction builder.
1506 let mut fmt = Formatter::new(Language::Rust);
1507 gen_builder(all_inst, &formats, &mut fmt);
1508 fmt.write(inst_builder_filename, out_dir)?;
1509
1510 Ok(())
1511}

Callers

nothing calls this directly

Calls 10

gen_formatsFunction · 0.85
gen_instruction_dataFunction · 0.85
gen_opcodesFunction · 0.85
gen_type_constraintsFunction · 0.85
gen_builderFunction · 0.85
OkFunction · 0.85
empty_lineMethod · 0.80
newFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected