Files
scc/libs/ast2ir/include/scc_ast2ir.h
zzy 694778e4a0 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
- 清理构建器中多余的注释和代码
2026-04-12 11:30:31 +08:00

32 lines
1.1 KiB
C

#ifndef __SCC_AST2IR_H__
#define __SCC_AST2IR_H__
#include "scc_type_abi.h"
#include <ir_builder.h>
#include <scc_ast.h>
#include <scc_ir.h>
typedef struct {
scc_ir_builder_t builder;
scc_hashtable_t ast2ir_cache; ///< ast node to ir ref cache
scc_hashtable_t symtab; ///< symbol to ir_ref
// scc_strpool_t strpool; ///< string pool
const scc_abi_type_calc_t *abi;
} scc_ast2ir_ctx_t;
void scc_ast2ir_ctx_init(scc_ast2ir_ctx_t *ctx, const scc_abi_type_calc_t *abi,
scc_ir_cprog_t *cprog);
void scc_ast2ir_ctx_drop(scc_ast2ir_ctx_t *ctx);
void scc_ast2ir_translation_unit(scc_ast2ir_ctx_t *ctx,
scc_ast_translation_unit_t *tu);
void scc_ast2ir_decl(scc_ast2ir_ctx_t *ctx, scc_ast_decl_t *decl,
cbool is_global);
scc_ir_value_ref_t scc_ast2ir_expr(scc_ast2ir_ctx_t *ctx, scc_ast_expr_t *expr,
cbool is_lvalue);
void scc_ast2ir_stmt(scc_ast2ir_ctx_t *ctx, scc_ast_stmt_t *stmt);
scc_ir_type_ref_t scc_ast2ir_type(scc_ast2ir_ctx_t *ctx,
scc_ast_type_t *ast_type);
#endif /* __SCC_AST2IR_H__ */