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:
@@ -2,6 +2,7 @@
|
||||
#include <sccf2pe.h>
|
||||
#include <sccf_builder.h>
|
||||
#include <stdio.h>
|
||||
#include <x86/scc_x86_patch.h>
|
||||
|
||||
int main() {
|
||||
char data[] = "Hello, World from SCC PE Builder!\n\0";
|
||||
@@ -56,13 +57,13 @@ int main() {
|
||||
.offset = 7,
|
||||
.sect_type = SCCF_SECT_CODE,
|
||||
.sym_idx = str_idx,
|
||||
.reloc_type = SCCF_RELOC_TYPE_REL});
|
||||
.reloc_type = SCC_X86_OPR_RELBR});
|
||||
sccf_builder_add_reloc(&builder,
|
||||
(sccf_reloc_t){.addend = 4,
|
||||
.offset = 13,
|
||||
.sect_type = SCCF_SECT_CODE,
|
||||
.sym_idx = puts_idx,
|
||||
.reloc_type = SCCF_RELOC_TYPE_REL});
|
||||
.reloc_type = SCC_X86_OPR_RELBR});
|
||||
const sccf_t *sccf = sccf_builder_to_sccf(&builder);
|
||||
|
||||
scc_pe_builder_t pe_builder;
|
||||
|
||||
Reference in New Issue
Block a user