refactor(ast2ir): 重构ABI类型系统并修复union结构问题

- 将scc_ast_def.h中的attr_of从union改为struct以修复结构定义问题
- 添加type_abi依赖到ast2ir模块的cbuild.toml配置文件中
- 重命名scc_ast2ir.h中的abi字段为type_abi,并更新相关初始化函数签名
- 移除废弃的scc_abi_type.h和相关平台ABI头文件
- 添加辅助函数is_variadic_marker和fixed_param_count用于处理可变参数
- 添加数组和聚合类型初始化的辅助函数
This commit is contained in:
zzy
2026-06-01 12:14:13 +08:00
parent 8b817da3b6
commit 31d7e91ef1
45 changed files with 1918 additions and 1551 deletions

View File

@@ -17,6 +17,9 @@
#include <scc_ir2sccf.h>
#include <sccf2pe.h>
#define __SCC_TYPE_ABI_WIN_X64_IMPL__
#include <scc_type_abi_win_x64.h>
#include "config.h"
void init_platform(void);
#define GET_VALID_FP(fp) (fp == nullptr ? scc_stdout : fp)
@@ -240,10 +243,10 @@ sstream_drop:
}
scc_ast2ir_ctx_t ast2ir_ctx;
#include <target/scc_abi_win_x64_pc.h>
scc_hir_cprog_t cprog;
scc_hir_cprog_init(&cprog);
scc_ast2ir_ctx_init(&ast2ir_ctx, &scc_ast_abi_impl, &ast_module, &cprog);
scc_ast2ir_ctx_init(&ast2ir_ctx, &SCC_TYPE_ABI_WIN_X64, &ast_module,
&cprog);
scc_ast2ir_run(&ast2ir_ctx, translation_unit);
scc_ast2ir_ctx_drop(&ast2ir_ctx);