aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-27 17:12:53 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-27 17:12:53 -0500
commit132e604aa399a3bcb91996e550cf8972bd88422c (patch)
treed3cf5b48115e542200828063756934b9340d3ba8 /src/analyze.cpp
parent6e2a67724c576420c1c0f005ccebdc6b0e708724 (diff)
downloadzig-132e604aa399a3bcb91996e550cf8972bd88422c.tar.gz
zig-132e604aa399a3bcb91996e550cf8972bd88422c.zip
llvm coroutine workaround: sret functions return sret pointer
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 26924cc7db..09c5566c5f 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1026,7 +1026,10 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
gen_param_index += 1;
// after the gen_param_index += 1 because 0 is the return type
param_di_types[gen_param_index] = gen_type->di_type;
- gen_return_type = g->builtin_types.entry_void;
+
+ // as a workaround for LLVM coroutines not understanding instruction dependencies,
+ // we return the sret pointer argument instead of returning void
+ gen_return_type = gen_type;
} else {
gen_return_type = fn_type_id->return_type;
}