(
formats: &[Rc<InstructionFormat>],
all_inst: &AllInstructions,
opcode_filename: &str,
inst_builder_filename: &str,
out_dir: &std::path::Path,
)
| 1484 | } |
| 1485 | |
| 1486 | pub(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 | } |
nothing calls this directly
no test coverage detected