[code generation]: more progress for instruction selection

This commit is contained in:
Philippe Tillet
2019-01-26 02:05:56 -05:00
parent e2de27dfe2
commit e522b06be2
8 changed files with 91 additions and 34 deletions

View File

@@ -523,7 +523,8 @@ ir::value *assignment_expression::codegen(ir::module *mod) const{
mod->set_value(x->id()->name(), rvalue);
else if(auto* x = dynamic_cast<const unary_operator*>(lvalue_)){
assert(x->get_op()==DEREF);
ir::value *ptr = x->codegen(mod);
assert(x->lvalue());
ir::value *ptr = x->lvalue()->codegen(mod);
mod->get_builder().create_store(ptr, rvalue);
}
return rvalue;