fix(ir): 修改了一下context的管理
This commit is contained in:
@@ -13,6 +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);
|
||||
blocks_.push_back(std::move(block));
|
||||
if (!entry_) {
|
||||
entry_ = ptr;
|
||||
|
||||
Reference in New Issue
Block a user