mie: implement more ir building functionality

This commit is contained in:
2025-04-13 18:34:02 +01:00
parent 7f0d8b87c5
commit deb1232bf9
21 changed files with 694 additions and 132 deletions

27
mie/module.c Normal file
View File

@@ -0,0 +1,27 @@
#include <mie/func.h>
#include <mie/module.h>
#include <stdlib.h>
#include <string.h>
struct mie_module *mie_module_create(void)
{
struct mie_module *out = malloc(sizeof *out);
if (!out) {
return NULL;
}
memset(out, 0x0, sizeof *out);
mie_value_init(&out->m_base, MIE_VALUE_MODULE);
return out;
}
void mie_module_add_function(struct mie_module *mod, struct mie_func *func)
{
b_queue_push_back(&mod->m_func, &func->f_base.v_entry);
}
const struct mie_value_type module_value_type = {
.t_id = MIE_VALUE_MODULE,
};