[meta] Remove name lookups in formats;
This does a lot at once, since there was no clear way to split the three commits: - Instruction need to be passed an explicit InstructionFormat, - InstructionFormat deduplication is checked once all entities have been defined;
This commit is contained in:
@@ -465,14 +465,15 @@ impl TransformGroups {
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_double_custom_legalization() {
|
||||
use crate::cdsl::formats::{FormatRegistry, InstructionFormatBuilder};
|
||||
use crate::cdsl::formats::InstructionFormatBuilder;
|
||||
use crate::cdsl::instructions::{AllInstructions, InstructionBuilder, InstructionGroupBuilder};
|
||||
|
||||
let nullary = InstructionFormatBuilder::new("nullary").build();
|
||||
|
||||
let mut dummy_all = AllInstructions::new();
|
||||
let mut format = FormatRegistry::new();
|
||||
format.insert(InstructionFormatBuilder::new("nullary"));
|
||||
let mut inst_group = InstructionGroupBuilder::new(&mut dummy_all, &format);
|
||||
inst_group.push(InstructionBuilder::new("dummy", "doc"));
|
||||
let mut inst_group = InstructionGroupBuilder::new(&mut dummy_all);
|
||||
inst_group.push(InstructionBuilder::new("dummy", "doc", &nullary));
|
||||
|
||||
let inst_group = inst_group.build();
|
||||
let dummy_inst = inst_group.by_name("dummy");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user