mie: print: implement exception-printing of resolved, but null, op args
this is to make it easier to spot mistakes made when modifying IR.
This commit is contained in:
@@ -60,6 +60,8 @@ static void print_block_header(
|
|||||||
|
|
||||||
if (block->b_name.n_str) {
|
if (block->b_name.n_str) {
|
||||||
b_stream_write_string(printer->p_stream, block->b_name.n_str, NULL);
|
b_stream_write_string(printer->p_stream, block->b_name.n_str, NULL);
|
||||||
|
} else {
|
||||||
|
b_stream_write_string(printer->p_stream, "<UNNAMED>", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_block_header_params(printer, block);
|
print_block_header_params(printer, block);
|
||||||
|
|||||||
@@ -13,9 +13,15 @@ void mie_printer_print_op_arg(
|
|||||||
const struct mie_type *arg_type = NULL;
|
const struct mie_type *arg_type = NULL;
|
||||||
|
|
||||||
if (MIE_TEST_FLAGS(arg->arg_flags, MIE_OP_F_ARG_RESOLVED)) {
|
if (MIE_TEST_FLAGS(arg->arg_flags, MIE_OP_F_ARG_RESOLVED)) {
|
||||||
arg_flags = arg->arg_value.u_reg->reg_flags;
|
if (!arg->arg_value.u_reg) {
|
||||||
arg_name = arg->arg_value.u_reg->reg_name.n_str;
|
arg_flags = 0;
|
||||||
arg_type = arg->arg_value.u_reg->reg_type;
|
arg_name = "<NULL>";
|
||||||
|
arg_type = NULL;
|
||||||
|
} else {
|
||||||
|
arg_flags = arg->arg_value.u_reg->reg_flags;
|
||||||
|
arg_name = arg->arg_value.u_reg->reg_name.n_str;
|
||||||
|
arg_type = arg->arg_value.u_reg->reg_type;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
arg_flags = arg->arg_unresolved.reg_flags;
|
arg_flags = arg->arg_unresolved.reg_flags;
|
||||||
arg_name = arg->arg_unresolved.reg_name;
|
arg_name = arg->arg_unresolved.reg_name;
|
||||||
@@ -30,7 +36,7 @@ void mie_printer_print_op_arg(
|
|||||||
|
|
||||||
b_stream_write_string(printer->p_stream, arg_name, NULL);
|
b_stream_write_string(printer->p_stream, arg_name, NULL);
|
||||||
|
|
||||||
if (!include_type) {
|
if (!include_type || !arg_type) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user