Andrew Kelley
55f5cee86b
fix error return traces for async calls of blocking functions
2019-08-15 15:06:05 -04:00
Andrew Kelley
13b5a4bf8c
remove cancel
2019-08-15 14:05:12 -04:00
Andrew Kelley
64c293f8a4
codegen for async call of blocking function
2019-08-14 12:52:20 -04:00
Andrew Kelley
f3f838cc01
add compile error for await in exported function
2019-08-14 11:22:12 -04:00
Andrew Kelley
7799423f24
rename behavior test files
2019-08-14 00:38:27 -04:00
Andrew Kelley
5749dc49d8
respect local variable alignment in async functions
2019-08-14 00:35:51 -04:00
Andrew Kelley
dd8c8c0802
get_struct_type accepts field alignment overrides
2019-08-13 18:14:38 -04:00
Andrew Kelley
5092634103
avoid the word "coroutine", they're "async functions"
2019-08-13 14:14:19 -04:00
Andrew Kelley
82d4ebe53a
organize TODOs
2019-08-13 13:28:05 -04:00
Andrew Kelley
12ff91c1c9
alignment of structs no longer depends on LLVM
...
fixes async function tests in optimized builds
2019-08-13 12:44:30 -04:00
Andrew Kelley
8a9289996a
Merge remote-tracking branch 'origin/master' into rewrite-coroutines
2019-08-13 11:39:32 -04:00
Andrew Kelley
98183e4743
flip the order of fields in error unions
...
to prepare for fixing u128 alignment issues
2019-08-13 11:33:01 -04:00
Andrew Kelley
24d5ec0783
fix async function frames not aligned enough
2019-08-11 22:35:12 -04:00
Andrew Kelley
911b1a0428
fix no-longer-correct nonnull
attribute on merge err ret traces fn
2019-08-11 22:05:09 -04:00
Andrew Kelley
62c5bc6058
fix cancel invoking branch on undefined memory
2019-08-11 21:14:19 -04:00
Andrew Kelley
4d8d513e16
all tests passing
2019-08-11 19:53:10 -04:00
Andrew Kelley
3aed7de0c4
README: link to community projects
2019-08-11 16:09:23 -04:00
Andrew Kelley
af8c6ccb4b
fix canceling async functions which have error return tracing
2019-08-11 14:26:34 -04:00
Andrew Kelley
b87686dfa0
fix enum with one member and custom tag type
2019-08-11 13:43:44 -04:00
Andrew Kelley
1b83ee78a4
allow comptime_int to implicit cast to comptime_float
2019-08-11 12:01:02 -04:00
data-man
4bd4c5e06d
Fixed tiny typo in the math module (shr's description)
2019-08-11 08:15:42 -07:00
Andrew Kelley
3f5c6d7a89
add test case for typical async/await usage
2019-08-10 18:03:36 -04:00
Andrew Kelley
77d098e92d
fix returning a const error from async function
2019-08-10 17:23:45 -04:00
Andrew Kelley
22428a7546
fix try in an async function with error union and non-zero-bit payload
2019-08-10 15:20:08 -04:00
Andrew Kelley
b9d1d45dfd
fix combining try with errdefer cancel
2019-08-09 21:49:40 -04:00
Andrew Kelley
2e7f53f1f0
fix cancel inside an errdefer
2019-08-09 17:34:06 -04:00
Andrew Kelley
e6ebc41a07
add a little compile error to make Future Andy's life easier
2019-08-09 17:10:39 -04:00
Andrew Kelley
0bf6796b76
fix regression in std.math.min
...
closes #3035
2019-08-09 10:22:02 -04:00
Andrew Kelley
614cab5d68
fix passing string literals to async functions
2019-08-08 19:08:41 -04:00
Andrew Kelley
da56959a9a
closer to std lib event stuff working
2019-08-08 16:41:38 -04:00
Andrew Kelley
93840f8610
fix var args call on non-generic function
2019-08-08 15:34:41 -04:00
Andrew Kelley
cfe84423c9
fix segfault with var args
2019-08-08 15:13:05 -04:00
Andrew Kelley
bfa1d12fba
better compile errors when frame depends on itself
2019-08-08 13:44:57 -04:00
Andrew Kelley
8be95af480
add compile error for unable to determine async fn frame
2019-08-08 13:07:05 -04:00
Andrew Kelley
8d4cb85285
async functions in single threaded mode do not use atomic ops
2019-08-08 12:30:22 -04:00
Andrew Kelley
d813805f77
more debuggable safety for awaiting twice
2019-08-08 12:02:56 -04:00
Andrew Kelley
34bfdf193a
cancel, defer, errdefer all working as intended now
2019-08-08 11:37:49 -04:00
Andrew Kelley
e6ef00233e
Merge pull request #3025 from euantorano/fix/3015-std-os-window-rtlgenrandom
...
Fix #3015 - fix RtlGenRandom function signature
2019-08-07 14:21:54 -07:00
Euan Torano
f2bef0447a
Remove unneeded casts.
2019-08-07 22:19:25 +01:00
Sam Tebbs
8621e3b5bd
Don't emit clang error if source or filename pointer is null
2019-08-07 14:11:18 -07:00
Andrew Kelley
2cd5e55581
std.math.min: return a more restrictive type sometimes
2019-08-07 16:28:23 -04:00
Ryan Saunderson
8fcf21fefc
modify header precedence for zig cc, resolves intrinsics issues ( #3027 )
2019-08-07 10:51:30 -07:00
Andrew Kelley
e11cafbd4f
cancel works on non-pointers
2019-08-07 10:56:37 -04:00
Andrew Kelley
f587fa1cd7
clean up the bitcasting of awaiter fn ptr
2019-08-07 10:56:19 -04:00
Andrew Kelley
7e1fcb55b3
implement cancel
...
all behavior tests passing in this branch
2019-08-07 00:53:04 -04:00
Andrew Kelley
1afbb53661
fix awaiting when result type is a struct
2019-08-06 19:07:25 -04:00
Andrew Kelley
966c9ea63c
error return trace across suspend points
2019-08-06 18:47:09 -04:00
Andrew Kelley
17199b0879
passing the error return trace async function test
2019-08-06 18:29:56 -04:00
Andrew Kelley
400500a3af
improve async function semantics
...
* add safety panic for resuming a function which is returning, pending
an await
* remove IrInstructionResultPtr
* add IrInstructionReturnBegin. This does the early return in async
functions; does nothing in normal functions.
* `await` gets a result location
* `analyze_fn_async` will call `analyze_fn_body` if necessary.
* async function frames have a result pointer field for themselves
to access and one for the awaiter to supply before the atomic rmw.
when returning, async functions copy the result to the awaiter result
pointer, if it is non-null.
* async function frames have a stack trace pointer which is supplied by
the awaiter before the atomicrmw. Later in the frame is a stack trace
struct and addresses, which is used for its own calls and awaits.
* when awaiting an async function, if an early return occurred, the
awaiter tail resumes the frame.
* when an async function returns, early return does a suspend
(in IrInstructionReturnBegin) before copying
the error return trace data, result, and running the defers.
After the last defer runs, the frame will no longer be accessed.
* proper acquire/release atomic ordering attributes in async functions.
2019-08-06 16:53:22 -04:00
Euan Torano
2d25348f63
Fix function signature and use a loop to ensure buffer is filled.
2019-08-06 19:32:22 +01:00