frontend: update mie api usage to use new context parameter
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <ivy/lang/codegen.h>
|
||||
#include <ivy/lang/lex.h>
|
||||
#include <mie/convert.h>
|
||||
#include <mie/ctx.h>
|
||||
#include <mie/module.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -77,8 +78,10 @@ static int compile_file(const char *path, const b_arglist *args)
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct mie_ctx *ctx = mie_ctx_create();
|
||||
|
||||
struct ivy_codegen *codegen;
|
||||
status = ivy_codegen_create(&codegen);
|
||||
status = ivy_codegen_create(ctx, &codegen);
|
||||
|
||||
if (status != IVY_OK) {
|
||||
b_err("failed to initialise Ivy code generator");
|
||||
@@ -170,7 +173,7 @@ static int compile_file(const char *path, const b_arglist *args)
|
||||
ivy_codegen_end_module(codegen, &mod);
|
||||
|
||||
struct mie_ir_converter *convert
|
||||
= mie_ir_converter_create(MIE_IR_MEM, MIE_IR_TEXT);
|
||||
= mie_ir_converter_create(ctx, MIE_IR_MEM, MIE_IR_TEXT);
|
||||
mie_ir_converter_set_src_value(convert, MIE_VALUE(mod));
|
||||
mie_ir_converter_set_dest_file(convert, stdout);
|
||||
mie_ir_converter_process(convert);
|
||||
|
||||
Reference in New Issue
Block a user