chore(ir): dump formatını sade yap — NAME=... PARAMS=... SLOTS=...

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
abdussamedulutas 2026-06-18 19:29:32 +03:00
parent 7c7f886e9c
commit a4bd5110b3
4 changed files with 11 additions and 7 deletions

Binary file not shown.

View File

@ -23,3 +23,6 @@
2 3078 1781799345769137653 CMakeFiles/saqut.dir/src/ir/ir_generator.cpp.o 10a1ed4e1f52e530
1 636 1781799663202595202 CMakeFiles/saqut.dir/src/ir/ir_function.cpp.o 10f5e8dfd1461d69
636 892 1781799663837592468 saqut f2e198803c4dbffb
1 653 1781800137590930314 CMakeFiles/saqut.dir/src/ir/ir_program.cpp.o 9518231d970828da
1 658 1781800137589789659 CMakeFiles/saqut.dir/src/ir/ir_function.cpp.o 10f5e8dfd1461d69
658 919 1781800138246787400 saqut f2e198803c4dbffb

View File

@ -60,17 +60,18 @@ void IRFunction::dump() const {
}
header += " [" + std::to_string(slotCount) + " slot]";
// Üst çizgi
std::cout << "+-" << std::string(header.size(), '-') << "-+\n";
std::cout << "|" << header << " |\n";
std::cout << "+-" << std::string(header.size(), '-') << "-+\n";
// Başlık: NAME=fibonacci PARAMS=1 SLOTS=10
std::cout << "NAME=" << name
<< " PARAMS=" << paramCount
<< " SLOTS=" << slotCount
<< "\n";
// Talimatlar
for (int i = 0; i < (int)instructions.size(); i++) {
const Instruction& ins = instructions[i];
// Satır numarası
std::cout << " " << std::setw(3) << std::right << i << " ";
std::cout << " " << std::setw(3) << std::right << i << " ";
// Opcode sütunu (12 karakter genişlik)
std::cout << std::left << std::setw(12) << opcodeName(ins.opcode);

View File

@ -2,10 +2,10 @@
#include <iostream>
void IRProgram::dump() const {
std::cout << "========== IR DUMP ==========\n\n";
std::cout << "IR DUMP\n\n";
for (const auto& name : functionOrder) {
auto it = functions.find(name);
if (it != functions.end()) it->second.dump();
}
std::cout << "=============================\n";
std::cout << "END\n";
}