- 重构ast_dump.c中的宏定义,简化PRINT_VALUE、PRINT_NODE、 PRINT_QUOTED_VALUE等宏的实现 - 移除冗余的PRINT_COLORED宏定义 - 统一使用SCC_TREE_DUMP_PRINT_PURE和SCC_TREE_DUMP_PRINT_AROUND 宏进行转储输出 - 在dump_stmt_impl函数中优化节点转储逻辑,统一使用end_node_dump 替代手动换行 - 添加对未知节点类型的警告日志输出 - 创建新的ast2ir模块,包含AST到IR的基本转换功能 - 实现ast_type_to_ir_type、ast_expr_to_ir、ast_stmt_to_ir、 ast_decl_to_ir等核心转换函数 - 更新IR库依赖配置,添加scc_utils和tree_dump依赖 - 新增IR基础接口定义文件ir_base.h和IR构建器接口ir_builder.h
22 lines
665 B
C
22 lines
665 B
C
#ifndef __SCC_IR_DUMP_H__
|
|
#define __SCC_IR_DUMP_H__
|
|
|
|
#include "ir_ctx.h"
|
|
#include "ir_def.h"
|
|
#include <tree_dump.h>
|
|
|
|
typedef struct {
|
|
scc_ir_cprog_ctx_t *ir_ctx;
|
|
scc_ir_cprog_t *cprog;
|
|
scc_tree_dump_ctx_t *dump_ctx;
|
|
} scc_ir_dump_ctx_t;
|
|
void scc_ir_dump_ctx_init();
|
|
|
|
void scc_ir_dump_node(scc_ir_dump_ctx_t *ctx, scc_ir_node_ref_t node_ref);
|
|
void scc_ir_dump_type(scc_ir_dump_ctx_t *ctx, scc_ir_type_ref_t type_ref);
|
|
void scc_ir_dump_bblock(scc_ir_dump_ctx_t *ctx, scc_ir_bblock_ref_t bblock_ref);
|
|
void scc_ir_dump_func(scc_ir_dump_ctx_t *ctx, scc_ir_func_ref_t func_ref);
|
|
void scc_ir_dump_cprog(scc_ir_dump_ctx_t *ctx);
|
|
|
|
#endif /* __SCC_IR_DUMP_H__ */
|