authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-04 12:51:50-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-04 12:51:50-04:00
logf27d82fe90e1d0007bf2d3ef52eac8cdbc381e0d
treea5350e23ebaed579a4bb4e08eb0d01beb7d9b18e
parentdbde8254d02241d893140cb499ad25e8cbb3438a
parent36828a2e6aa6879641bf6980379dd806b6f479a1
signaturelock-open Commit is signed but in an unrecognized format.

Merge remote-tracking branch 'origin/master' into llvm7


3 files changed, 5 insertions(+), 6 deletions(-)

src/all_types.hpp-1
......@@ -1804,7 +1804,6 @@ struct VariableTableEntry {
18041804 IrExecutable *owner_exec;
18051805 size_t ref_count;
18061806 VarLinkage linkage;
1807 IrInstruction *decl_instruction;
18081807 uint32_t align_bytes;
18091808
18101809 // In an inline loop, multiple variables may be created,
src/codegen.cpp+1-1
......@@ -3041,7 +3041,7 @@ static void gen_set_stack_pointer(CodeGen *g, LLVMValueRef aligned_end_addr) {
30413041
30423042static void set_call_instr_sret(CodeGen *g, LLVMValueRef call_instr) {
30433043 unsigned attr_kind_id = LLVMGetEnumAttributeKindForName("sret", 4);
3044 LLVMAttributeRef sret_attr = LLVMCreateEnumAttribute(LLVMGetGlobalContext(), attr_kind_id, 1);
3044 LLVMAttributeRef sret_attr = LLVMCreateEnumAttribute(LLVMGetGlobalContext(), attr_kind_id, 0);
30453045 LLVMAddCallSiteAttribute(call_instr, 1, sret_attr);
30463046}
30473047
src/ir.cpp+4-4
......@@ -1446,8 +1446,6 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s
14461446 if (align_value) ir_ref_instruction(align_value, irb->current_basic_block);
14471447 ir_ref_instruction(init_value, irb->current_basic_block);
14481448
1449 var->decl_instruction = &decl_var_instruction->base;
1450
14511449 return &decl_var_instruction->base;
14521450}
14531451
......@@ -12433,8 +12431,6 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
1243312431 return var->value->type;
1243412432 }
1243512433
12436 var->ref_count = 0;
12437
1243812434 TypeTableEntry *explicit_type = nullptr;
1243912435 IrInstruction *var_type = nullptr;
1244012436 if (decl_var_instruction->var_type != nullptr) {
......@@ -12503,6 +12499,7 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
1250312499 VariableTableEntry *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope,
1250412500 &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true);
1250512501 new_var->owner_exec = var->owner_exec;
12502 new_var->align_bytes = var->align_bytes;
1250612503 if (var->mem_slot_index != SIZE_MAX) {
1250712504 ConstExprValue *vals = create_const_vals(1);
1250812505 new_var->mem_slot_index = ira->exec_context.mem_slot_list.length;
......@@ -12513,6 +12510,9 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
1251312510 var = new_var;
1251412511 }
1251512512
12513 // This must be done after possibly creating a new variable above
12514 var->ref_count = 0;
12515
1251612516 var->value->type = result_type;
1251712517 assert(var->value->type);
1251812518