You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
510 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 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();
}
const std::vector<std::unique_ptr<Function>>& Module::functions() const {
return functions_;
}
} // namespace ir