18 lines
530 B
C
18 lines
530 B
C
#include <mie/ir/register.h>
|
|
#include <mie/print/printer.h>
|
|
|
|
void mie_printer_print_register(
|
|
struct mie_printer *printer, const struct mie_register *reg)
|
|
{
|
|
if (reg->reg_flags & MIE_REGISTER_F_VIRTUAL) {
|
|
b_stream_write_fmt(
|
|
printer->p_stream, NULL, "%%%s", reg->reg_name.n_str);
|
|
} else if (reg->reg_flags & MIE_REGISTER_F_MACHINE) {
|
|
// TODO this shouldnt use reg_name
|
|
b_stream_write_fmt(
|
|
printer->p_stream, NULL, "$%s", reg->reg_name.n_str);
|
|
} else {
|
|
b_stream_write_string(printer->p_stream, "?REG", NULL);
|
|
}
|
|
}
|