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

@@ -4,9 +4,6 @@
#include <fx/core/stringstream.h>
#include <fx/ds/list.h>
#include <mie/ir/block.h>
#include <mie/ir/func.h>
#include <mie/ir/module.h>
#include <mie/ir/record.h>
#include <stdlib.h>
enum {
@@ -25,6 +22,7 @@ struct unit_codegen_state {
static enum ivy_status switch_to_immediate_func(
struct ivy_codegen *gen, struct unit_codegen_state *unit, long flags)
{
#if 0
if (!unit->s_immediate) {
struct mie_type *ret_type
= mie_ctx_get_type(gen->c_ctx, MIE_TYPE_VOID);
@@ -56,8 +54,9 @@ static enum ivy_status switch_to_immediate_func(
}
mie_builder_set_insert_point(gen->c_builder, block);
#endif
return IVY_OK;
return IVY_ERR_NOT_SUPPORTED;
}
#if 0
@@ -81,6 +80,7 @@ static struct code_generator_result gen_expr(
struct ivy_ast_node *node, size_t depth)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
struct mie_builder *builder = gen->c_builder;
struct mie_func *current = mie_builder_get_current_func(builder);
@@ -96,6 +96,8 @@ static struct code_generator_result gen_expr(
codegen_push_generator(
gen, CODE_GENERATOR_EXPR, CODEGEN_F_IGNORE_RESULT, NULL);
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_for_loop(
@@ -103,6 +105,7 @@ static struct code_generator_result gen_for_loop(
struct ivy_ast_node *node, size_t depth)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
struct mie_builder *builder = gen->c_builder;
struct mie_func *current = mie_builder_get_current_func(builder);
@@ -118,6 +121,8 @@ static struct code_generator_result gen_for_loop(
codegen_push_generator(
gen, CODE_GENERATOR_FOR_LOOP, CODEGEN_F_IGNORE_RESULT, 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(
@@ -125,6 +130,7 @@ static struct code_generator_result gen_while_loop(
struct ivy_ast_node *node, size_t depth)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
struct mie_builder *builder = gen->c_builder;
struct mie_func *current = mie_builder_get_current_func(builder);
@@ -140,6 +146,8 @@ static struct code_generator_result gen_while_loop(
codegen_push_generator(
gen, CODE_GENERATOR_WHILE_LOOP, CODEGEN_F_IGNORE_RESULT, NULL);
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static void serialise_package_name(fx_queue *parts, fx_stringstream *out)
@@ -165,6 +173,7 @@ static struct code_generator_result gen_unit_package(
struct ivy_ast_unit_package_node *pkg
= (struct ivy_ast_unit_package_node *)node;
#if 0
fx_stringstream *str = fx_stringstream_create();
serialise_package_name(&pkg->n_ident, str);
char *ident = fx_stringstream_steal(str);
@@ -176,6 +185,8 @@ static struct code_generator_result gen_unit_package(
gen->c_builder, MIE_CONST(ident_val), "package_scope");
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_unit_import(
@@ -183,6 +194,7 @@ static struct code_generator_result gen_unit_import(
struct ivy_ast_node *node, size_t depth)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
struct ivy_ast_unit_package_node *pkg
= (struct ivy_ast_unit_package_node *)node;
@@ -208,6 +220,8 @@ static struct code_generator_result gen_unit_import(
fx_list_push_back(import_list->a_values, ident_val);
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_return(
@@ -215,6 +229,7 @@ static struct code_generator_result gen_return(
struct ivy_ast_node *node, size_t depth)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
struct mie_builder *builder = gen->c_builder;
struct mie_func *current = mie_builder_get_current_func(builder);
@@ -229,6 +244,8 @@ static struct code_generator_result gen_return(
codegen_push_generator(gen, CODE_GENERATOR_RETURN, 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(
@@ -246,6 +263,7 @@ static enum ivy_status state_fini(
struct code_generator_value *result)
{
struct unit_codegen_state *unit = (struct unit_codegen_state *)state;
#if 0
codegen_var_map_fini(&unit->s_vars);
struct mie_func *current = mie_builder_get_current_func(gen->c_builder);
@@ -261,6 +279,8 @@ static enum ivy_status state_fini(
}
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status define_var(