Add block names to irreducible-control-flow error
This commit is contained in:
parent
f17164f56f
commit
ec2a999359
|
@ -129,7 +129,13 @@ impl<'a, 'b> Context<'a, 'b> {
|
||||||
log::trace!(" -> succ rpo {}", succ_rpo);
|
log::trace!(" -> succ rpo {}", succ_rpo);
|
||||||
if succ_rpo <= block_rpo {
|
if succ_rpo <= block_rpo {
|
||||||
if !cfg.dominates(succ, block) {
|
if !cfg.dominates(succ, block) {
|
||||||
anyhow::bail!("Irreducible control flow: edge from {} to {}", block, succ);
|
anyhow::bail!(
|
||||||
|
"Irreducible control flow: edge from {} ({}) to {} ({})",
|
||||||
|
block,
|
||||||
|
body.blocks[block].desc,
|
||||||
|
succ,
|
||||||
|
body.blocks[succ].desc
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// Backward branch.
|
// Backward branch.
|
||||||
loop_headers.insert(succ);
|
loop_headers.insert(succ);
|
||||||
|
|
Loading…
Reference in a new issue