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 while_codegen_state {
struct code_generator_state s_base;
@@ -21,6 +19,7 @@ static struct code_generator_result gen_expr(
{
struct while_codegen_state *while_loop
= (struct while_codegen_state *)state;
#if 0
if (!while_loop->s_cond_value) {
mie_builder_br(gen->c_builder, while_loop->s_blocks.b_cond);
@@ -34,6 +33,8 @@ static struct code_generator_result gen_expr(
codegen_push_generator(gen, CODE_GENERATOR_EXPR, 0, NULL);
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_while_loop(
@@ -49,6 +50,7 @@ static struct code_generator_result gen_block(
{
struct while_codegen_state *while_loop
= (struct while_codegen_state *)state;
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
// mie_builder_br(gen->c_builder, while_loop->s_blocks.b_cond);
@@ -57,6 +59,8 @@ static struct code_generator_result gen_block(
codegen_push_generator(gen, CODE_GENERATOR_BLOCK, 0, NULL);
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static enum ivy_status state_init(
@@ -65,6 +69,7 @@ static enum ivy_status state_init(
{
struct while_codegen_state *while_loop
= (struct while_codegen_state *)state;
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
while_loop->s_blocks.b_cond = mie_func_create_block(func, "while.cond");
@@ -75,40 +80,48 @@ static enum ivy_status state_init(
state->s_loop_repeat_target = while_loop->s_blocks.b_cond;
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_cond_branch(
struct ivy_codegen *gen, struct while_codegen_state *while_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_builder_br_if(
gen->c_builder, while_loop->s_cond_value,
while_loop->s_blocks.b_body, while_loop->s_blocks.b_end);
#endif
return IVY_OK;
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_body(
struct ivy_codegen *gen, struct while_codegen_state *while_loop)
{
#if 0
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_func_insert_block(func, while_loop->s_blocks.b_body, NULL);
mie_builder_set_insert_point(gen->c_builder, while_loop->s_blocks.b_body);
#endif
return IVY_OK;
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status gen_end_block(
struct ivy_codegen *gen, struct while_codegen_state *while_loop)
{
#if 0
mie_builder_br(gen->c_builder, while_loop->s_blocks.b_cond);
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
mie_func_insert_block(func, while_loop->s_blocks.b_end, NULL);
mie_builder_set_insert_point(gen->c_builder, while_loop->s_blocks.b_end);
#endif
return IVY_OK;
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status state_fini(
@@ -125,6 +138,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 while_codegen_state *while_loop
= (struct while_codegen_state *)state;
struct mie_func *func = mie_builder_get_current_func(gen->c_builder);
@@ -136,8 +150,9 @@ static struct code_generator_result value_received(
gen_body(gen, while_loop);
return CODEGEN_RESULT_OK(0);
}
#endif
return CODEGEN_RESULT_OK(0);
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
struct code_generator while_loop_generator = {