Add assertions to check that postopt encoding succeeds.

This commit is contained in:
Dan Gohman
2018-05-17 14:19:42 -07:00
parent e9d362d902
commit 923ea8ada9

View File

@@ -169,8 +169,10 @@ fn optimize_cpu_flags(
);
}
}
pos.func.update_encoding(info.cmp_inst, isa).is_ok();
pos.func.update_encoding(info.br_inst, isa).is_ok();
let ok = pos.func.update_encoding(info.cmp_inst, isa).is_ok();
debug_assert!(ok);
let ok = pos.func.update_encoding(info.br_inst, isa).is_ok();
debug_assert!(ok);
}
@@ -320,7 +322,8 @@ fn optimize_complex_addresses(pos: &mut EncCursor, inst: Inst, isa: &TargetIsa)
}
_ => return,
}
pos.func.update_encoding(info.inst, isa).is_ok();
let ok = pos.func.update_encoding(info.inst, isa).is_ok();
debug_assert!(ok);
}