feat(cbuild): 更新项目配置以支持HIR中间表示
- 统一包名格式化,添加空格对齐 - 将依赖项从ir和lir重命名为hir,移除lir注释 - 为ast2ir模块添加正确的包名称"scc_ast2ir" - 更新依赖引用路径指向新的HIR库结构 - 移除注释掉的ir2mcode和sccf2target依赖项 refactor(ast2ir): 迁移到HIR中间表示替换IR表示 - 更新头文件包含,使用hir_builder.h替代ir_builder.h - 修改上下文结构体,将scc_ir_builder_t替换为scc_hir_builder_t - 更新函数签名,将参数类型从scc_ir_*转换为scc_hir_* - 调整返回值类型,将scc_ir_value_ref_t和scc_ir_type_ref_t 分别替换为scc_hir_value_ref_t和scc_hir_type_ref_t - 重新排列头文件包含顺序以满足依赖关系
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = ""
|
||||
version = "0.1.0"
|
||||
authors = []
|
||||
name = "scc_ast2ir"
|
||||
version = "0.1.0"
|
||||
authors = []
|
||||
description = ""
|
||||
|
||||
dependencies = [
|
||||
{ name = "scc_ast", path = "../ast" },
|
||||
{ name = "scc_ir", path = "../ir" },
|
||||
{ name = "scc_hir", path = "../ir/hir" },
|
||||
{ name = "scc_abi", path = "../abi" },
|
||||
]
|
||||
# features = {}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#ifndef __SCC_AST2IR_H__
|
||||
#define __SCC_AST2IR_H__
|
||||
|
||||
#include "scc_type_abi.h"
|
||||
#include <ir_builder.h>
|
||||
#include <hir_builder.h>
|
||||
#include <scc_ast.h>
|
||||
#include <scc_ir.h>
|
||||
#include <scc_type_abi.h>
|
||||
|
||||
typedef struct {
|
||||
scc_ir_builder_t builder;
|
||||
scc_hir_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
|
||||
@@ -16,17 +15,18 @@ typedef struct {
|
||||
} 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);
|
||||
scc_hir_cprog_t *cprog);
|
||||
void scc_ast2ir_ctx_drop(scc_ast2ir_ctx_t *ctx);
|
||||
|
||||
void scc_ast2ir_translation_unit(scc_ast2ir_ctx_t *ctx,
|
||||
const scc_ast_translation_unit_t *tu);
|
||||
void scc_ast2ir_decl(scc_ast2ir_ctx_t *ctx, const scc_ast_decl_t *decl,
|
||||
cbool is_global);
|
||||
scc_ir_value_ref_t scc_ast2ir_expr(scc_ast2ir_ctx_t *ctx,
|
||||
const scc_ast_expr_t *expr, cbool is_lvalue);
|
||||
scc_hir_value_ref_t scc_ast2ir_expr(scc_ast2ir_ctx_t *ctx,
|
||||
const scc_ast_expr_t *expr,
|
||||
cbool is_lvalue);
|
||||
void scc_ast2ir_stmt(scc_ast2ir_ctx_t *ctx, const scc_ast_stmt_t *stmt);
|
||||
scc_ir_type_ref_t scc_ast2ir_type(scc_ast2ir_ctx_t *ctx,
|
||||
const scc_ast_type_t *ast_type);
|
||||
scc_hir_type_ref_t scc_ast2ir_type(scc_ast2ir_ctx_t *ctx,
|
||||
const scc_ast_type_t *ast_type);
|
||||
|
||||
#endif /* __SCC_AST2IR_H__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user