frontend: update bluelib api usage
This commit is contained in:
@@ -229,19 +229,22 @@ static b_result generate_mie_ir(struct compile_ctx *ctx)
|
||||
static b_result build_block_isel_graph(
|
||||
struct compile_ctx *ctx, struct mie_func *func, struct mie_block *block)
|
||||
{
|
||||
b_queue_iterator instr_it;
|
||||
b_queue_foreach (&instr_it, &block->b_phi) {
|
||||
b_queue_entry *entry = b_queue_first(&block->b_phi);
|
||||
while (entry) {
|
||||
struct mie_value *instr_v
|
||||
= b_unbox(struct mie_value, instr_it.entry, v_entry);
|
||||
= b_unbox(struct mie_value, entry, v_entry);
|
||||
mie_select_builder_push_instr(
|
||||
ctx->select, (struct mie_instr *)instr_v);
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
b_queue_foreach (&instr_it, &block->b_instr) {
|
||||
entry = b_queue_first(&block->b_instr);
|
||||
while (entry) {
|
||||
struct mie_value *instr_v
|
||||
= b_unbox(struct mie_value, instr_it.entry, v_entry);
|
||||
= b_unbox(struct mie_value, entry, v_entry);
|
||||
mie_select_builder_push_instr(
|
||||
ctx->select, (struct mie_instr *)instr_v);
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
if (block->b_terminator) {
|
||||
@@ -262,16 +265,18 @@ static b_result build_block_isel_graph(
|
||||
|
||||
static b_result build_func_isel_graph(struct compile_ctx *ctx, struct mie_func *func)
|
||||
{
|
||||
b_queue_iterator it;
|
||||
b_queue_foreach (&it, &func->f_blocks) {
|
||||
b_queue_entry *entry = b_queue_first(&func->f_blocks);
|
||||
while (entry) {
|
||||
struct mie_value *block_v
|
||||
= b_unbox(struct mie_value, it.entry, v_entry);
|
||||
= b_unbox(struct mie_value, entry, v_entry);
|
||||
struct mie_block *block = (struct mie_block *)block_v;
|
||||
|
||||
b_result result = build_block_isel_graph(ctx, func, block);
|
||||
if (b_result_is_error(result)) {
|
||||
return b_result_propagate(result);
|
||||
}
|
||||
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
return B_RESULT_SUCCESS;
|
||||
@@ -279,17 +284,18 @@ static b_result build_func_isel_graph(struct compile_ctx *ctx, struct mie_func *
|
||||
|
||||
static b_result build_isel_graph(struct compile_ctx *ctx)
|
||||
{
|
||||
b_queue_iterator it;
|
||||
|
||||
b_queue_foreach (&it, &ctx->mod->m_func) {
|
||||
b_queue_entry *entry = b_queue_first(&ctx->mod->m_func);
|
||||
while (entry) {
|
||||
struct mie_value *func_v
|
||||
= b_unbox(struct mie_value, it.entry, v_entry);
|
||||
= b_unbox(struct mie_value, entry, v_entry);
|
||||
struct mie_func *func = (struct mie_func *)func_v;
|
||||
|
||||
b_result result = build_func_isel_graph(ctx, func);
|
||||
if (b_result_is_error(result)) {
|
||||
return b_result_propagate(result);
|
||||
}
|
||||
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
return B_RESULT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user