stage1 修复设计问题 实现ir2vm

This commit is contained in:
zzy
2026-08-05 19:13:48 +08:00
parent 2ccee5f1cf
commit ca7cf221c8
11 changed files with 2038 additions and 206 deletions

View File

@@ -4,10 +4,17 @@
#include "spl_ir.h"
#include "spl_sema.h"
/* 全局 var/const 的 def → gdata 向量中的 value 节点索引 */
typedef struct {
spl_def_id_t def_id;
usize gdata_idx;
} spl_ast2ir_gref_t;
typedef struct {
const spl_sema_t *sema;
spl_ir_t ir;
VEC(char *) owned_names; /* 本模块 malloc 的函数名drop 时释放 */
VEC(char *) owned_names; /* 本模块 malloc 的函数名drop 时释放 */
VEC(spl_ast2ir_gref_t) gdata_ref; /* def_id → gdata value 节点索引 */
int err_count;
} spl_ast2ir_t;