From 6b5fd95ac45afdeef2a04ff46f74cf5a7fc28e3a Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 11 Jan 2026 14:49:02 +0000 Subject: [PATCH] mie: op: add data structure for op successors --- mie/include/mie/ir/op.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/mie/include/mie/ir/op.h b/mie/include/mie/ir/op.h index e3b3eb3..a2139e8 100644 --- a/mie/include/mie/ir/op.h +++ b/mie/include/mie/ir/op.h @@ -19,12 +19,8 @@ struct mie_op_definition; enum mie_op_flags { MIE_OP_F_OP_RESOLVED = 0x01u, - MIE_OP_F_ARGS_RESOLVED = 0x02u, -}; - -struct mie_op_successor { - struct mie_block *s_block; - MIE_VECTOR_DECLARE(struct mie_register *, s_params); + MIE_OP_F_ARG_RESOLVED = 0x02u, + MIE_OP_F_SUCCESSOR_RESOLVED = 0x04u, }; struct mie_op_attribute { @@ -33,19 +29,33 @@ struct mie_op_attribute { }; struct mie_op_arg { + enum mie_op_flags arg_flags; struct mie_file_span arg_span; union { - /* only valid if the parent op's F_ARGS_RESOLVED flag is set */ + /* only valid if F_ARG_RESOLVED is set in arg_flags */ struct mie_register *arg_value; - /* only valid if the parent op's F_ARGS_RESOLVED flag is NOT set */ + /* only valid if F_ARG_RESOLVED is NOT set in arg_flags */ struct mie_register_ref arg_unresolved; }; }; +struct mie_op_successor { + enum mie_op_flags s_flags; + + union { + /* only valid if F_SUCCESSOR_RESOLVED is set in s_flags; */ + struct mie_block *s_block; + /* only valid if F_SUCCESSOR_RESOLVED is NOT set in s_flags; */ + char *s_block_name; + }; + + MIE_VECTOR_DECLARE(struct mie_op_arg, s_args); +}; + struct mie_op { enum mie_op_flags op_flags; - /* these pointers are only valid if the F_RESOLVED flag is set */ + /* these pointers are only valid if the F_OP_RESOLVED flag is set */ const struct mie_dialect *op_dialect; const struct mie_op_definition *op_info;