mie: ir: op: add function to get type from mie_op_arg

This commit is contained in:
2026-01-17 10:22:38 +00:00
parent fd72d217f6
commit b289c6e2de
2 changed files with 12 additions and 0 deletions

View File

@@ -72,4 +72,6 @@ MIE_API void mie_op_destroy(struct mie_op *op);
MIE_API void mie_op_init(struct mie_op *op);
MIE_API void mie_op_cleanup(struct mie_op *op);
MIE_API const struct mie_type *mie_op_arg_get_type(const struct mie_op_arg *arg);
#endif

10
mie/ir/op-arg.c Normal file
View File

@@ -0,0 +1,10 @@
#include <mie/ir/op.h>
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_unresolved.reg_type;
}