codegen: avoid a table lookup

master
Andrew Kelley 2016-02-01 20:05:50 -07:00
parent 0b94c83deb
commit 74eaf43768
2 changed files with 2 additions and 2 deletions

View File

@ -2515,6 +2515,7 @@ static TypeTableEntry *analyze_lvalue(CodeGen *g, ImportTableEntry *import, Bloc
expected_rhs_type = g->builtin_types.entry_invalid;
} else {
expected_rhs_type = var->type;
lhs_node->data.symbol_expr.variable = var;
}
} else {
add_node_error(g, lhs_node,

View File

@ -889,8 +889,7 @@ static LLVMValueRef gen_lvalue(CodeGen *g, AstNode *expr_node, AstNode *node,
LLVMValueRef target_ref;
if (node->type == NodeTypeSymbol) {
VariableTableEntry *var = find_variable(expr_node->block_context,
&node->data.symbol_expr.symbol);
VariableTableEntry *var = node->data.symbol_expr.variable;
assert(var);
*out_type_entry = var->type;