authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-08 18:49:20-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-04-08 18:49:20-04:00
logacd8f6ef184c031f672fa6d6a690d831344de4b4
treefc4c75a16a6796586b9dd9eba7e8f4596cd09e08
parent8f4ad95777bb0fd14c095bf626dfc2928a7dddca

fixups from rebase


5 files changed, 4 insertions(+), 36 deletions(-)

src/all_types.hpp-1
...@@ -2691,7 +2691,6 @@ struct IrInstructionFnProto {...@@ -2691,7 +2691,6 @@ struct IrInstructionFnProto {
26912691
2692 IrInstruction **param_types;2692 IrInstruction **param_types;
2693 IrInstruction *align_value;2693 IrInstruction *align_value;
2694 IrInstruction *async_allocator_type_value;
2695 IrInstruction *return_type;2694 IrInstruction *return_type;
2696 IrInstruction *async_allocator_type_value;2695 IrInstruction *async_allocator_type_value;
2697 bool is_var_args;2696 bool is_var_args;
src/ir.cpp+4-27
...@@ -2153,12 +2153,12 @@ static IrInstruction *ir_build_unwrap_err_payload_from(IrBuilder *irb, IrInstruc...@@ -2153,12 +2153,12 @@ static IrInstruction *ir_build_unwrap_err_payload_from(IrBuilder *irb, IrInstruc
2153}2153}
21542154
2155static IrInstruction *ir_build_fn_proto(IrBuilder *irb, Scope *scope, AstNode *source_node,2155static IrInstruction *ir_build_fn_proto(IrBuilder *irb, Scope *scope, AstNode *source_node,
2156 IrInstruction **param_types, IrInstruction *align_value, IrInstruction *return_type, IrInstruction *async_allocator_type_value, bool is_var_args)2156 IrInstruction **param_types, IrInstruction *align_value, IrInstruction *return_type,
2157 IrInstruction *async_allocator_type_value, bool is_var_args)
2157{2158{
2158 IrInstructionFnProto *instruction = ir_build_instruction<IrInstructionFnProto>(irb, scope, source_node);2159 IrInstructionFnProto *instruction = ir_build_instruction<IrInstructionFnProto>(irb, scope, source_node);
2159 instruction->param_types = param_types;2160 instruction->param_types = param_types;
2160 instruction->align_value = align_value;2161 instruction->align_value = align_value;
2161 instruction->async_allocator_type_value = async_allocator_type_value;
2162 instruction->return_type = return_type;2162 instruction->return_type = return_type;
2163 instruction->async_allocator_type_value = async_allocator_type_value;2163 instruction->async_allocator_type_value = async_allocator_type_value;
2164 instruction->is_var_args = is_var_args;2164 instruction->is_var_args = is_var_args;
...@@ -2647,17 +2647,6 @@ static IrInstruction *ir_build_coro_alloc_helper(IrBuilder *irb, Scope *scope, A...@@ -2647,17 +2647,6 @@ static IrInstruction *ir_build_coro_alloc_helper(IrBuilder *irb, Scope *scope, A
2647 return &instruction->base;2647 return &instruction->base;
2648}2648}
26492649
2650static IrInstruction *ir_build_add_implicit_return_type(IrBuilder *irb, Scope *scope, AstNode *source_node,
2651 IrInstruction *value)
2652{
2653 IrInstructionAddImplicitReturnType *instruction = ir_build_instruction<IrInstructionAddImplicitReturnType>(irb, scope, source_node);
2654 instruction->value = value;
2655
2656 ir_ref_instruction(value, irb->current_basic_block);
2657
2658 return &instruction->base;
2659}
2660
2661static IrInstruction *ir_build_atomic_rmw(IrBuilder *irb, Scope *scope, AstNode *source_node,2650static IrInstruction *ir_build_atomic_rmw(IrBuilder *irb, Scope *scope, AstNode *source_node,
2662 IrInstruction *operand_type, IrInstruction *ptr, IrInstruction *op, IrInstruction *operand,2651 IrInstruction *operand_type, IrInstruction *ptr, IrInstruction *op, IrInstruction *operand,
2663 IrInstruction *ordering, AtomicRmwOp resolved_op, AtomicOrder resolved_ordering)2652 IrInstruction *ordering, AtomicRmwOp resolved_op, AtomicOrder resolved_ordering)
...@@ -6052,13 +6041,6 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo...@@ -6052,13 +6041,6 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
6052 return irb->codegen->invalid_instruction;6041 return irb->codegen->invalid_instruction;
6053 }6042 }
60546043
6055 IrInstruction *async_allocator_type_value = nullptr;
6056 if (node->data.fn_proto.async_allocator_type != nullptr) {
6057 async_allocator_type_value = ir_gen_node(irb, node->data.fn_proto.async_allocator_type, parent_scope);
6058 if (async_allocator_type_value == irb->codegen->invalid_instruction)
6059 return irb->codegen->invalid_instruction;
6060 }
6061
6062 IrInstruction *return_type;6044 IrInstruction *return_type;
6063 if (node->data.fn_proto.return_var_token == nullptr) {6045 if (node->data.fn_proto.return_var_token == nullptr) {
6064 if (node->data.fn_proto.return_type == nullptr) {6046 if (node->data.fn_proto.return_type == nullptr) {
...@@ -6079,7 +6061,8 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo...@@ -6079,7 +6061,8 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
6079 return irb->codegen->invalid_instruction;6061 return irb->codegen->invalid_instruction;
6080 }6062 }
60816063
6082 return ir_build_fn_proto(irb, parent_scope, node, param_types, align_value, return_type, async_allocator_type_value, is_var_args);6064 return ir_build_fn_proto(irb, parent_scope, node, param_types, align_value, return_type,
6065 async_allocator_type_value, is_var_args);
6083}6066}
60846067
6085static IrInstruction *ir_gen_cancel(IrBuilder *irb, Scope *parent_scope, AstNode *node) {6068static IrInstruction *ir_gen_cancel(IrBuilder *irb, Scope *parent_scope, AstNode *node) {
...@@ -16757,12 +16740,6 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc...@@ -16757,12 +16740,6 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc
16757 return ira->codegen->builtin_types.entry_invalid;16740 return ira->codegen->builtin_types.entry_invalid;
16758 }16741 }
1675916742
16760 if (instruction->async_allocator_type_value != nullptr) {
16761 fn_type_id.async_allocator_type = ir_resolve_type(ira, instruction->async_allocator_type_value->other);
16762 if (type_is_invalid(fn_type_id.async_allocator_type))
16763 return ira->codegen->builtin_types.entry_invalid;
16764 }
16765
16766 IrInstruction *return_type_value = instruction->return_type->other;16743 IrInstruction *return_type_value = instruction->return_type->other;
16767 fn_type_id.return_type = ir_resolve_type(ira, return_type_value);16744 fn_type_id.return_type = ir_resolve_type(ira, return_type_value);
16768 if (type_is_invalid(fn_type_id.return_type))16745 if (type_is_invalid(fn_type_id.return_type))
src/ir_print.cpp-6
...@@ -1146,12 +1146,6 @@ static void ir_print_coro_alloc_helper(IrPrint *irp, IrInstructionCoroAllocHelpe...@@ -1146,12 +1146,6 @@ static void ir_print_coro_alloc_helper(IrPrint *irp, IrInstructionCoroAllocHelpe
1146 fprintf(irp->f, ")");1146 fprintf(irp->f, ")");
1147}1147}
11481148
1149static void ir_print_add_implicit_return_type(IrPrint *irp, IrInstructionAddImplicitReturnType *instruction) {
1150 fprintf(irp->f, "@addImplicitReturnType(");
1151 ir_print_other_instruction(irp, instruction->value);
1152 fprintf(irp->f, ")");
1153}
1154
1155static void ir_print_atomic_rmw(IrPrint *irp, IrInstructionAtomicRmw *instruction) {1149static void ir_print_atomic_rmw(IrPrint *irp, IrInstructionAtomicRmw *instruction) {
1156 fprintf(irp->f, "@atomicRmw(");1150 fprintf(irp->f, "@atomicRmw(");
1157 if (instruction->operand_type != nullptr) {1151 if (instruction->operand_type != nullptr) {
src/parser.cpp-1
...@@ -1037,7 +1037,6 @@ static AstNode *ast_parse_suffix_op_expr(ParseContext *pc, size_t *token_index,...@@ -1037,7 +1037,6 @@ static AstNode *ast_parse_suffix_op_expr(ParseContext *pc, size_t *token_index,
10371037
1038 Token *async_token = &pc->tokens->at(*token_index);1038 Token *async_token = &pc->tokens->at(*token_index);
1039 if (async_token->id == TokenIdKeywordAsync) {1039 if (async_token->id == TokenIdKeywordAsync) {
1040 size_t token_index_of_async = *token_index;
1041 *token_index += 1;1040 *token_index += 1;
10421041
1043 AstNode *allocator_expr_node = nullptr;1042 AstNode *allocator_expr_node = nullptr;
test/cases/coroutines.zig-1
...@@ -133,7 +133,6 @@ fn early_seq(c: u8) void {...@@ -133,7 +133,6 @@ fn early_seq(c: u8) void {
133 early_points[early_seq_index] = c;133 early_points[early_seq_index] = c;
134 early_seq_index += 1;134 early_seq_index += 1;
135}135}
136<<<<<<< HEAD
137136
138test "coro allocation failure" {137test "coro allocation failure" {
139 var failing_allocator = std.debug.FailingAllocator.init(std.debug.global_allocator, 0);138 var failing_allocator = std.debug.FailingAllocator.init(std.debug.global_allocator, 0);