Move generate_table from cranelift-codegen-shared to cranelift-codegen-meta

This commit is contained in:
bjorn3
2021-10-27 13:23:29 +02:00
parent 49133f62e6
commit 91d4f36970
5 changed files with 73 additions and 66 deletions

View File

@@ -553,9 +553,10 @@ fn gen_opcodes(all_inst: &AllInstructions, fmt: &mut Formatter) {
fmt.empty_line();
// Generate an opcode hash table for looking up opcodes by name.
let hash_table = constant_hash::generate_table(all_inst.iter(), all_inst.len(), |inst| {
constant_hash::simple_hash(&inst.name)
});
let hash_table =
crate::constant_hash::generate_table(all_inst.iter(), all_inst.len(), |inst| {
constant_hash::simple_hash(&inst.name)
});
fmtln!(
fmt,
"const OPCODE_HASH_TABLE: [Option<Opcode>; {}] = [",