From 5d72f7048f4a5f38dea4a7e8b56e600c48cf7ecb Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 27 Nov 2017 19:35:12 +0000 Subject: [PATCH] basic_block: Add inst address and use count to DumpBlock This additional output assists with debugging. --- src/frontend/ir/basic_block.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/ir/basic_block.cpp b/src/frontend/ir/basic_block.cpp index 2219262b..1dc78d7f 100644 --- a/src/frontend/ir/basic_block.cpp +++ b/src/frontend/ir/basic_block.cpp @@ -172,6 +172,7 @@ std::string DumpBlock(const IR::Block& block) { for (const auto& inst : block) { const Opcode op = inst.GetOpcode(); + ret += fmt::format("[{:016x}] ", reinterpret_cast(&inst)); if (GetTypeOf(op) != Type::Void) { ret += fmt::format("%{:<5} = ", index); } else { @@ -194,6 +195,8 @@ std::string DumpBlock(const IR::Block& block) { } } + ret += fmt::format(" (uses: {})", inst.UseCount()); + ret += '\n'; inst_to_index[&inst] = index++; }