Files
scc/libs/ir2mcode/include/scc_ir2mcode.h
zzy de6f5d510a feat(ir2mcode): 添加IR到机器码转换模块并更新依赖配置
- 新增ir2mcode库用于将IR转换为机器码
- 添加sccf2target依赖以支持目标平台转换
- 在ast库中添加scc_pos依赖支持位置信息
- 更新cbuild.toml配置文件添加新库依赖
- 实现AMD64架构代码生成功能
- 添加寄存器分配器实现栈和寄存器位置管理
- 支持基本的算术运算和内存访问操作
- 添加PE格式目标文件生成支持
2026-03-20 14:12:25 +08:00

26 lines
621 B
C

#ifndef __SCC_IR2MCODE_H__
#define __SCC_IR2MCODE_H__
#include "reg_alloc.h"
#include <scc_core.h>
#include <scc_ir.h>
#include <scc_mcode.h>
#include <sccf_builder.h>
typedef struct {
scc_ir_cprog_t *cprog;
scc_ir_cprog_ctx_t *ir_ctx;
scc_mcode_t mcode;
sccf_builder_t builder;
scc_reg_alloc_t reg_alloc;
scc_hashtable_t *noderef2regloc;
} scc_ir2mcode_ctx_t;
// amd64
void scc_ir2mcode_init(scc_ir2mcode_ctx_t *ctx, scc_ir_cprog_t *cprog,
scc_ir_cprog_ctx_t *ir_ctx, scc_mcode_arch_t arch);
void scc_ir2mcode(scc_ir2mcode_ctx_t *ctx);
#endif /* __SCC_IR2MCODE_H__ */