feat(abi): 新增ABI类型布局描述接口和Windows x64实现
- 新增scc_abi包,包含基础类型布局描述接口 - 实现Windows x64 ABI类型布局计算功能 - 定义基本类型枚举和布局信息结构体 - 提供类型布局计算的核心接口函数 refactor(ast2ir): 使用新的ABI接口替换旧的类型转换实现 - 将旧的scc_type_abi_t替换为新的scc_abi_type_calc_t - 更新AST到IR的类型转换逻辑,使用新的ABI计算接口 - 修改上下文初始化和类型解析相关代码 - 移除废弃的头文件和相关实现 refactor(ir): 统一IR节点引用类型命名并完善构建器功能 - 将scc_ir_node_ref_vec_t重命名为scc_ir_value_ref_vec_t保持一致性 - 更新聚合类型的字段名称从elements到fields - 添加全局变量分配构建器函数scc_ir_builder_global_alloca - 清理构建器中多余的注释和代码
This commit is contained in:
@@ -12,7 +12,7 @@ typedef SCC_VEC(u8) scc_ir_buffer_t;
|
||||
|
||||
typedef struct scc_ir_value scc_ir_value_t;
|
||||
typedef ir_handle_t scc_ir_value_ref_t;
|
||||
typedef SCC_VEC(scc_ir_value_ref_t) scc_ir_node_ref_vec_t;
|
||||
typedef SCC_VEC(scc_ir_value_ref_t) scc_ir_value_ref_vec_t;
|
||||
|
||||
typedef struct scc_ir_type scc_ir_type_t;
|
||||
typedef ir_handle_t scc_ir_type_ref_t;
|
||||
@@ -63,7 +63,7 @@ struct scc_ir_type {
|
||||
scc_ir_type_ref_t base;
|
||||
} pointer;
|
||||
struct {
|
||||
scc_ir_type_ref_vec_t elements;
|
||||
scc_ir_type_ref_vec_t fields;
|
||||
} aggregate;
|
||||
struct {
|
||||
scc_ir_type_ref_vec_t params;
|
||||
@@ -74,14 +74,14 @@ struct scc_ir_type {
|
||||
|
||||
struct scc_ir_bblock {
|
||||
scc_ir_label_t label;
|
||||
scc_ir_node_ref_vec_t instrs;
|
||||
scc_ir_value_ref_vec_t instrs;
|
||||
// ir_arr_t used_by;
|
||||
}; // basic block
|
||||
|
||||
struct scc_ir_func {
|
||||
scc_ir_label_t name;
|
||||
scc_ir_type_ref_t type;
|
||||
scc_ir_node_ref_vec_t params;
|
||||
scc_ir_value_ref_vec_t params;
|
||||
scc_ir_bblock_ref_vec_t bblocks;
|
||||
};
|
||||
|
||||
@@ -225,7 +225,7 @@ typedef enum {
|
||||
struct scc_ir_value {
|
||||
scc_ir_type_ref_t type;
|
||||
scc_ir_label_t name;
|
||||
scc_ir_node_ref_vec_t used_by;
|
||||
scc_ir_value_ref_vec_t used_by;
|
||||
scc_ir_value_tag_t tag;
|
||||
union {
|
||||
scc_ir_builtin_t builtin;
|
||||
@@ -234,10 +234,10 @@ struct scc_ir_value {
|
||||
scc_ir_const_float_t const_float;
|
||||
struct {
|
||||
scc_ir_value_ref_t base_type;
|
||||
scc_ir_buffer_t elements;
|
||||
scc_ir_buffer_t fields;
|
||||
} const_array;
|
||||
struct {
|
||||
scc_ir_node_ref_vec_t elements;
|
||||
scc_ir_value_ref_vec_t fields;
|
||||
} aggregate;
|
||||
struct {
|
||||
usize idx;
|
||||
@@ -276,7 +276,7 @@ struct scc_ir_value {
|
||||
} jump;
|
||||
struct {
|
||||
scc_ir_func_ref_t callee; // TODO function pointer call
|
||||
scc_ir_node_ref_vec_t args;
|
||||
scc_ir_value_ref_vec_t args;
|
||||
} call;
|
||||
struct {
|
||||
scc_ir_value_ref_t ret_val;
|
||||
|
||||
Reference in New Issue
Block a user