mie: refactor ir api into a separate sub-directory
This commit is contained in:
22
mie/ir/const.c
Normal file
22
mie/ir/const.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <mie/ir/const.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void mie_const_init(struct mie_const *c, struct mie_type *type)
|
||||
{
|
||||
memset(c, 0x0, sizeof *c);
|
||||
mie_value_init(&c->c_base, MIE_VALUE_CONST);
|
||||
|
||||
c->c_type = type;
|
||||
}
|
||||
|
||||
static struct mie_type *get_type(struct mie_value *v, struct mie_ctx *ctx)
|
||||
{
|
||||
struct mie_const *c = MIE_CONST(v);
|
||||
return c->c_type;
|
||||
}
|
||||
|
||||
const struct mie_value_type const_value_type = {
|
||||
.t_id = MIE_VALUE_CONST,
|
||||
.t_get_type = get_type,
|
||||
};
|
||||
Reference in New Issue
Block a user