jak-project/goalc/regalloc/IRegister.cpp
water111 2075dd66b6
Add ObjectGenerator and Register Allocator (#10)
* start the ObjectFileGenerator

* finish v3 generation

* add analysis for register allocator

* add register allocator

* fix const

* fix build

* fix formatting for clang-format

* attempt to fix windows build

* windows 2

* windows 3

* windows 4

* windows 5

* windows 6
2020-09-05 16:37:37 -04:00

19 lines
677 B
C++

#include "third-party/fmt/core.h"
#include "IRegister.h"
std::string IRegister::to_string() const {
// if (with_constraints) {
// std::string result = fmt::format("i{}-{}\n", emitter::to_string(kind), id);
// for (const auto& x : constraints) {
// result += fmt::format(" [{:3d] in {}\n", x.instr_idx,
// emitter::gRegInfo.get_info(x.desired_register).name);
// }
// return result;
// } else {
return fmt::format("i{}-{}", emitter::to_string(kind), id);
// }
}
std::string IRegConstraint::to_string() const {
return fmt::format("[{:3d}] {} in {}", instr_idx, ireg.to_string(), desired_register.print());
}