Removes debug assertion that was related to issue 796 (#6175)

* fix typo: behaviour -> behavior

* remove debug assertion since 796 has been merged

* Update data_value.rs
This commit is contained in:
kevaundray
2023-04-11 17:52:11 +01:00
committed by GitHub
parent 0478ead3f8
commit f2393b8f27

View File

@@ -635,28 +635,6 @@ impl<'c, 'f> ir::InstInserterBase<'c> for &'c mut FuncCursor<'f> {
} }
fn insert_built_inst(self, inst: ir::Inst) -> &'c mut ir::DataFlowGraph { fn insert_built_inst(self, inst: ir::Inst) -> &'c mut ir::DataFlowGraph {
// TODO: Remove this assertion once #796 is fixed.
#[cfg(debug_assertions)]
{
if let CursorPosition::At(_) = self.position() {
if let Some(curr) = self.current_inst() {
if let Some(prev) = self.layout().prev_inst(curr) {
let prev_op = self.data_flow_graph().insts[prev].opcode();
let inst_op = self.data_flow_graph().insts[inst].opcode();
let curr_op = self.data_flow_graph().insts[curr].opcode();
if prev_op.is_branch()
&& !prev_op.is_terminator()
&& !inst_op.is_terminator()
{
panic!(
"Inserting instruction {} after {}, and before {}",
inst_op, prev_op, curr_op
)
}
};
};
};
}
self.insert_inst(inst); self.insert_inst(inst);
if !self.srcloc.is_default() { if !self.srcloc.is_default() {
self.func.set_srcloc(inst, self.srcloc); self.func.set_srcloc(inst, self.srcloc);