diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-02-28 04:01:22 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-02-28 04:01:22 -0500 |
| commit | 026aebf2ea567c15eebf9ddb9180f7d0e2ec7a9d (patch) | |
| tree | e01512d7d9883706d207fd701c0b89165f431880 /src/analyze.cpp | |
| parent | d24345386274e3abcbcc676fe65bda127c06ce8e (diff) | |
| download | zig-026aebf2ea567c15eebf9ddb9180f7d0e2ec7a9d.tar.gz zig-026aebf2ea567c15eebf9ddb9180f7d0e2ec7a9d.zip | |
another workaround for llvm coroutines
this one doesn't work either
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index ce9e99f8fa..be01f6b5f8 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1001,9 +1001,7 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) { bool first_arg_return = calling_convention_does_first_arg_return(fn_type_id->cc) && handle_is_ptr(fn_type_id->return_type); bool is_async = fn_type_id->cc == CallingConventionAsync; - bool prefix_arg_error_return_trace = g->have_err_ret_tracing && - (fn_type_id->return_type->id == TypeTableEntryIdErrorUnion || - fn_type_id->return_type->id == TypeTableEntryIdErrorSet); + bool prefix_arg_error_return_trace = g->have_err_ret_tracing && fn_type_can_fail(fn_type_id); // +1 for maybe making the first argument the return value // +1 for maybe first argument the error return trace // +2 for maybe arguments async allocator and error code pointer @@ -5795,3 +5793,9 @@ bool type_is_global_error_set(TypeTableEntry *err_set_type) { uint32_t get_coro_frame_align_bytes(CodeGen *g) { return g->pointer_size_bytes * 2; } + +bool fn_type_can_fail(FnTypeId *fn_type_id) { + TypeTableEntry *return_type = fn_type_id->return_type; + return return_type->id == TypeTableEntryIdErrorUnion || return_type->id == TypeTableEntryIdErrorSet || + fn_type_id->cc == CallingConventionAsync; +} |
