fix(ir): 修改了一下context的管理
This commit is contained in:
@@ -7,11 +7,6 @@
|
||||
|
||||
namespace ir {
|
||||
|
||||
Context& DefaultContext() {
|
||||
static Context ctx;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
Context::~Context() = default;
|
||||
|
||||
const std::shared_ptr<Type>& Context::Void() {
|
||||
@@ -39,7 +34,7 @@ ConstantInt* Context::GetConstInt(int v) {
|
||||
auto it = const_ints_.find(v);
|
||||
if (it != const_ints_.end()) return it->second.get();
|
||||
auto inserted =
|
||||
const_ints_.emplace(v, std::make_unique<ConstantInt>(v)).first;
|
||||
const_ints_.emplace(v, std::make_unique<ConstantInt>(Int32(), v)).first;
|
||||
return inserted->second.get();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user