Use PackedOption<Inst> in the Layout implementation.

This also revealed that the last_inst() method should return an Option.
This commit is contained in:
Jakob Stoklund Olesen
2017-01-19 14:26:47 -08:00
parent b8200d7be9
commit bdc0f53c91
2 changed files with 42 additions and 45 deletions

View File

@@ -110,7 +110,7 @@ impl<'a> Verifier<'a> {
fn ebb_integrity(&self, ebb: Ebb, inst: Inst) -> Result<()> {
let is_terminator = self.func.dfg[inst].opcode().is_terminator();
let is_last_inst = self.func.layout.last_inst(ebb) == inst;
let is_last_inst = self.func.layout.last_inst(ebb) == Some(inst);
if is_terminator && !is_last_inst {
// Terminating instructions only occur at the end of blocks.