Removed the Opcode::NotAnOpcode variant, replaced its uses with Option<Opcode>, and used the NonZero optimization to maintain the small 1-byte size of an optional Opcode.

This commit is contained in:
Angus Holder
2017-02-22 16:13:48 +00:00
committed by Jakob Stoklund Olesen
parent 855c429d31
commit e002011602
6 changed files with 30 additions and 32 deletions

View File

@@ -149,7 +149,7 @@ impl<'a> Verifier<'a> {
let inst_data = &self.func.dfg[inst];
// The instruction format matches the opcode
if inst_data.opcode().format() != Some(InstructionFormat::from(inst_data)) {
if inst_data.opcode().format() != InstructionFormat::from(inst_data) {
return err!(inst, "instruction opcode doesn't match instruction format");
}