stage1 实现ir2vm 修复nob test命令的构建问题

This commit is contained in:
zzy committed 2026-09-12 18:51:10 +08:00
1 parent 87d9b7ea34
commit a64a96f9a4
11 files changed
+1565 -195

No files matched your search

+4 -3
View File
@@ -196,8 +196,8 @@ static void ir_dump_node(const spl_type_t *ty, spl_ir_node_t *n) {
printf(" float=%f", n->type_const.float_lit);
} else if (t && t->kind == SPL_TYPE_FN) {
printf(" fn#%zu", n->type_const.fn);
} else if (t && t->kind == SPL_TYPE_PTR) {
printf(" str=\"%s\"", n->type_const.cstr_lit ? n->type_const.cstr_lit : "?");
// } else if (t && t->kind == SPL_TYPE_PTR) {
// printf(" str=\"%s\"", n->type_const.cstr_lit ? n->type_const.cstr_lit : "?");
} else if (t && t->kind == SPL_TYPE_INT && t->int_type.bits == 8) {
printf(" char='%c'", n->type_const.ch_lit);
} else {
@@ -592,7 +592,8 @@ spl_ir_node_ref_t spl_ir_builder_type_const_cstr(spl_ir_builder_t *b, spl_type_i
spl_ir_node_ref_t ref = builder_alloc_node(b, SPL_IR_TYPE_CONST);
spl_ir_node_t *n = spl_ir_node(&b->ir, b->current_fn, ref);
n->type_const.tid = tid;
n->type_const.cstr_lit = val;
TODO();
// n->type_const.cstr_lit = val;
return ref;
}