添加了frame_alloc.h头文件定义帧分配器操作接口,实现了Windows 64位 平台的帧分配器实现,包括槽位分配、偏移计算和栈帧布局管理功能。 BREAKING CHANGE: 移除了旧的frame_manager.h接口,采用新的frame_alloc_ops_t 抽象接口。 fix(ast2ir): 修复字符串字面量表达式返回值问题 修复了AST到IR转换过程中字符串字面量表达式的处理,确保正确返回 创建的常量字符串值引用而非直接跳出。 fix(ir): 修复内置memcpy函数参数验证和类型比较逻辑 在IR构建器中为builtin_memcpy函数添加参数空指针检查,在类型比较 函数中添加未知类型的边界条件处理,增强系统稳定性。 refactor(ir2mcode): 重构寄存器分配器接口以支持帧分配器集成 修改寄存器分配器接口以接受帧分配器参数,统一节点到位置的映射表 命名,并提供便捷的栈大小和偏移获取接口。
22 lines
713 B
C
22 lines
713 B
C
#ifndef __SCC_FRAME_ALLOC_H__
|
|
#define __SCC_FRAME_ALLOC_H__
|
|
|
|
#include <scc_ir.h>
|
|
|
|
typedef struct scc_frame_alloc_ops scc_frame_alloc_ops_t;
|
|
struct scc_frame_alloc_ops {
|
|
/// maybe have direct function to new
|
|
scc_frame_alloc_ops_t *(*new)(scc_ir_func_t *func);
|
|
int (*drop)(scc_frame_alloc_ops_t *alloc);
|
|
|
|
int (*alloc_spill_slot)(scc_frame_alloc_ops_t *frame, int size, int align);
|
|
int (*alloc_local_slot)(scc_frame_alloc_ops_t *frame, int size, int align,
|
|
const char *name);
|
|
|
|
void (*finalize)(scc_frame_alloc_ops_t *frame);
|
|
int (*get_slot_offset)(scc_frame_alloc_ops_t *frame, int slot_id);
|
|
int (*get_frame_size)(scc_frame_alloc_ops_t *frame);
|
|
};
|
|
|
|
#endif
|