aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
AgeCommit message (Collapse)Author
2019-08-23better handling of lazy structsAndrew Kelley
this case works now: ```zig const A = struct { b_list_pointer: *const []B, }; const B = struct { a_pointer: *const A, }; const b_list: []B = [_]B{}; const a = A{ .b_list_pointer = &b_list }; const obj = B{ .a_pointer = &a }; ```
2019-08-23pointer types lazily evaluate their element typeAndrew Kelley
2019-08-23allow top level declarations to be lazyAndrew Kelley
this case now works: ```zig const A = struct { b: B, }; const B = fn (A) void; ```
2019-08-23add lazy value for fn prototypesAndrew Kelley
this case now works: ```zig const Node = struct { field: fn (*Node) *Node, }; ```
2019-08-23Merge remote-tracking branch 'origin/master' into fix-field-alignment-kludgeAndrew Kelley
2019-08-23Merge pull request #3114 from Tetralux/align-on-struct-fieldsAndrew Kelley
parsing and rendering of align(N) on struct fields
2019-08-23Encapsulate bigint representation, assert on cast data lossJonathan Marler
2019-08-22parsing of align(N) on struct fieldsTetralux
2019-08-22fix regressionsAndrew Kelley
2019-08-22simple self-referential struct is working nowAndrew Kelley
2019-08-22add missing "referenced here" notes for lazy valuesAndrew Kelley
2019-08-22introduce lazy valuesAndrew Kelley
see #2174
2019-08-21breaking: remove field alignment kludgeAndrew Kelley
This breaks behavior tests as well as compile error notes for generic function calls. However it introduces better circular dependency compile errors. The next step is to add Lazy Values to fix the regressions.
2019-08-20remove incorrect assert regarding 128-bit integersAndrew Kelley
LLVM incorrectly reports 8 as the alignment of i128 on x86_64 but it correctly reports 16 as the alignment of i128 on aarch64. closes #3101
2019-08-17add compile error for async frames depending on themselvesAndrew Kelley
2019-08-17detect non-async function pointer of inferred async functionAndrew Kelley
closes #3075
2019-08-16add compile error for @Frame() of generic functionAndrew Kelley
See #3063
2019-08-15fix error return traces for async calls of blocking functionsAndrew Kelley
2019-08-15remove `cancel`Andrew Kelley
2019-08-14codegen for async call of blocking functionAndrew Kelley
2019-08-14add compile error for await in exported functionAndrew Kelley
2019-08-14respect local variable alignment in async functionsAndrew Kelley
2019-08-13get_struct_type accepts field alignment overridesAndrew Kelley
2019-08-13avoid the word "coroutine", they're "async functions"Andrew Kelley
2019-08-13alignment of structs no longer depends on LLVMAndrew Kelley
fixes async function tests in optimized builds
2019-08-13Merge remote-tracking branch 'origin/master' into rewrite-coroutinesAndrew Kelley
2019-08-13flip the order of fields in error unionsAndrew Kelley
to prepare for fixing u128 alignment issues
2019-08-11fix async function frames not aligned enoughAndrew Kelley
2019-08-11all tests passingAndrew Kelley
2019-08-10fix try in an async function with error union and non-zero-bit payloadAndrew Kelley
2019-08-09fix cancel inside an errdeferAndrew Kelley
2019-08-08better compile errors when frame depends on itselfAndrew Kelley
2019-08-08add compile error for unable to determine async fn frameAndrew Kelley
2019-08-07implement cancelAndrew Kelley
all behavior tests passing in this branch
2019-08-06passing the error return trace async function testAndrew Kelley
2019-08-06improve async function semanticsAndrew Kelley
* 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-05async functions have error return traces where appropriateAndrew Kelley
however the traces are not merged on `await` or async function calls yet. When an async function has an error set or error union as its return type, it has a `StackTrace` before the args in the frame, so that it is accessible from `anyframe->T` awaiters. However when it does not have an errorable return type, but it does call or await an errorable, it has a stack trace just before the locals. This way when doing an `@asyncCall` on an async function pointer, it can populate the args (which are after the `StackTrace`) because it knows the offset of the args based only on the return type. This sort of matches normal functions, where a stack trace pointer could be supplied by a parameter, or it could be supplied by the stack of the function, depending on whether the function itself is errorable.
2019-08-05support async functions with inferred error setsAndrew Kelley
2019-08-04suspension points inside branching control flowAndrew Kelley
2019-08-03fix regression in calling extern functionsAndrew Kelley
2019-08-03implement `@asyncCall` which supports async function pointersAndrew Kelley
2019-08-03add compile error for calling async function pointerAndrew Kelley
2019-08-02implement async await and returnAndrew Kelley
2019-08-01fix calling an inferred async functionAndrew Kelley
2019-08-01reimplement async with function splitting instead of switchAndrew Kelley
2019-07-29improve support for anyframe and anyframe->TAndrew Kelley
* add implicit cast from `*@Frame(func)` to `anyframe->T` or `anyframe`. * add implicit cast from `anyframe->T` to `anyframe`. * `resume` works on `anyframe->T` and `anyframe` types.
2019-07-26add the `anyframe` and `anyframe->T` typesAndrew Kelley
2019-07-26async functions return void, no more GetSize resume blockAndrew Kelley
2019-07-25calling an inferred async functionAndrew Kelley
2019-07-24implement local variables in async functionsAndrew Kelley