feat(ir): 添加IR库的基础结构和定义

- 创建IR库的cbuild.toml配置文件,添加对scc_core的依赖
- 新增ir_def.h头文件,定义IR类型、节点、基本块和函数的数据结构
- 添加ir_builtin.h和ir_builtin.c,提供内置的i32类型和零值常量
- 实现ir_dump.h和ir_dump.c,提供IR转储功能的接口
- 创建scc_ir.h和scc_ir.c,实现IR对象的初始化和分配功能
- 添加测试文件test_ir.c用于验证IR库功能
- 定义了完整的IR节点类型枚举和操作类型枚举
This commit is contained in:
zzy
2026-01-08 13:43:35 +08:00
parent b753ae0911
commit c01e6e1db4
9 changed files with 401 additions and 0 deletions

10
libs/ir/cbuild.toml Normal file
View File

@@ -0,0 +1,10 @@
[package]
name = "ir"
version = "0.1.0"
authors = []
description = ""
dependencies = [{ name = "scc_core", path = "../../runtime/scc_core" }]
# dependencies = []
# features = {}
# default_features = []