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:
@@ -65,10 +65,10 @@ typedef struct scc_lir_instr {
|
||||
#define SCC_LIR_ARG(n) \
|
||||
((scc_lir_val_t){.kind = SCC_LIR_INSTR_KIND_ARG, .data.arg = (n)})
|
||||
|
||||
#define SCC_LIR_SIZE_8 1
|
||||
#define SCC_LIR_SIZE_16 2
|
||||
#define SCC_LIR_SIZE_32 4
|
||||
#define SCC_LIR_SIZE_64 8
|
||||
#define SCC_LIR_SIZE_8 8
|
||||
#define SCC_LIR_SIZE_16 16
|
||||
#define SCC_LIR_SIZE_32 32
|
||||
#define SCC_LIR_SIZE_64 64
|
||||
|
||||
typedef enum {
|
||||
SCC_LIR_EXT_NONE,
|
||||
@@ -163,7 +163,7 @@ typedef enum {
|
||||
typedef scc_cfg_bblock_id_t scc_lir_bblock_id_t;
|
||||
typedef struct scc_lir_ins {
|
||||
scc_lir_op_t op;
|
||||
u8 size;
|
||||
u8 size_bits;
|
||||
scc_lir_ext_t ext;
|
||||
scc_lir_val_t to;
|
||||
scc_lir_val_t arg0;
|
||||
@@ -207,12 +207,12 @@ typedef struct scc_lir_ins {
|
||||
} parallel_copy;
|
||||
|
||||
struct scc_lir_alloca {
|
||||
int size_bytes;
|
||||
int align_bytes;
|
||||
int size_bits;
|
||||
int align_bits;
|
||||
} alloca;
|
||||
|
||||
struct scc_lir_extend {
|
||||
int from_size; // 源类型宽度(字节)
|
||||
int from_size_bits; // 源类型宽度(位)
|
||||
} extend;
|
||||
|
||||
struct {
|
||||
|
||||
Reference in New Issue
Block a user