Commit acd8f6ef18

Andrew Kelley <superjoe30@gmail.com>
2018-04-09 00:49:20
fixups from rebase
1 parent 8f4ad95
src/all_types.hpp
@@ -2691,7 +2691,6 @@ struct IrInstructionFnProto {
 
     IrInstruction **param_types;
     IrInstruction *align_value;
-    IrInstruction *async_allocator_type_value;
     IrInstruction *return_type;
     IrInstruction *async_allocator_type_value;
     bool is_var_args;
src/ir.cpp
@@ -2153,12 +2153,12 @@ static IrInstruction *ir_build_unwrap_err_payload_from(IrBuilder *irb, IrInstruc
 }
 
 static IrInstruction *ir_build_fn_proto(IrBuilder *irb, Scope *scope, AstNode *source_node,
-    IrInstruction **param_types, IrInstruction *align_value, IrInstruction *return_type, IrInstruction *async_allocator_type_value, bool is_var_args)
+    IrInstruction **param_types, IrInstruction *align_value, IrInstruction *return_type,
+    IrInstruction *async_allocator_type_value, bool is_var_args)
 {
     IrInstructionFnProto *instruction = ir_build_instruction<IrInstructionFnProto>(irb, scope, source_node);
     instruction->param_types = param_types;
     instruction->align_value = align_value;
-    instruction->async_allocator_type_value = async_allocator_type_value;
     instruction->return_type = return_type;
     instruction->async_allocator_type_value = async_allocator_type_value;
     instruction->is_var_args = is_var_args;
@@ -2647,17 +2647,6 @@ static IrInstruction *ir_build_coro_alloc_helper(IrBuilder *irb, Scope *scope, A
     return &instruction->base;
 }
 
-static IrInstruction *ir_build_add_implicit_return_type(IrBuilder *irb, Scope *scope, AstNode *source_node,
-        IrInstruction *value)
-{
-    IrInstructionAddImplicitReturnType *instruction = ir_build_instruction<IrInstructionAddImplicitReturnType>(irb, scope, source_node);
-    instruction->value = value;
-
-    ir_ref_instruction(value, irb->current_basic_block);
-
-    return &instruction->base;
-}
-
 static IrInstruction *ir_build_atomic_rmw(IrBuilder *irb, Scope *scope, AstNode *source_node,
         IrInstruction *operand_type, IrInstruction *ptr, IrInstruction *op, IrInstruction *operand,
         IrInstruction *ordering, AtomicRmwOp resolved_op, AtomicOrder resolved_ordering)
@@ -6052,13 +6041,6 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
             return irb->codegen->invalid_instruction;
     }
 
-    IrInstruction *async_allocator_type_value = nullptr;
-    if (node->data.fn_proto.async_allocator_type != nullptr) {
-        async_allocator_type_value = ir_gen_node(irb, node->data.fn_proto.async_allocator_type, parent_scope);
-        if (async_allocator_type_value == irb->codegen->invalid_instruction)
-            return irb->codegen->invalid_instruction;
-    }
-
     IrInstruction *return_type;
     if (node->data.fn_proto.return_var_token == nullptr) {
         if (node->data.fn_proto.return_type == nullptr) {
@@ -6079,7 +6061,8 @@ static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNo
             return irb->codegen->invalid_instruction;
     }
 
-    return ir_build_fn_proto(irb, parent_scope, node, param_types, align_value, return_type, async_allocator_type_value, is_var_args);
+    return ir_build_fn_proto(irb, parent_scope, node, param_types, align_value, return_type,
+            async_allocator_type_value, is_var_args);
 }
 
 static 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
             return ira->codegen->builtin_types.entry_invalid;
     }
 
-    if (instruction->async_allocator_type_value != nullptr) {
-        fn_type_id.async_allocator_type = ir_resolve_type(ira, instruction->async_allocator_type_value->other);
-        if (type_is_invalid(fn_type_id.async_allocator_type))
-            return ira->codegen->builtin_types.entry_invalid;
-    }
-
     IrInstruction *return_type_value = instruction->return_type->other;
     fn_type_id.return_type = ir_resolve_type(ira, return_type_value);
     if (type_is_invalid(fn_type_id.return_type))
src/ir_print.cpp
@@ -1146,12 +1146,6 @@ static void ir_print_coro_alloc_helper(IrPrint *irp, IrInstructionCoroAllocHelpe
     fprintf(irp->f, ")");
 }
 
-static void ir_print_add_implicit_return_type(IrPrint *irp, IrInstructionAddImplicitReturnType *instruction) {
-    fprintf(irp->f, "@addImplicitReturnType(");
-    ir_print_other_instruction(irp, instruction->value);
-    fprintf(irp->f, ")");
-}
-
 static void ir_print_atomic_rmw(IrPrint *irp, IrInstructionAtomicRmw *instruction) {
     fprintf(irp->f, "@atomicRmw(");
     if (instruction->operand_type != nullptr) {
src/parser.cpp
@@ -1037,7 +1037,6 @@ static AstNode *ast_parse_suffix_op_expr(ParseContext *pc, size_t *token_index,
 
     Token *async_token = &pc->tokens->at(*token_index);
     if (async_token->id == TokenIdKeywordAsync) {
-        size_t token_index_of_async = *token_index;
         *token_index += 1;
 
         AstNode *allocator_expr_node = nullptr;
test/cases/coroutines.zig
@@ -133,7 +133,6 @@ fn early_seq(c: u8) void {
     early_points[early_seq_index] = c;
     early_seq_index += 1;
 }
-<<<<<<< HEAD
 
 test "coro allocation failure" {
     var failing_allocator = std.debug.FailingAllocator.init(std.debug.global_allocator, 0);