fix: 技术债修复 — codegen malloc→arena + .codegraphignore

- codegen.c: VarEntry/FnEntry/ptypes 全部改用 arena_alloc,消除 malloc/free
- codegen_module 新增 Arena* 参数,main.c 传入主 arena
- 新增 .codegraphignore 排除 build/ 和 .codegraph/
- 基于 Codex 分析报告第7节技术债务
This commit is contained in:
2026-06-05 00:37:54 +08:00
parent 3b7bab1e1b
commit f8c5e18188
5 changed files with 353 additions and 9 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ int main(int argc, char** argv) {
// 6. LLVM IR 生成
const char* codegen_error = NULL;
LLVMModuleRef module = codegen_module(ast, "l_module", &codegen_error);
LLVMModuleRef module = codegen_module(ast, &arena, "l_module", &codegen_error);
if (!module) {
fprintf(stderr, "IR 生成错误: %s\n", codegen_error);
free(source); arena_destroy(&arena);