basic_block: Add inst address and use count to DumpBlock
This additional output assists with debugging.
This commit is contained in:
parent
c6d09adcb7
commit
5d72f7048f
1 changed files with 3 additions and 0 deletions
|
@ -172,6 +172,7 @@ std::string DumpBlock(const IR::Block& block) {
|
||||||
for (const auto& inst : block) {
|
for (const auto& inst : block) {
|
||||||
const Opcode op = inst.GetOpcode();
|
const Opcode op = inst.GetOpcode();
|
||||||
|
|
||||||
|
ret += fmt::format("[{:016x}] ", reinterpret_cast<u64>(&inst));
|
||||||
if (GetTypeOf(op) != Type::Void) {
|
if (GetTypeOf(op) != Type::Void) {
|
||||||
ret += fmt::format("%{:<5} = ", index);
|
ret += fmt::format("%{:<5} = ", index);
|
||||||
} else {
|
} else {
|
||||||
|
@ -194,6 +195,8 @@ std::string DumpBlock(const IR::Block& block) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret += fmt::format(" (uses: {})", inst.UseCount());
|
||||||
|
|
||||||
ret += '\n';
|
ret += '\n';
|
||||||
inst_to_index[&inst] = index++;
|
inst_to_index[&inst] = index++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue