From fbcee58cfcabddd3e0842e22141a983a8169502f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 9 Jan 2020 19:15:46 -0500 Subject: 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. --- src/ir.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ir.hpp') diff --git a/src/ir.hpp b/src/ir.hpp index 003bf4897d..4f9ed6bcdb 100644 --- a/src/ir.hpp +++ b/src/ir.hpp @@ -18,15 +18,15 @@ enum IrPass { bool ir_gen(CodeGen *g, AstNode *node, Scope *scope, IrExecutable *ir_executable); bool ir_gen_fn(CodeGen *g, ZigFn *fn_entry); -ZigValue *ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *node, - ZigType *expected_type, size_t *backward_branch_count, size_t *backward_branch_quota, +Error ir_eval_const_value(CodeGen *codegen, Scope *scope, AstNode *node, + ZigValue *return_ptr, size_t *backward_branch_count, size_t *backward_branch_quota, ZigFn *fn_entry, Buf *c_import_buf, AstNode *source_node, Buf *exec_name, IrExecutable *parent_exec, AstNode *expected_type_source_node, UndefAllowed undef); Error ir_resolve_lazy(CodeGen *codegen, AstNode *source_node, ZigValue *val); ZigType *ir_analyze(CodeGen *g, IrExecutable *old_executable, IrExecutable *new_executable, - ZigType *expected_type, AstNode *expected_type_source_node); + ZigType *expected_type, AstNode *expected_type_source_node, ZigValue *return_ptr); bool ir_has_side_effects(IrInstruction *instruction); -- cgit v1.2.3