mie: implement caching and emitting string data

This commit is contained in:
2025-04-17 22:55:17 +01:00
parent abb7cfaf0e
commit 9cce4bf541
11 changed files with 211 additions and 58 deletions

View File

@@ -33,6 +33,23 @@ struct mie_data *mie_data_create_extern_global(
return data;
}
struct mie_data *mie_data_create_const(struct mie_const *value)
{
struct mie_data *data = malloc(sizeof *data);
if (!data) {
return NULL;
}
memset(data, 0x0, sizeof *data);
mie_value_init(&data->d_base, MIE_VALUE_DATA);
data->d_type = MIE_DATA_CONST;
data->d_const.c_value = value;
return data;
}
static struct mie_type *get_type(struct mie_value *v)
{
if (!ptr_type.t_id) {