mie: builtin: improve int attribute print callback

This commit is contained in:
2026-01-21 14:39:12 +00:00
parent f6f6131f52
commit 76166167c9

View File

@@ -21,16 +21,25 @@ static enum mie_status print(
b_stream_write_string(out->p_stream, "#builtin.int<", NULL); b_stream_write_string(out->p_stream, "#builtin.int<", NULL);
} }
if (int_ty->i_width < 64 || !abbrev) { if (int_ty->i_width <= 64) {
b_stream_write_fmt( b_stream_write_fmt(
out->p_stream, NULL, "%zu : i%zu", out->p_stream, NULL, "%zu", int_val->i_val.v_small,
int_val->i_val.v_small, int_ty->i_width); int_ty->i_width);
} else if (int_ty->i_width == 64 && abbrev) { } else {
b_stream_write_fmt(out->p_stream, NULL, "INF", int_ty->i_width);
}
if (int_ty->i_width != 64 || !abbrev) {
b_stream_write_string(out->p_stream, " : ", NULL);
if (abbrev) {
b_stream_write_fmt( b_stream_write_fmt(
out->p_stream, NULL, "%zu", int_val->i_val.v_small); out->p_stream, NULL, "i%zu", int_ty->i_width);
} else { } else {
b_stream_write_fmt( b_stream_write_fmt(
out->p_stream, NULL, "INF : i%zu", int_ty->i_width); out->p_stream, NULL, "!builtin.int<%zu>",
int_ty->i_width);
}
} }
if (!abbrev) { if (!abbrev) {