feat(mir): 添加函数调用和返回指令支持

添加了间接调用函数emit_indirect_call用于处理寄存器调用,
修改直接调用函数emit_direct_call使用相对分支形式,
为函数元数据添加need_va_args字段标记变参函数需求。

refactor(prolog-epilog): 重构函数序言和尾声处理逻辑

将prolog/epilog回调函数参数从void*改为scc_mir_instr_vec_t*,
添加need_epilog回调函数用于判断是否需要插入尾声代码,
修改pass处理逻辑以支持动态插入序言和尾声代码。

feat(win64-abi): 实现Windows x64平台序言尾声生成功能

实现prologue函数生成栈帧设置和变参处理代码,
实现epilogue函数生成栈清理和返回指令,
添加need_epilog判断函数识别返回指令类型并触发尾声插入。
This commit is contained in:
zzy
2026-05-20 21:11:48 +08:00
parent c6e3bb2e20
commit aa4292a30e
7 changed files with 64 additions and 31 deletions

View File

@@ -37,6 +37,7 @@ typedef scc_cfg_bblock_t scc_mir_bblock_t;
// 函数元数据 —— 不包含任何指令结构,由各后端自行定义指令布局
typedef scc_cfg_func_t scc_mir_func_t;
typedef struct scc_mir_func_meta {
int need_va_args;
int frame_size;
int stack_alignment;
int vregs_count;