feat(ir): 启用LIR模块并重构HIR组件结构
- 在cbuild.toml中启用lir依赖项,取消注释相关配置 - 重构libs/README.md文档,添加详细的库说明和层级结构 - 重命名头文件以统一命名规范:ast_def.h → scc_ast_def.h, ast_dump.h → scc_ast_dump.h, hir相关文件添加scc前缀 - 更新include路径以匹配新的文件命名 - 在cfg模块中添加symbol ID类型和linkage枚举,完善符号表功能 - 实现cfg模块中的符号添加、查找和获取功能 - 修改HIR中meta字段替换原有的attribute字段,更新相关访问宏 - 修复HIR构建器中的函数元数据访问错误 - 为LIR模块创建完整的头文件结构,包括指令定义、转换器等组件
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#ifndef __SCC_HIR_H__
|
||||
#define __SCC_HIR_H__
|
||||
|
||||
#include "hir_def.h"
|
||||
#include "hir_prog.h"
|
||||
#include "scc_hir_def.h"
|
||||
#include "scc_hir_prog.h"
|
||||
|
||||
void scc_hir_type_init(scc_hir_type_t *in, scc_hir_type_tag_t tag);
|
||||
void scc_hir_bblock_init(scc_hir_bblock_t *in, const char *label);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef __SCC_HIR_BUILDER_H__
|
||||
#define __SCC_HIR_BUILDER_H__
|
||||
|
||||
#include "hir_prog.h"
|
||||
#include "scc_hir.h"
|
||||
#include "scc_hir_prog.h"
|
||||
|
||||
typedef struct scc_hir_builder scc_hir_builder_t;
|
||||
|
||||
@@ -246,10 +246,9 @@ typedef struct scc_hir_func_meta {
|
||||
} scc_hir_func_meta_t;
|
||||
|
||||
#define SCC_HIR_BBLOCK_VALUES(bblock) \
|
||||
(*(scc_hir_value_ref_vec_t *)&((bblock).values))
|
||||
((scc_hir_value_ref_vec_t *)&((bblock)->values))
|
||||
|
||||
#define SCC_HIR_BBLOCK_META(bblock) \
|
||||
((scc_hir_bblock_meta_t *)((bblock).attribute))
|
||||
#define SCC_HIR_FUNC_META(func) ((scc_hir_func_meta_t *)((func).attribute))
|
||||
#define SCC_HIR_BBLOCK_META(bblock) ((scc_hir_bblock_meta_t *)((bblock)->meta))
|
||||
#define SCC_HIR_FUNC_META(func) ((scc_hir_func_meta_t *)((func)->meta))
|
||||
|
||||
#endif /* __SCC_HIR_DEF_H__ */
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __SCC_HIR_DUMP_H__
|
||||
#define __SCC_HIR_DUMP_H__
|
||||
|
||||
#include "hir_prog.h"
|
||||
#include "scc_hir_prog.h"
|
||||
#include <scc_tree_dump.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -9,8 +9,8 @@ typedef struct {
|
||||
scc_tree_dump_t *dump_ctx;
|
||||
} scc_hir_dump_t;
|
||||
|
||||
void scc_hir_dump_ctx_init(scc_hir_dump_t *ctx, scc_tree_dump_t *tree_dump,
|
||||
scc_hir_cprog_t *cprog);
|
||||
void scc_hir_dump_init(scc_hir_dump_t *ctx, scc_tree_dump_t *tree_dump,
|
||||
scc_hir_cprog_t *cprog);
|
||||
void scc_hir_dump_value(scc_hir_dump_t *ctx, scc_hir_value_ref_t node_ref);
|
||||
void scc_hir_dump_type(scc_hir_dump_t *ctx, scc_hir_type_ref_t type_ref);
|
||||
void scc_hir_dump_bblock(scc_hir_dump_t *ctx, scc_hir_bblock_ref_t bblock_ref);
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __SCC_HIR_MODULE_H__
|
||||
#define __SCC_HIR_MODULE_H__
|
||||
|
||||
#include "hir_def.h"
|
||||
#include "scc_hir_def.h"
|
||||
#include <scc_cfg.h>
|
||||
#include <scc_hashtable.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef __SCC_HIR_PROG_H__
|
||||
#define __SCC_HIR_PROG_H__
|
||||
|
||||
#include "hir_def.h"
|
||||
#include "hir_module.h"
|
||||
#include "scc_hir_def.h"
|
||||
#include "scc_hir_module.h"
|
||||
|
||||
typedef struct scc_hir_cprog {
|
||||
scc_hir_module_t module;
|
||||
Reference in New Issue
Block a user