feat(mir): 添加寄存器分配 pass 支持

- 实现了核心寄存器分配接口 scc_reg_alloc.h
- 添加 x86_64 架构特定的寄存器分配实现
- 实现基础的虚拟寄存器到物理寄存器分配逻辑
- 支持栈槽分配和重载/存储指令生成

fix(argparse): 修复帮助信息打印中的枚举类型显示

- 将固定大小缓冲区改为动态字符串处理
- 正确显示枚举类型的选项值和可选值列表
- 使用 | 分隔符展示多个可选值

refactor(main): 调整编译流程中的 pass 阶段支持

- 更新配置文件中各编译阶段的名称定义
- 添加对寄存器分配、帧布局等中间表示 pass 的支持
- 重构主流程以支持不同 MIR 阶段的代码输出
This commit is contained in:
zzy
2026-05-11 13:18:58 +08:00
parent 902ee6dea3
commit 4f40f0d5e4
8 changed files with 311 additions and 19 deletions

View File

@@ -1,8 +1,11 @@
#include <core_pass/scc_reg_alloc.h>
#include <scc_mir_module.h>
#include <scc_mir_pass.h>
extern scc_reg_alloc_t x86_reg_alloc_hooks;
extern scc_reg_alloc_op_t x86_reg_alloc_hooks;
void scc_mir_pass(scc_mir_module_t *mir_module) {
scc_reg_alloc(&x86_reg_alloc_hooks, mir_module);
void scc_mir_pass(scc_mir_module_t *mir_module, scc_mir_pass_stage_t stage) {
scc_reg_alloc_ctx_t reg_alloc_ctx = {
.func_meta = nullptr, .instrs = nullptr, .ops = &x86_reg_alloc_hooks};
scc_reg_alloc(&reg_alloc_ctx, mir_module);
}