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

@@ -1,8 +1,6 @@
#include "codegen.h"
#include <mie/ir/block.h>
#include <mie/ir/func.h>
#include <mie/ir/module.h>
struct for_codegen_state {
struct code_generator_state s_base;
@@ -55,6 +53,7 @@ static struct code_generator_result gen_block(
struct ivy_ast_node *node, size_t depth)
{
struct for_codegen_state *for_loop = (struct for_codegen_state *)state;
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
// mie_builder_br(gen->c_builder, for_loop->s_blocks.b_cond);
@@ -63,6 +62,8 @@ static struct code_generator_result gen_block(
codegen_push_generator(gen, CODE_GENERATOR_BLOCK, 0, NULL);
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static enum ivy_status state_init(
@@ -70,6 +71,7 @@ static enum ivy_status state_init(
uintptr_t argv, void *argp)
{
struct for_codegen_state *for_loop = (struct for_codegen_state *)state;
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
for_loop->s_blocks.b_cond = mie_func_create_block(func, "for.cond");
@@ -81,11 +83,14 @@ static enum ivy_status state_init(
state->s_loop_repeat_target = for_loop->s_blocks.b_inc;
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_iterator_start(
struct ivy_codegen *gen, struct for_codegen_state *for_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
struct mie_type *id = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_ID);
@@ -95,11 +100,14 @@ static enum ivy_status gen_iterator_start(
"for.it");
mie_builder_br(gen->c_builder, for_loop->s_blocks.b_cond);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_cond_block(
struct ivy_codegen *gen, struct for_codegen_state *for_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_func_insert_block(func, for_loop->s_blocks.b_cond, NULL);
mie_builder_set_insert_point(gen->c_builder, for_loop->s_blocks.b_cond);
@@ -119,11 +127,14 @@ static enum ivy_status gen_cond_block(
for_loop->s_blocks.b_end, for_loop->s_blocks.b_body);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_body(
struct ivy_codegen *gen, struct for_codegen_state *for_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_func_insert_block(func, for_loop->s_blocks.b_body, NULL);
mie_builder_set_insert_point(gen->c_builder, for_loop->s_blocks.b_body);
@@ -135,11 +146,14 @@ static enum ivy_status gen_body(
gen->c_builder, for_loop->s_it_value, for_loop->s_it_value_inner);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_inc_block(
struct ivy_codegen *gen, struct for_codegen_state *for_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_builder_br(gen->c_builder, for_loop->s_blocks.b_inc);
@@ -153,16 +167,21 @@ static enum ivy_status gen_inc_block(
mie_builder_br(gen->c_builder, for_loop->s_blocks.b_cond);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_end_block(
struct ivy_codegen *gen, struct for_codegen_state *for_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_func_insert_block(func, for_loop->s_blocks.b_end, NULL);
mie_builder_set_insert_point(gen->c_builder, for_loop->s_blocks.b_end);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status state_fini(
@@ -179,6 +198,7 @@ static struct code_generator_result value_received(
struct ivy_codegen *gen, struct code_generator_state *state,
struct code_generator_value *value)
{
#if 0
struct for_codegen_state *for_loop = (struct for_codegen_state *)state;
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
@@ -191,6 +211,8 @@ static struct code_generator_result value_received(
}
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static enum ivy_status resolve_var(
@@ -199,6 +221,7 @@ static enum ivy_status resolve_var(
{
struct for_codegen_state *for_loop = (struct for_codegen_state *)state;
#if 0
if (strcmp(ident, for_loop->s_it_ident->n_content->t_str) != 0) {
return IVY_ERR_NO_ENTRY;
}
@@ -209,6 +232,8 @@ static enum ivy_status resolve_var(
var->v_flags = CODEGEN_VAR_F_PTR;
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
struct code_generator for_loop_generator = {