IR设计
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user