stage1 重新实现ast2ir

This commit is contained in:
zzy committed 2026-09-10 23:20:09 +08:00
1 parent bcd26d3021
commit ab6e99c958
10 files changed
+1175 -677

No files matched your search

+13 -1
View File
@@ -5,10 +5,22 @@
#include "spl_sema.h"
typedef MAP(spl_def_id_t, spl_ir_node_ref_t) spl_def2ir_map_t;
typedef struct {
usize cont_blk;
usize brk_blk;
spl_ir_node_ref_vec_t breaks;
} spl_loop_ctx_t;
typedef VEC(spl_loop_ctx_t) spl_loop_ctx_vec_t;
typedef VEC(spl_ast_node_ref_t) spl_defer_stack_t;
typedef struct {
const spl_sema_t *sema;
spl_ir_builder_t *ir;
spl_def2ir_map_t def2ir_map;
spl_loop_ctx_vec_t loop_stack;
spl_defer_stack_t defer_stack;
int err_count;
} spl_ast2ir_t;
@@ -17,4 +29,4 @@ void spl_ast2ir_drop(spl_ast2ir_t *ast2ir);
void spl_ast2ir_run(spl_ast2ir_t *ast2ir);
#endif /* __SPL_AST2IR_H__ */
#endif /* __SPL_AST2IR_H__ */