cranelift: Print error message when basic blocks are invalid (#4591)
This commit is contained in:
@@ -619,9 +619,12 @@ impl<'a> FunctionBuilder<'a> {
|
|||||||
{
|
{
|
||||||
// Iterate manually to provide more helpful error messages.
|
// Iterate manually to provide more helpful error messages.
|
||||||
for block in self.func_ctx.blocks.keys() {
|
for block in self.func_ctx.blocks.keys() {
|
||||||
if let Err((inst, _msg)) = self.func.is_block_basic(block) {
|
if let Err((inst, msg)) = self.func.is_block_basic(block) {
|
||||||
let inst_str = self.func.dfg.display_inst(inst);
|
let inst_str = self.func.dfg.display_inst(inst);
|
||||||
panic!("{} failed basic block invariants on {}", block, inst_str);
|
panic!(
|
||||||
|
"{} failed basic block invariants on {}: {}",
|
||||||
|
block, inst_str, msg
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user