mie: implement more ir building functionality
This commit is contained in:
27
mie/module.c
Normal file
27
mie/module.c
Normal 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,
|
||||
};
|
||||
Reference in New Issue
Block a user