lang: remove references to old mie api

This commit is contained in:
2026-03-16 15:07:57 +00:00
parent c44e976979
commit 016ee11f75
15 changed files with 170 additions and 104 deletions

View File

@@ -2,8 +2,6 @@
#include <ivy/lang/codegen.h>
#include <mie/ir/builder.h>
#include <mie/ir/module.h>
#include <mie/ir/value.h>
#include <stdlib.h>
#include <string.h>
@@ -213,22 +211,27 @@ enum ivy_status codegen_resolve_variable(
struct mie_value *codegen_load_variable(
struct ivy_codegen *gen, struct codegen_var *var)
{
#if 0
if (var->v_flags & CODEGEN_VAR_F_PTR) {
return mie_builder_load(
gen->c_builder, var->v_type, var->v_value, NULL);
}
return var->v_value;
#endif
return NULL;
}
void codegen_store_variable(
struct ivy_codegen *gen, struct codegen_var *var, struct mie_value *val)
{
#if 0
if (!(var->v_flags & CODEGEN_VAR_F_PTR)) {
return;
}
mie_builder_store(gen->c_builder, val, var->v_value);
#endif
}
enum ivy_status ivy_codegen_create(struct mie_ctx *ctx, struct ivy_codegen **out)
@@ -248,6 +251,7 @@ enum ivy_status ivy_codegen_create(struct mie_ctx *ctx, struct ivy_codegen **out
void ivy_codegen_destroy(struct ivy_codegen *gen)
{
#if 0
if (gen->c_module) {
mie_value_destroy(MIE_VALUE(gen->c_module));
}
@@ -255,12 +259,14 @@ void ivy_codegen_destroy(struct ivy_codegen *gen)
if (gen->c_builder) {
mie_builder_destroy(gen->c_builder);
}
#endif
free(gen);
}
enum ivy_status ivy_codegen_start_module(struct ivy_codegen *gen)
{
#if 0
if (gen->c_module || gen->c_builder) {
return IVY_ERR_BAD_STATE;
}
@@ -269,6 +275,8 @@ enum ivy_status ivy_codegen_start_module(struct ivy_codegen *gen)
gen->c_builder = mie_builder_create(gen->c_ctx, gen->c_module);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
enum ivy_status ivy_codegen_end_module(
@@ -278,6 +286,7 @@ enum ivy_status ivy_codegen_end_module(
return IVY_ERR_BAD_STATE;
}
#if 0
struct mie_module *module = gen->c_module;
mie_builder_destroy(gen->c_builder);
@@ -287,6 +296,8 @@ enum ivy_status ivy_codegen_end_module(
*out = module;
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
struct mie_module *ivy_codegen_get_current_module(struct ivy_codegen *gen)