authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-23 00:41:11-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-23 00:41:11-04:00
log38568318a087394f02cba21a9617098ccb8b58ee
treef5f6ace3c6f3ad8dc1d26ffa79613fe37dffd908
parent7e303fa28feaa10d7dbf08fdc3e86c47bba882e6
signature Commit is signed but in an unrecognized format.

fix some legacy coroutine stuff


5 files changed, 26 insertions(+), 9 deletions(-)

src/ir.cpp+19-2
...@@ -15289,6 +15289,21 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn...@@ -15289,6 +15289,21 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn
15289 if (result_loc != nullptr)15289 if (result_loc != nullptr)
15290 return result_loc;15290 return result_loc;
1529115291
15292 ZigFn *fn = exec_fn_entry(ira->new_irb.exec);
15293 if (fn != nullptr && fn->type_entry->data.fn.fn_type_id.cc == CallingConventionAsync &&
15294 instruction->result_loc->id == ResultLocIdReturn)
15295 {
15296 result_loc = ir_resolve_result(ira, &instruction->base, no_result_loc(),
15297 implicit_elem_type, nullptr, false, true);
15298 if (result_loc != nullptr &&
15299 (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)))
15300 {
15301 return result_loc;
15302 }
15303 result_loc->value.special = ConstValSpecialRuntime;
15304 return result_loc;
15305 }
15306
15292 IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type);15307 IrInstruction *result = ir_const(ira, &instruction->base, implicit_elem_type);
15293 result->value.special = ConstValSpecialUndef;15308 result->value.special = ConstValSpecialUndef;
15294 IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false);15309 IrInstruction *ptr = ir_get_ref(ira, &instruction->base, result, false, false);
...@@ -16128,7 +16143,9 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c...@@ -16128,7 +16143,9 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c
16128 if (handle_is_ptr(impl_fn_type_id->return_type)) {16143 if (handle_is_ptr(impl_fn_type_id->return_type)) {
16129 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,16144 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,
16130 impl_fn_type_id->return_type, nullptr, true, true);16145 impl_fn_type_id->return_type, nullptr, true, true);
16131 if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) {16146 if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) ||
16147 instr_is_unreachable(result_loc)))
16148 {
16132 return result_loc;16149 return result_loc;
16133 }16150 }
16134 } else {16151 } else {
...@@ -16248,7 +16265,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c...@@ -16248,7 +16265,7 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCallSrc *c
16248 if (handle_is_ptr(return_type)) {16265 if (handle_is_ptr(return_type)) {
16249 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,16266 result_loc = ir_resolve_result(ira, &call_instruction->base, call_instruction->result_loc,
16250 return_type, nullptr, true, true);16267 return_type, nullptr, true, true);
16251 if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) {16268 if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) {
16252 return result_loc;16269 return result_loc;
16253 }16270 }
16254 } else {16271 } else {
std/event/lock.zig+2-2
...@@ -123,8 +123,8 @@ pub const Lock = struct {...@@ -123,8 +123,8 @@ pub const Lock = struct {
123};123};
124124
125test "std.event.Lock" {125test "std.event.Lock" {
126 // https://github.com/ziglang/zig/issues/1908126 // https://github.com/ziglang/zig/issues/2377
127 if (builtin.single_threaded) return error.SkipZigTest;127 //if (true) return error.SkipZigTest;
128128
129 var da = std.heap.DirectAllocator.init();129 var da = std.heap.DirectAllocator.init();
130 defer da.deinit();130 defer da.deinit();
std/event/net.zig+2-2
...@@ -263,8 +263,8 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !File {...@@ -263,8 +263,8 @@ pub async fn connect(loop: *Loop, _address: *const std.net.Address) !File {
263}263}
264264
265test "listen on a port, send bytes, receive bytes" {265test "listen on a port, send bytes, receive bytes" {
266 // https://github.com/ziglang/zig/issues/1908266 // https://github.com/ziglang/zig/issues/2377
267 if (builtin.single_threaded) return error.SkipZigTest;267 if (true) return error.SkipZigTest;
268268
269 if (builtin.os != builtin.Os.linux) {269 if (builtin.os != builtin.Os.linux) {
270 // TODO build abstractions for other operating systems270 // TODO build abstractions for other operating systems
std/event/rwlock.zig+2-2
...@@ -212,8 +212,8 @@ pub const RwLock = struct {...@@ -212,8 +212,8 @@ pub const RwLock = struct {
212};212};
213213
214test "std.event.RwLock" {214test "std.event.RwLock" {
215 // https://github.com/ziglang/zig/issues/1908215 // https://github.com/ziglang/zig/issues/2377
216 if (builtin.single_threaded or builtin.os != builtin.Os.linux) return error.SkipZigTest;216 if (true) return error.SkipZigTest;
217217
218 var da = std.heap.DirectAllocator.init();218 var da = std.heap.DirectAllocator.init();
219 defer da.deinit();219 defer da.deinit();
std/std.zig+1-1
...@@ -84,7 +84,7 @@ test "std" {...@@ -84,7 +84,7 @@ test "std" {
84 _ = @import("dwarf.zig");84 _ = @import("dwarf.zig");
85 _ = @import("dynamic_library.zig");85 _ = @import("dynamic_library.zig");
86 _ = @import("elf.zig");86 _ = @import("elf.zig");
87 //_ = @import("event.zig");87 _ = @import("event.zig");
88 _ = @import("fmt.zig");88 _ = @import("fmt.zig");
89 _ = @import("fs.zig");89 _ = @import("fs.zig");
90 _ = @import("hash.zig");90 _ = @import("hash.zig");