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 {
26912691
26922692 IrInstruction **param_types;
26932693 IrInstruction *align_value;
2694 IrInstruction *async_allocator_type_value;
26952694 IrInstruction *return_type;
26962695 IrInstruction *async_allocator_type_value;
26972696 bool is_var_args;
src/ir.cpp+4-27
......@@ -2153,12 +2153,12 @@ static IrInstruction *ir_build_unwrap_err_payload_from(IrBuilder *irb, IrInstruc
21532153}
21542154
21552155static 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)
21572158{
21582159 IrInstructionFnProto *instruction = ir_build_instruction<IrInstructionFnProto>(irb, scope, source_node);
21592160 instruction->param_types = param_types;
21602161 instruction->align_value = align_value;
2161 instruction->async_allocator_type_value = async_allocator_type_value;
21622162 instruction->return_type = return_type;
21632163 instruction->async_allocator_type_value = async_allocator_type_value;
21642164 instruction->is_var_args = is_var_args;
......@@ -2647,17 +2647,6 @@ static IrInstruction *ir_build_coro_alloc_helper(IrBuilder *irb, Scope *scope, A
26472647 return &instruction->base;
26482648}
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
26612650static IrInstruction *ir_build_atomic_rmw(IrBuilder *irb, Scope *scope, AstNode *source_node,
26622651 IrInstruction *operand_type, IrInstruction *ptr, IrInstruction *op, IrInstruction *operand,
26632652 IrInstruction *ordering, AtomicRmwOp resolved_op, AtomicOrder resolved_ordering)
......@@ -6052,13 +6041,6 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
60526041 return irb->codegen->invalid_instruction;
60536042 }
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
60626044 IrInstruction *return_type;
60636045 if (node->data.fn_proto.return_var_token == nullptr) {
60646046 if (node->data.fn_proto.return_type == nullptr) {
......@@ -6079,7 +6061,8 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
60796061 return irb->codegen->invalid_instruction;
60806062 }
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);
60836066}
60846067
60856068static 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
1675716740 return ira->codegen->builtin_types.entry_invalid;
1675816741 }
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
1676616743 IrInstruction *return_type_value = instruction->return_type->other;
1676716744 fn_type_id.return_type = ir_resolve_type(ira, return_type_value);
1676816745 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
11461146 fprintf(irp->f, ")");
11471147}
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
11551149static void ir_print_atomic_rmw(IrPrint *irp, IrInstructionAtomicRmw *instruction) {
11561150 fprintf(irp->f, "@atomicRmw(");
11571151 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,
10371037
10381038 Token *async_token = &pc->tokens->at(*token_index);
10391039 if (async_token->id == TokenIdKeywordAsync) {
1040 size_t token_index_of_async = *token_index;
10411040 *token_index += 1;
10421041
10431042 AstNode *allocator_expr_node = nullptr;
test/cases/coroutines.zig-1
......@@ -133,7 +133,6 @@ fn early_seq(c: u8) void {
133133 early_points[early_seq_index] = c;
134134 early_seq_index += 1;
135135}
136<<<<<<< HEAD
137136
138137test "coro allocation failure" {
139138 var failing_allocator = std.debug.FailingAllocator.init(std.debug.global_allocator, 0);