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 {...@@ -1804,7 +1804,6 @@ struct VariableTableEntry {
1804 IrExecutable *owner_exec;1804 IrExecutable *owner_exec;
1805 size_t ref_count;1805 size_t ref_count;
1806 VarLinkage linkage;1806 VarLinkage linkage;
1807 IrInstruction *decl_instruction;
1808 uint32_t align_bytes;1807 uint32_t align_bytes;
18091808
1810 // In an inline loop, multiple variables may be created,1809 // 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) {...@@ -3041,7 +3041,7 @@ static void gen_set_stack_pointer(CodeGen *g, LLVMValueRef aligned_end_addr) {
30413041
3042static void set_call_instr_sret(CodeGen *g, LLVMValueRef call_instr) {3042static void set_call_instr_sret(CodeGen *g, LLVMValueRef call_instr) {
3043 unsigned attr_kind_id = LLVMGetEnumAttributeKindForName("sret", 4);3043 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);
3045 LLVMAddCallSiteAttribute(call_instr, 1, sret_attr);3045 LLVMAddCallSiteAttribute(call_instr, 1, sret_attr);
3046}3046}
30473047
src/ir.cpp+4-4
...@@ -1446,8 +1446,6 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s...@@ -1446,8 +1446,6 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s
1446 if (align_value) ir_ref_instruction(align_value, irb->current_basic_block);1446 if (align_value) ir_ref_instruction(align_value, irb->current_basic_block);
1447 ir_ref_instruction(init_value, irb->current_basic_block);1447 ir_ref_instruction(init_value, irb->current_basic_block);
14481448
1449 var->decl_instruction = &decl_var_instruction->base;
1450
1451 return &decl_var_instruction->base;1449 return &decl_var_instruction->base;
1452}1450}
14531451
...@@ -12433,8 +12431,6 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc...@@ -12433,8 +12431,6 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
12433 return var->value->type;12431 return var->value->type;
12434 }12432 }
1243512433
12436 var->ref_count = 0;
12437
12438 TypeTableEntry *explicit_type = nullptr;12434 TypeTableEntry *explicit_type = nullptr;
12439 IrInstruction *var_type = nullptr;12435 IrInstruction *var_type = nullptr;
12440 if (decl_var_instruction->var_type != nullptr) {12436 if (decl_var_instruction->var_type != nullptr) {
...@@ -12503,6 +12499,7 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc...@@ -12503,6 +12499,7 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
12503 VariableTableEntry *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope,12499 VariableTableEntry *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope,
12504 &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true);12500 &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true);
12505 new_var->owner_exec = var->owner_exec;12501 new_var->owner_exec = var->owner_exec;
12502 new_var->align_bytes = var->align_bytes;
12506 if (var->mem_slot_index != SIZE_MAX) {12503 if (var->mem_slot_index != SIZE_MAX) {
12507 ConstExprValue *vals = create_const_vals(1);12504 ConstExprValue *vals = create_const_vals(1);
12508 new_var->mem_slot_index = ira->exec_context.mem_slot_list.length;12505 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...@@ -12513,6 +12510,9 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc
12513 var = new_var;12510 var = new_var;
12514 }12511 }
1251512512
12513 // This must be done after possibly creating a new variable above
12514 var->ref_count = 0;
12515
12516 var->value->type = result_type;12516 var->value->type = result_type;
12517 assert(var->value->type);12517 assert(var->value->type);
1251812518