#ifndef __SCC_AST2IR_H__ #define __SCC_AST2IR_H__ #include "scc_type_abi.h" #include #include #include 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__ */