This commit is contained in:
jing
2025-12-29 20:11:51 +08:00
parent c153604c2e
commit e1c1f2a40d
14 changed files with 402 additions and 27 deletions

View File

@@ -1,4 +1,15 @@
// IR Module
// - 保存全局变量与函数列表
// - 维护与目标相关的模块级信息(如需要)与符号表
// - 维护与目标相关的模块级信息(如需要)
#include "ir/IR.h"
namespace ir {
Function* Module::CreateFunction(const std::string& name,
std::shared_ptr<Type> ret_type) {
functions_.push_back(std::make_unique<Function>(name, std::move(ret_type)));
return functions_.back().get();
}
} // namespace ir