mie: builtin: improve int attribute print callback
This commit is contained in:
@@ -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) {
|
|
||||||
b_stream_write_fmt(
|
|
||||||
out->p_stream, NULL, "%zu", int_val->i_val.v_small);
|
|
||||||
} else {
|
} else {
|
||||||
b_stream_write_fmt(
|
b_stream_write_fmt(out->p_stream, NULL, "INF", int_ty->i_width);
|
||||||
out->p_stream, NULL, "INF : i%zu", 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(
|
||||||
|
out->p_stream, NULL, "i%zu", int_ty->i_width);
|
||||||
|
} else {
|
||||||
|
b_stream_write_fmt(
|
||||||
|
out->p_stream, NULL, "!builtin.int<%zu>",
|
||||||
|
int_ty->i_width);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!abbrev) {
|
if (!abbrev) {
|
||||||
|
|||||||
Reference in New Issue
Block a user