2025-06-02 11:31:19 +01:00
|
|
|
#include <mie/ir/arg.h>
|
2025-04-21 21:10:27 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
struct mie_arg *mie_arg_create(struct mie_type *type)
|
|
|
|
|
{
|
|
|
|
|
struct mie_arg *out = malloc(sizeof *out);
|
|
|
|
|
if (!out) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memset(out, 0x0, sizeof *out);
|
|
|
|
|
|
|
|
|
|
mie_value_init(&out->arg_base, MIE_VALUE_ARG);
|
|
|
|
|
|
|
|
|
|
out->arg_type = type;
|
|
|
|
|
|
|
|
|
|
return out;
|
|
|
|
|
}
|
2025-04-13 18:34:02 +01:00
|
|
|
|
2025-04-28 15:38:25 +01:00
|
|
|
static struct mie_type *get_type(struct mie_value *v, struct mie_ctx *ctx)
|
2025-04-13 18:34:02 +01:00
|
|
|
{
|
|
|
|
|
struct mie_arg *arg = MIE_ARG(v);
|
|
|
|
|
return arg->arg_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const struct mie_value_type arg_value_type = {
|
|
|
|
|
.t_id = MIE_VALUE_ARG,
|
|
|
|
|
.t_get_type = get_type,
|
|
|
|
|
};
|