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,9 +1,6 @@
#include "codegen.h"
#include <mie/ir/arg.h>
#include <mie/ir/block.h>
#include <mie/ir/func.h>
#include <mie/ir/module.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -29,6 +26,7 @@ struct lambda_codegen_state {
static enum ivy_status switch_to_lambda_func(
struct ivy_codegen *gen, struct lambda_codegen_state *lambda)
{
#if 0
if (!lambda->s_outer_block) {
lambda->s_outer_block
= mie_builder_get_current_block(gen->c_builder);
@@ -48,13 +46,18 @@ static enum ivy_status switch_to_lambda_func(
mie_builder_set_insert_point(gen->c_builder, block);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status switch_to_outer_block(
struct ivy_codegen *gen, struct lambda_codegen_state *lambda)
{
#if 0
mie_builder_set_insert_point(gen->c_builder, lambda->s_outer_block);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static struct code_generator_result gen_lambda(
@@ -62,6 +65,7 @@ static struct code_generator_result gen_lambda(
struct ivy_ast_node *node, size_t depth)
{
struct lambda_codegen_state *lambda = (struct lambda_codegen_state *)state;
#if 0
if (lambda->s_prev_part != LAMBDA_NONE) {
return CODEGEN_RESULT_ERR(IVY_ERR_BAD_SYNTAX);
}
@@ -89,6 +93,8 @@ static struct code_generator_result gen_lambda(
switch_to_lambda_func(gen, lambda);
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_ident(
@@ -96,6 +102,7 @@ static struct code_generator_result gen_ident(
struct ivy_ast_node *node, size_t depth)
{
struct lambda_codegen_state *lambda = (struct lambda_codegen_state *)state;
#if 0
if (lambda->s_prev_part != LAMBDA_START
&& lambda->s_prev_part != LAMBDA_ARG) {
return CODEGEN_RESULT_ERR(IVY_ERR_BAD_SYNTAX);
@@ -117,6 +124,8 @@ static struct code_generator_result gen_ident(
codegen_var_map_put(&lambda->s_args, arg_name, &arg_var);
return CODEGEN_RESULT_OK(0);
#endif
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
}
static struct code_generator_result gen_block(
@@ -151,6 +160,7 @@ static enum ivy_status state_fini(
{
struct lambda_codegen_state *lambda = (struct lambda_codegen_state *)state;
#if 0
switch_to_outer_block(gen, lambda);
mie_module_add_function(gen->c_module, lambda->s_func, ".anon");
result->v_type = CODE_GENERATOR_VALUE_MIE_VALUE;
@@ -160,6 +170,8 @@ static enum ivy_status state_fini(
codegen_var_map_fini(&lambda->s_captured_vars);
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
static enum ivy_status resolve_var(
@@ -192,6 +204,7 @@ static enum ivy_status capture_var(
{
struct lambda_codegen_state *lambda = (struct lambda_codegen_state *)state;
#if 0
struct mie_type *str_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_STR);
struct mie_type *void_type = mie_ctx_get_type(gen->c_ctx, MIE_TYPE_VOID);
struct mie_value *ident_ptr
@@ -243,6 +256,8 @@ static enum ivy_status capture_var(
*var = capture;
return IVY_OK;
#endif
return IVY_ERR_NOT_SUPPORTED;
}
struct code_generator lambda_generator = {