可以处理生成加法的IR

This commit is contained in:
jing
2025-12-28 18:44:48 +08:00
parent 77bee889d7
commit e941cced9b
42 changed files with 919 additions and 158 deletions

View File

@@ -1,4 +1,16 @@
// IR 类型系统:
// - i32/f32/void、指针、数组、函数类型等
// - 按 SysY 支持范围裁剪并逐步补齐
// 极简类型系统:仅支持 void 与 i32。
#include "ir/IR.h"
namespace ir {
std::shared_ptr<Type> Type::Void() {
static auto ty = std::make_shared<Type>(Kind::Void);
return ty;
}
std::shared_ptr<Type> Type::Int32() {
static auto ty = std::make_shared<Type>(Kind::Int32);
return ty;
}
} // namespace ir