refactor std to use for loop

This commit is contained in:
Andrew Kelley
2016-01-18 07:04:57 -07:00
parent fbbef14013
commit 4c50606b9d
4 changed files with 7 additions and 12 deletions

View File

@@ -1790,7 +1790,7 @@ static LLVMValueRef gen_for_expr(CodeGen *g, AstNode *node) {
LLVMBasicBlockRef body_block = LLVMAppendBasicBlock(g->cur_fn->fn_value, "ForBody");
LLVMBasicBlockRef end_block = LLVMAppendBasicBlock(g->cur_fn->fn_value, "ForEnd");
LLVMValueRef array_val = gen_expr(g, node->data.for_expr.array_expr);
LLVMValueRef array_val = gen_array_base_ptr(g, node->data.for_expr.array_expr);
add_debug_source_node(g, node);
LLVMBuildStore(g->builder, LLVMConstNull(index_var->type->type_ref), index_ptr);
LLVMValueRef len_val;