[PYTHON] Fixed bug in scoping mechanism (#111)

Inline functions didn't restore scope of parents. Also some control flow
structure still had the scoping semantics of C++
This commit is contained in:
Philippe Tillet
2021-05-18 23:04:31 -04:00
committed by Philippe Tillet
parent 9f30af76fb
commit 325ee38581
4 changed files with 22 additions and 39 deletions

View File

@@ -94,7 +94,7 @@ ir::value *module::get_value_recursive(const std::string& name, ir::basic_block
ir::value *result;
bool is_const = const_.find(name) != const_.end();
auto &preds = block->get_predecessors();
ir::type *ty = get_scope().get_type(name);
ir::type *ty = types_.at(name);
if(block && !is_const && sealed_blocks_.find(block) == sealed_blocks_.end()){
incomplete_phis_[block][name] = make_phi(ty, 1, block);
result = (ir::value*)incomplete_phis_[block][name];