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:
@@ -61,10 +61,10 @@ static int infer_operand_width(const scc_x86_iform_info_t *info,
|
||||
for (int i = 0; i < info->num_explicit_ops; i++) {
|
||||
if (ops[i].kind == SCC_X86_OPR_REG && !info->ops[i].is_implicit) {
|
||||
uint16_t w;
|
||||
if (ops[i].size > 0 && ops[i].reg >= SCC_X86_REG_R8 &&
|
||||
if (ops[i].size_bits > 0 && ops[i].reg >= SCC_X86_REG_R8 &&
|
||||
ops[i].reg <= SCC_X86_REG_R15) {
|
||||
/* R8-R15:宽度由 size 字段推导 */
|
||||
w = ops[i].size * 8;
|
||||
/* R8-R15:宽度由 size_bits 字段推导(单位:bit) */
|
||||
w = ops[i].size_bits;
|
||||
} else {
|
||||
w = scc_reg_width(ops[i].reg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user