aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-01-09 19:15:46 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-16 21:58:47 -0500
commitfbcee58cfcabddd3e0842e22141a983a8169502f (patch)
tree9d1c30d44988c13230a1e046d124dbaeba88f9dc /src/codegen.cpp
parent0240fd91401c8a20064da0efd5b1e8955e481f1b (diff)
downloadzig-fbcee58cfcabddd3e0842e22141a983a8169502f.tar.gz
zig-fbcee58cfcabddd3e0842e22141a983a8169502f.zip
zig ir.cpp details: remove the mem_slot mechanism
Previously, there was hacky code to deal with result locations and how they work with regards to comptime values and runtime values. In addition, there was a hacky "mem_slot" mechanism that managed the memory for local variables, and acted differently depending on comptime vs runtime situations. All that is deleted in this commit, and as a result, result locations code has one less complication. Importantly, this means that a comptime result location is now passed to a function when it is evaluated at comptime. This test causes many regressions, and some of the behavior tests are disabled (commented out) in this commit. Future commits will re-enable the tests before merging the branch.
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index cd009b3bea..c4add2ce71 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -7604,7 +7604,7 @@ static void do_code_gen(CodeGen *g) {
} else {
if (want_sret) {
g->cur_ret_ptr = LLVMGetParam(fn, 0);
- } else if (handle_is_ptr(fn_type_id->return_type)) {
+ } else if (type_has_bits(fn_type_id->return_type)) {
g->cur_ret_ptr = build_alloca(g, fn_type_id->return_type, "result", 0);
// TODO add debug info variable for this
} else {