add compile error for unable to determine async fn frame

This commit is contained in:
Andrew Kelley 2019-08-08 13:07:05 -04:00
parent 8d4cb85285
commit 8be95af480
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 12 additions and 0 deletions

View File

@ -31,3 +31,8 @@
* grep for "coroutine" and "coro" and replace all that nomenclature with "async functions"
* when there are multiple calls to async functions in a function, reuse the same frame buffer, so that the
needed bytes is equal to the largest callee's frame
* if an async function is never called with async then a few optimizations can be made:
- the return does not need to be atomic
- it can be assumed that these are always available: the awaiter ptr, return ptr if applicable,
error return trace ptr if applicable.
- it can be assumed that it is never cancelled

View File

@ -5198,6 +5198,13 @@ static Error resolve_coro_frame(CodeGen *g, ZigType *frame_type) {
if (callee->body_node == nullptr) {
continue;
}
if (callee->anal_state == FnAnalStateProbing) {
ErrorMsg *msg = add_node_error(g, fn->proto_node,
buf_sprintf("unable to determine async function frame of '%s'", buf_ptr(&fn->symbol_name)));
add_error_note(g, msg, call->base.source_node,
buf_sprintf("analysis of function '%s' depends on the frame", buf_ptr(&callee->symbol_name)));
return ErrorSemanticAnalyzeFail;
}
analyze_fn_body(g, callee);
if (callee->anal_state == FnAnalStateInvalid) {