stage1 实现部分ast2ir内容并重构stage0 引入并重构ir2vm 构建系统修改部分
This commit is contained in:
1 parent
3d57260f3f
commit
34df303b56
17 files changed
+636
-1800
No files matched your search
+7
-4
@@ -113,12 +113,15 @@ static void ir_dump_node(const spl_type_t *ty, spl_ir_node_t *n) {
|
||||
case SPL_IR_ARITH_XOR:
|
||||
case SPL_IR_ARITH_SHL:
|
||||
case SPL_IR_ARITH_SHR:
|
||||
ir_dump_type(ty, n->arith.tid);
|
||||
ir_dump_ref(n->arith.left);
|
||||
ir_dump_ref(n->arith.right);
|
||||
break;
|
||||
case SPL_IR_ARITH_NEG:
|
||||
case SPL_IR_ARITH_ABS:
|
||||
case SPL_IR_ARITH_NOT:
|
||||
ir_dump_type(ty, n->arith.tid);
|
||||
ir_dump_ref(n->arith.left);
|
||||
ir_dump_ref(n->arith.right);
|
||||
break;
|
||||
case SPL_IR_CMP_EQ:
|
||||
case SPL_IR_CMP_NE:
|
||||
@@ -272,7 +275,7 @@ void spl_ir_dump(spl_ir_t *ir, const spl_type_t *ty) {
|
||||
if (i == 0)
|
||||
continue;
|
||||
spl_ir_func_t *func = &vec_at(ir->funcs, i);
|
||||
printf("func %s", func->name ? func->name : "?");
|
||||
printf("func %s %%%zu", func->name ? func->name : "?", i);
|
||||
printf(" tid=");
|
||||
spl_type_pure_dump((spl_type_t *)ty, func->fn_tid);
|
||||
printf("\n");
|
||||
@@ -739,9 +742,9 @@ spl_ir_node_ref_t spl_ir_builder_control_call(spl_ir_builder_t *b, spl_type_id_t
|
||||
return ref;
|
||||
}
|
||||
|
||||
void spl_ir_builder_control_call_param(spl_ir_builder_t *b, spl_ir_node_ref_t node,
|
||||
void spl_ir_builder_control_call_param(spl_ir_builder_t *b, spl_ir_node_ref_t call_node,
|
||||
spl_ir_node_ref_t arg) {
|
||||
spl_ir_node_t *n = spl_ir_node(&b->ir, b->current_fn, node);
|
||||
spl_ir_node_t *n = spl_ir_node(&b->ir, b->current_fn, call_node);
|
||||
Assert(n != NULL);
|
||||
vec_push(n->control_call.params, arg);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user