refactor(dev): 统一 IR/MIR 接口命名风格

This commit is contained in:
Lane0218
2026-03-12 15:17:02 +08:00
parent f26551a896
commit b1155d8fa9
18 changed files with 170 additions and 167 deletions

View File

@@ -13,7 +13,7 @@ Function::Function(std::string name, std::shared_ptr<Type> ret_type)
BasicBlock* Function::CreateBlock(const std::string& name) {
auto block = std::make_unique<BasicBlock>(name);
auto* ptr = block.get();
ptr->set_parent(this);
ptr->SetParent(this);
blocks_.push_back(std::move(block));
if (!entry_) {
entry_ = ptr;
@@ -21,11 +21,11 @@ BasicBlock* Function::CreateBlock(const std::string& name) {
return ptr;
}
BasicBlock* Function::entry() { return entry_; }
BasicBlock* Function::GetEntry() { return entry_; }
const BasicBlock* Function::entry() const { return entry_; }
const BasicBlock* Function::GetEntry() const { return entry_; }
const std::vector<std::unique_ptr<BasicBlock>>& Function::blocks() const {
const std::vector<std::unique_ptr<BasicBlock>>& Function::GetBlocks() const {
return blocks_;
}