lang: remove references to old mie api
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#include "codegen.h"
|
||||
|
||||
#include <mie/ir/block.h>
|
||||
#include <mie/ir/func.h>
|
||||
#include <mie/ir/module.h>
|
||||
|
||||
struct block_codegen_state {
|
||||
struct code_generator_state s_base;
|
||||
@@ -19,7 +17,6 @@ static struct code_generator_result gen_expr(
|
||||
{
|
||||
struct block_codegen_state *block = (struct block_codegen_state *)state;
|
||||
struct mie_builder *builder = gen->c_builder;
|
||||
struct mie_func *current = mie_builder_get_current_func(builder);
|
||||
|
||||
codegen_push_generator(
|
||||
gen, CODE_GENERATOR_EXPR, CODEGEN_F_IGNORE_RESULT, NULL);
|
||||
@@ -48,50 +45,21 @@ static struct code_generator_result gen_return(
|
||||
struct ivy_codegen *gen, struct code_generator_state *state,
|
||||
struct ivy_ast_node *node, size_t depth)
|
||||
{
|
||||
struct block_codegen_state *block = (struct block_codegen_state *)state;
|
||||
struct mie_builder *builder = gen->c_builder;
|
||||
struct mie_func *current = mie_builder_get_current_func(builder);
|
||||
|
||||
enum ivy_status status = IVY_OK;
|
||||
|
||||
if (status != IVY_OK) {
|
||||
return CODEGEN_RESULT_ERR(status);
|
||||
}
|
||||
|
||||
codegen_push_generator(gen, CODE_GENERATOR_RETURN, 0, NULL);
|
||||
return CODEGEN_RESULT_OK(CODEGEN_R_REPEAT_NODE);
|
||||
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
static struct code_generator_result gen_loop_break(
|
||||
struct ivy_codegen *gen, struct code_generator_state *state,
|
||||
struct ivy_ast_node *node, size_t depth)
|
||||
{
|
||||
struct block_codegen_state *block = (struct block_codegen_state *)state;
|
||||
|
||||
if (!state->s_loop_break_target) {
|
||||
return CODEGEN_RESULT_ERR(IVY_ERR_BAD_SYNTAX);
|
||||
}
|
||||
|
||||
mie_builder_br(gen->c_builder, state->s_loop_break_target);
|
||||
|
||||
block->s_result = mie_ctx_get_null(gen->c_ctx);
|
||||
return CODEGEN_RESULT_OK(0);
|
||||
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
static struct code_generator_result gen_loop_repeat(
|
||||
struct ivy_codegen *gen, struct code_generator_state *state,
|
||||
struct ivy_ast_node *node, size_t depth)
|
||||
{
|
||||
struct block_codegen_state *block = (struct block_codegen_state *)state;
|
||||
|
||||
if (!state->s_loop_repeat_target) {
|
||||
return CODEGEN_RESULT_ERR(IVY_ERR_BAD_SYNTAX);
|
||||
}
|
||||
|
||||
mie_builder_br(gen->c_builder, state->s_loop_repeat_target);
|
||||
|
||||
block->s_result = mie_ctx_get_null(gen->c_ctx);
|
||||
return CODEGEN_RESULT_OK(0);
|
||||
return CODEGEN_RESULT_ERR(IVY_ERR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
static enum ivy_status state_init(
|
||||
|
||||
Reference in New Issue
Block a user