mie: add parent pointers to region and block; two-way link between a register and its users

This commit is contained in:
2026-01-19 13:57:25 +00:00
parent da140ed0d1
commit 5e13824706
9 changed files with 43 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
const struct mie_type *mie_op_arg_get_type(const struct mie_op_arg *arg)
{
if (arg->arg_flags & MIE_OP_F_ARG_RESOLVED) {
return arg->arg_value->reg_type;
return arg->arg_value.u_reg->reg_type;
}
return arg->arg_unresolved.reg_type;

View File

@@ -5,5 +5,14 @@
struct mie_block *mie_region_add_block(struct mie_region *region)
{
return mie_vector_emplace_back(region->r_blocks, &mie_block_vector_ops);
struct mie_block *block = mie_vector_emplace_back(
region->r_blocks, &mie_block_vector_ops);
if (!block) {
return NULL;
}
block->b_parent = region;
return block;
}