better vcode printing
This commit is contained in:
@@ -758,6 +758,7 @@ impl<I: VCodeInst> VCode<I> {
|
||||
{
|
||||
// To write into disasm string.
|
||||
use core::fmt::Write;
|
||||
let want_disasm = true;
|
||||
|
||||
let _tt = timing::vcode_emit();
|
||||
let mut buffer = MachBuffer::new();
|
||||
@@ -1323,12 +1324,39 @@ impl<I: VCodeInst> fmt::Debug for VCode<I> {
|
||||
|
||||
for block in 0..self.num_blocks() {
|
||||
let block = BlockIndex::new(block);
|
||||
writeln!(f, "Block {}:", block.index())?;
|
||||
write!(f, "Block {}(", block.index())?;
|
||||
{
|
||||
let mut first = true;
|
||||
for vreg in self.block_params(block) {
|
||||
if !first {
|
||||
write!(f, ", ")?;
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
write!(f, "{}", vreg)?;
|
||||
}
|
||||
}
|
||||
writeln!(f, "):")?;
|
||||
if let Some(bb) = self.bindex_to_bb(block) {
|
||||
writeln!(f, " (original IR block: {})", bb)?;
|
||||
}
|
||||
for succ in self.succs(block) {
|
||||
writeln!(f, " (successor: Block {})", succ.index())?;
|
||||
for (i, succ) in self.succs(block).iter().enumerate() {
|
||||
let last_inst = self.block_insns(block).last();
|
||||
if self.is_branch(last_inst) {
|
||||
write!(f, " (successor: Block {}(", succ.index())?;
|
||||
let mut first = true;
|
||||
for vreg in self.branch_blockparams(block, last_inst, i) {
|
||||
if !first {
|
||||
write!(f, ", ")?;
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
write!(f, "{}", vreg)?;
|
||||
}
|
||||
writeln!(f, "))")?;
|
||||
} else {
|
||||
write!(f, " (successor: Block {})", succ.index())?;
|
||||
}
|
||||
}
|
||||
let (start, end) = self.block_ranges[block.index()];
|
||||
writeln!(
|
||||
|
||||
Reference in New Issue
Block a user