| ... | @@ -145,7 +145,7 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc | ... | @@ -145,7 +145,7 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc |
| 145 | static ErrorMsg *exec_add_error_node(CodeGen *codegen, IrExecutable *exec, AstNode *source_node, Buf *msg); | 145 | static ErrorMsg *exec_add_error_node(CodeGen *codegen, IrExecutable *exec, AstNode *source_node, Buf *msg); |
| 146 | static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name, | 146 | static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_name, |
| 147 | IrInstruction *source_instr, IrInstruction *container_ptr, ZigType *container_type); | 147 | IrInstruction *source_instr, IrInstruction *container_ptr, ZigType *container_type); |
| 148 | static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, VariableTableEntry *var); | 148 | static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, ZigVar *var); |
| 149 | static ZigType *ir_resolve_atomic_operand_type(IrAnalyze *ira, IrInstruction *op); | 149 | static ZigType *ir_resolve_atomic_operand_type(IrAnalyze *ira, IrInstruction *op); |
| 150 | static IrInstruction *ir_lval_wrap(IrBuilder *irb, Scope *scope, IrInstruction *value, LVal lval); | 150 | static IrInstruction *ir_lval_wrap(IrBuilder *irb, Scope *scope, IrInstruction *value, LVal lval); |
| 151 | static ZigType *adjust_ptr_align(CodeGen *g, ZigType *ptr_type, uint32_t new_align); | 151 | static ZigType *adjust_ptr_align(CodeGen *g, ZigType *ptr_type, uint32_t new_align); |
| ... | @@ -277,7 +277,7 @@ static void ir_ref_instruction(IrInstruction *instruction, IrBasicBlock *cur_bb) | ... | @@ -277,7 +277,7 @@ static void ir_ref_instruction(IrInstruction *instruction, IrBasicBlock *cur_bb) |
| 277 | ir_ref_bb(instruction->owner_bb); | 277 | ir_ref_bb(instruction->owner_bb); |
| 278 | } | 278 | } |
| 279 | | 279 | |
| 280 | static void ir_ref_var(VariableTableEntry *var) { | 280 | static void ir_ref_var(ZigVar *var) { |
| 281 | var->ref_count += 1; | 281 | var->ref_count += 1; |
| 282 | } | 282 | } |
| 283 | | 283 | |
| ... | @@ -1114,7 +1114,7 @@ static IrInstruction *ir_build_bin_op_from(IrBuilder *irb, IrInstruction *old_in | ... | @@ -1114,7 +1114,7 @@ static IrInstruction *ir_build_bin_op_from(IrBuilder *irb, IrInstruction *old_in |
| 1114 | return new_instruction; | 1114 | return new_instruction; |
| 1115 | } | 1115 | } |
| 1116 | | 1116 | |
| 1117 | static IrInstruction *ir_build_var_ptr(IrBuilder *irb, Scope *scope, AstNode *source_node, VariableTableEntry *var) { | 1117 | static IrInstruction *ir_build_var_ptr(IrBuilder *irb, Scope *scope, AstNode *source_node, ZigVar *var) { |
| 1118 | IrInstructionVarPtr *instruction = ir_build_instruction<IrInstructionVarPtr>(irb, scope, source_node); | 1118 | IrInstructionVarPtr *instruction = ir_build_instruction<IrInstructionVarPtr>(irb, scope, source_node); |
| 1119 | instruction->var = var; | 1119 | instruction->var = var; |
| 1120 | | 1120 | |
| ... | @@ -1459,7 +1459,7 @@ static IrInstruction *ir_build_store_ptr_from(IrBuilder *irb, IrInstruction *old | ... | @@ -1459,7 +1459,7 @@ static IrInstruction *ir_build_store_ptr_from(IrBuilder *irb, IrInstruction *old |
| 1459 | } | 1459 | } |
| 1460 | | 1460 | |
| 1461 | static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *source_node, | 1461 | static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 1462 | VariableTableEntry *var, IrInstruction *var_type, IrInstruction *align_value, IrInstruction *init_value) | 1462 | ZigVar *var, IrInstruction *var_type, IrInstruction *align_value, IrInstruction *init_value) |
| 1463 | { | 1463 | { |
| 1464 | IrInstructionDeclVar *decl_var_instruction = ir_build_instruction<IrInstructionDeclVar>(irb, scope, source_node); | 1464 | IrInstructionDeclVar *decl_var_instruction = ir_build_instruction<IrInstructionDeclVar>(irb, scope, source_node); |
| 1465 | decl_var_instruction->base.value.special = ConstValSpecialStatic; | 1465 | decl_var_instruction->base.value.special = ConstValSpecialStatic; |
| ... | @@ -1477,7 +1477,7 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s | ... | @@ -1477,7 +1477,7 @@ static IrInstruction *ir_build_var_decl(IrBuilder *irb, Scope *scope, AstNode *s |
| 1477 | } | 1477 | } |
| 1478 | | 1478 | |
| 1479 | static IrInstruction *ir_build_var_decl_from(IrBuilder *irb, IrInstruction *old_instruction, | 1479 | static IrInstruction *ir_build_var_decl_from(IrBuilder *irb, IrInstruction *old_instruction, |
| 1480 | VariableTableEntry *var, IrInstruction *var_type, IrInstruction *align_value, IrInstruction *init_value) | 1480 | ZigVar *var, IrInstruction *var_type, IrInstruction *align_value, IrInstruction *init_value) |
| 1481 | { | 1481 | { |
| 1482 | IrInstruction *new_instruction = ir_build_var_decl(irb, old_instruction->scope, | 1482 | IrInstruction *new_instruction = ir_build_var_decl(irb, old_instruction->scope, |
| 1483 | old_instruction->source_node, var, var_type, align_value, init_value); | 1483 | old_instruction->source_node, var, var_type, align_value, init_value); |
| ... | @@ -1622,7 +1622,7 @@ static IrInstruction *ir_build_slice_type(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -1622,7 +1622,7 @@ static IrInstruction *ir_build_slice_type(IrBuilder *irb, Scope *scope, AstNode |
| 1622 | } | 1622 | } |
| 1623 | | 1623 | |
| 1624 | static IrInstruction *ir_build_asm(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction **input_list, | 1624 | static IrInstruction *ir_build_asm(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction **input_list, |
| 1625 | IrInstruction **output_types, VariableTableEntry **output_vars, size_t return_count, bool has_side_effects) | 1625 | IrInstruction **output_types, ZigVar **output_vars, size_t return_count, bool has_side_effects) |
| 1626 | { | 1626 | { |
| 1627 | IrInstructionAsm *instruction = ir_build_instruction<IrInstructionAsm>(irb, scope, source_node); | 1627 | IrInstructionAsm *instruction = ir_build_instruction<IrInstructionAsm>(irb, scope, source_node); |
| 1628 | instruction->input_list = input_list; | 1628 | instruction->input_list = input_list; |
| ... | @@ -1646,7 +1646,7 @@ static IrInstruction *ir_build_asm(IrBuilder *irb, Scope *scope, AstNode *source | ... | @@ -1646,7 +1646,7 @@ static IrInstruction *ir_build_asm(IrBuilder *irb, Scope *scope, AstNode *source |
| 1646 | } | 1646 | } |
| 1647 | | 1647 | |
| 1648 | static IrInstruction *ir_build_asm_from(IrBuilder *irb, IrInstruction *old_instruction, IrInstruction **input_list, | 1648 | static IrInstruction *ir_build_asm_from(IrBuilder *irb, IrInstruction *old_instruction, IrInstruction **input_list, |
| 1649 | IrInstruction **output_types, VariableTableEntry **output_vars, size_t return_count, bool has_side_effects) | 1649 | IrInstruction **output_types, ZigVar **output_vars, size_t return_count, bool has_side_effects) |
| 1650 | { | 1650 | { |
| 1651 | IrInstruction *new_instruction = ir_build_asm(irb, old_instruction->scope, | 1651 | IrInstruction *new_instruction = ir_build_asm(irb, old_instruction->scope, |
| 1652 | old_instruction->source_node, input_list, output_types, output_vars, return_count, has_side_effects); | 1652 | old_instruction->source_node, input_list, output_types, output_vars, return_count, has_side_effects); |
| ... | @@ -3320,11 +3320,11 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -3320,11 +3320,11 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, |
| 3320 | zig_unreachable(); | 3320 | zig_unreachable(); |
| 3321 | } | 3321 | } |
| 3322 | | 3322 | |
| 3323 | static VariableTableEntry *create_local_var(CodeGen *codegen, AstNode *node, Scope *parent_scope, | 3323 | static ZigVar *create_local_var(CodeGen *codegen, AstNode *node, Scope *parent_scope, |
| 3324 | Buf *name, bool src_is_const, bool gen_is_const, bool is_shadowable, IrInstruction *is_comptime, | 3324 | Buf *name, bool src_is_const, bool gen_is_const, bool is_shadowable, IrInstruction *is_comptime, |
| 3325 | bool skip_name_check) | 3325 | bool skip_name_check) |
| 3326 | { | 3326 | { |
| 3327 | VariableTableEntry *variable_entry = allocate<VariableTableEntry>(1); | 3327 | ZigVar *variable_entry = allocate<ZigVar>(1); |
| 3328 | variable_entry->parent_scope = parent_scope; | 3328 | variable_entry->parent_scope = parent_scope; |
| 3329 | variable_entry->shadowable = is_shadowable; | 3329 | variable_entry->shadowable = is_shadowable; |
| 3330 | variable_entry->mem_slot_index = SIZE_MAX; | 3330 | variable_entry->mem_slot_index = SIZE_MAX; |
| ... | @@ -3336,7 +3336,7 @@ static VariableTableEntry *create_local_var(CodeGen *codegen, AstNode *node, Sco | ... | @@ -3336,7 +3336,7 @@ static VariableTableEntry *create_local_var(CodeGen *codegen, AstNode *node, Sco |
| 3336 | buf_init_from_buf(&variable_entry->name, name); | 3336 | buf_init_from_buf(&variable_entry->name, name); |
| 3337 | | 3337 | |
| 3338 | if (!skip_name_check) { | 3338 | if (!skip_name_check) { |
| 3339 | VariableTableEntry *existing_var = find_variable(codegen, parent_scope, name); | 3339 | ZigVar *existing_var = find_variable(codegen, parent_scope, name); |
| 3340 | if (existing_var && !existing_var->shadowable) { | 3340 | if (existing_var && !existing_var->shadowable) { |
| 3341 | ErrorMsg *msg = add_node_error(codegen, node, | 3341 | ErrorMsg *msg = add_node_error(codegen, node, |
| 3342 | buf_sprintf("redeclaration of variable '%s'", buf_ptr(name))); | 3342 | buf_sprintf("redeclaration of variable '%s'", buf_ptr(name))); |
| ... | @@ -3377,11 +3377,11 @@ static VariableTableEntry *create_local_var(CodeGen *codegen, AstNode *node, Sco | ... | @@ -3377,11 +3377,11 @@ static VariableTableEntry *create_local_var(CodeGen *codegen, AstNode *node, Sco |
| 3377 | | 3377 | |
| 3378 | // Set name to nullptr to make the variable anonymous (not visible to programmer). | 3378 | // Set name to nullptr to make the variable anonymous (not visible to programmer). |
| 3379 | // After you call this function var->child_scope has the variable in scope | 3379 | // After you call this function var->child_scope has the variable in scope |
| 3380 | static VariableTableEntry *ir_create_var(IrBuilder *irb, AstNode *node, Scope *scope, Buf *name, | 3380 | static ZigVar *ir_create_var(IrBuilder *irb, AstNode *node, Scope *scope, Buf *name, |
| 3381 | bool src_is_const, bool gen_is_const, bool is_shadowable, IrInstruction *is_comptime) | 3381 | bool src_is_const, bool gen_is_const, bool is_shadowable, IrInstruction *is_comptime) |
| 3382 | { | 3382 | { |
| 3383 | bool is_underscored = name ? buf_eql_str(name, "_") : false; | 3383 | bool is_underscored = name ? buf_eql_str(name, "_") : false; |
| 3384 | VariableTableEntry *var = create_local_var(irb->codegen, node, scope, | 3384 | ZigVar *var = create_local_var(irb->codegen, node, scope, |
| 3385 | (is_underscored ? nullptr : name), src_is_const, gen_is_const, | 3385 | (is_underscored ? nullptr : name), src_is_const, gen_is_const, |
| 3386 | (is_underscored ? true : is_shadowable), is_comptime, false); | 3386 | (is_underscored ? true : is_shadowable), is_comptime, false); |
| 3387 | if (is_comptime != nullptr || gen_is_const) { | 3387 | if (is_comptime != nullptr || gen_is_const) { |
| ... | @@ -3799,7 +3799,7 @@ static IrInstruction *ir_gen_symbol(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -3799,7 +3799,7 @@ static IrInstruction *ir_gen_symbol(IrBuilder *irb, Scope *scope, AstNode *node, |
| 3799 | } | 3799 | } |
| 3800 | } | 3800 | } |
| 3801 | | 3801 | |
| 3802 | VariableTableEntry *var = find_variable(irb->codegen, scope, variable_name); | 3802 | ZigVar *var = find_variable(irb->codegen, scope, variable_name); |
| 3803 | if (var) { | 3803 | if (var) { |
| 3804 | IrInstruction *var_ptr = ir_build_var_ptr(irb, scope, node, var); | 3804 | IrInstruction *var_ptr = ir_build_var_ptr(irb, scope, node, var); |
| 3805 | if (lval == LValPtr) | 3805 | if (lval == LValPtr) |
| ... | @@ -5258,7 +5258,7 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5258,7 +5258,7 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5258 | | 5258 | |
| 5259 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, | 5259 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, |
| 5260 | ir_should_inline(irb->exec, scope) || variable_declaration->is_comptime); | 5260 | ir_should_inline(irb->exec, scope) || variable_declaration->is_comptime); |
| 5261 | VariableTableEntry *var = ir_create_var(irb, node, scope, variable_declaration->symbol, | 5261 | ZigVar *var = ir_create_var(irb, node, scope, variable_declaration->symbol, |
| 5262 | is_const, is_const, is_shadowable, is_comptime); | 5262 | is_const, is_const, is_shadowable, is_comptime); |
| 5263 | // we detect IrInstructionIdDeclVar in gen_block to make sure the next node | 5263 | // we detect IrInstructionIdDeclVar in gen_block to make sure the next node |
| 5264 | // is inside var->child_scope | 5264 | // is inside var->child_scope |
| ... | @@ -5320,7 +5320,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5320,7 +5320,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5320 | | 5320 | |
| 5321 | Scope *payload_scope; | 5321 | Scope *payload_scope; |
| 5322 | AstNode *symbol_node = node; // TODO make more accurate | 5322 | AstNode *symbol_node = node; // TODO make more accurate |
| 5323 | VariableTableEntry *payload_var; | 5323 | ZigVar *payload_var; |
| 5324 | if (var_symbol) { | 5324 | if (var_symbol) { |
| 5325 | // TODO make it an error to write to payload variable | 5325 | // TODO make it an error to write to payload variable |
| 5326 | payload_var = ir_create_var(irb, symbol_node, subexpr_scope, var_symbol, | 5326 | payload_var = ir_create_var(irb, symbol_node, subexpr_scope, var_symbol, |
| ... | @@ -5384,7 +5384,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5384,7 +5384,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5384 | | 5384 | |
| 5385 | // TODO make it an error to write to error variable | 5385 | // TODO make it an error to write to error variable |
| 5386 | AstNode *err_symbol_node = else_node; // TODO make more accurate | 5386 | AstNode *err_symbol_node = else_node; // TODO make more accurate |
| 5387 | VariableTableEntry *err_var = ir_create_var(irb, err_symbol_node, scope, err_symbol, | 5387 | ZigVar *err_var = ir_create_var(irb, err_symbol_node, scope, err_symbol, |
| 5388 | true, false, false, is_comptime); | 5388 | true, false, false, is_comptime); |
| 5389 | Scope *err_scope = err_var->child_scope; | 5389 | Scope *err_scope = err_var->child_scope; |
| 5390 | IrInstruction *err_var_value = ir_build_unwrap_err_code(irb, err_scope, err_symbol_node, err_val_ptr); | 5390 | IrInstruction *err_var_value = ir_build_unwrap_err_code(irb, err_scope, err_symbol_node, err_val_ptr); |
| ... | @@ -5413,7 +5413,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5413,7 +5413,7 @@ static IrInstruction *ir_gen_while_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 5413 | // TODO make it an error to write to payload variable | 5413 | // TODO make it an error to write to payload variable |
| 5414 | AstNode *symbol_node = node; // TODO make more accurate | 5414 | AstNode *symbol_node = node; // TODO make more accurate |
| 5415 | | 5415 | |
| 5416 | VariableTableEntry *payload_var = ir_create_var(irb, symbol_node, subexpr_scope, var_symbol, | 5416 | ZigVar *payload_var = ir_create_var(irb, symbol_node, subexpr_scope, var_symbol, |
| 5417 | true, false, false, is_comptime); | 5417 | true, false, false, is_comptime); |
| 5418 | Scope *child_scope = payload_var->child_scope; | 5418 | Scope *child_scope = payload_var->child_scope; |
| 5419 | IrInstruction *maybe_val_ptr = ir_gen_node_extra(irb, node->data.while_expr.condition, subexpr_scope, LValPtr); | 5419 | IrInstruction *maybe_val_ptr = ir_gen_node_extra(irb, node->data.while_expr.condition, subexpr_scope, LValPtr); |
| ... | @@ -5585,7 +5585,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -5585,7 +5585,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 5585 | | 5585 | |
| 5586 | // TODO make it an error to write to element variable or i variable. | 5586 | // TODO make it an error to write to element variable or i variable. |
| 5587 | Buf *elem_var_name = elem_node->data.symbol_expr.symbol; | 5587 | Buf *elem_var_name = elem_node->data.symbol_expr.symbol; |
| 5588 | VariableTableEntry *elem_var = ir_create_var(irb, elem_node, parent_scope, elem_var_name, true, false, false, is_comptime); | 5588 | ZigVar *elem_var = ir_create_var(irb, elem_node, parent_scope, elem_var_name, true, false, false, is_comptime); |
| 5589 | Scope *child_scope = elem_var->child_scope; | 5589 | Scope *child_scope = elem_var->child_scope; |
| 5590 | | 5590 | |
| 5591 | IrInstruction *undefined_value = ir_build_const_undefined(irb, child_scope, elem_node); | 5591 | IrInstruction *undefined_value = ir_build_const_undefined(irb, child_scope, elem_node); |
| ... | @@ -5593,7 +5593,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -5593,7 +5593,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 5593 | IrInstruction *elem_var_ptr = ir_build_var_ptr(irb, child_scope, node, elem_var); | 5593 | IrInstruction *elem_var_ptr = ir_build_var_ptr(irb, child_scope, node, elem_var); |
| 5594 | | 5594 | |
| 5595 | AstNode *index_var_source_node; | 5595 | AstNode *index_var_source_node; |
| 5596 | VariableTableEntry *index_var; | 5596 | ZigVar *index_var; |
| 5597 | if (index_node) { | 5597 | if (index_node) { |
| 5598 | index_var_source_node = index_node; | 5598 | index_var_source_node = index_node; |
| 5599 | Buf *index_var_name = index_node->data.symbol_expr.symbol; | 5599 | Buf *index_var_name = index_node->data.symbol_expr.symbol; |
| ... | @@ -5798,7 +5798,7 @@ static IrInstruction *ir_gen_asm_expr(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5798,7 +5798,7 @@ static IrInstruction *ir_gen_asm_expr(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5798 | | 5798 | |
| 5799 | IrInstruction **input_list = allocate<IrInstruction *>(node->data.asm_expr.input_list.length); | 5799 | IrInstruction **input_list = allocate<IrInstruction *>(node->data.asm_expr.input_list.length); |
| 5800 | IrInstruction **output_types = allocate<IrInstruction *>(node->data.asm_expr.output_list.length); | 5800 | IrInstruction **output_types = allocate<IrInstruction *>(node->data.asm_expr.output_list.length); |
| 5801 | VariableTableEntry **output_vars = allocate<VariableTableEntry *>(node->data.asm_expr.output_list.length); | 5801 | ZigVar **output_vars = allocate<ZigVar *>(node->data.asm_expr.output_list.length); |
| 5802 | size_t return_count = 0; | 5802 | size_t return_count = 0; |
| 5803 | bool is_volatile = node->data.asm_expr.is_volatile; | 5803 | bool is_volatile = node->data.asm_expr.is_volatile; |
| 5804 | if (!is_volatile && node->data.asm_expr.output_list.length == 0) { | 5804 | if (!is_volatile && node->data.asm_expr.output_list.length == 0) { |
| ... | @@ -5822,7 +5822,7 @@ static IrInstruction *ir_gen_asm_expr(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -5822,7 +5822,7 @@ static IrInstruction *ir_gen_asm_expr(IrBuilder *irb, Scope *scope, AstNode *nod |
| 5822 | output_types[i] = return_type; | 5822 | output_types[i] = return_type; |
| 5823 | } else { | 5823 | } else { |
| 5824 | Buf *variable_name = asm_output->variable_name; | 5824 | Buf *variable_name = asm_output->variable_name; |
| 5825 | VariableTableEntry *var = find_variable(irb->codegen, scope, variable_name); | 5825 | ZigVar *var = find_variable(irb->codegen, scope, variable_name); |
| 5826 | if (var) { | 5826 | if (var) { |
| 5827 | output_vars[i] = var; | 5827 | output_vars[i] = var; |
| 5828 | } else { | 5828 | } else { |
| ... | @@ -5880,7 +5880,7 @@ static IrInstruction *ir_gen_test_expr(IrBuilder *irb, Scope *scope, AstNode *no | ... | @@ -5880,7 +5880,7 @@ static IrInstruction *ir_gen_test_expr(IrBuilder *irb, Scope *scope, AstNode *no |
| 5880 | IrInstruction *var_type = nullptr; | 5880 | IrInstruction *var_type = nullptr; |
| 5881 | bool is_shadowable = false; | 5881 | bool is_shadowable = false; |
| 5882 | bool is_const = true; | 5882 | bool is_const = true; |
| 5883 | VariableTableEntry *var = ir_create_var(irb, node, subexpr_scope, | 5883 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| 5884 | var_symbol, is_const, is_const, is_shadowable, is_comptime); | 5884 | var_symbol, is_const, is_const, is_shadowable, is_comptime); |
| 5885 | | 5885 | |
| 5886 | IrInstruction *var_ptr_value = ir_build_unwrap_maybe(irb, subexpr_scope, node, maybe_val_ptr, false); | 5886 | IrInstruction *var_ptr_value = ir_build_unwrap_maybe(irb, subexpr_scope, node, maybe_val_ptr, false); |
| ... | @@ -5955,7 +5955,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -5955,7 +5955,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 5955 | IrInstruction *var_type = nullptr; | 5955 | IrInstruction *var_type = nullptr; |
| 5956 | bool is_shadowable = false; | 5956 | bool is_shadowable = false; |
| 5957 | IrInstruction *var_is_comptime = force_comptime ? ir_build_const_bool(irb, subexpr_scope, node, true) : ir_build_test_comptime(irb, subexpr_scope, node, err_val); | 5957 | IrInstruction *var_is_comptime = force_comptime ? ir_build_const_bool(irb, subexpr_scope, node, true) : ir_build_test_comptime(irb, subexpr_scope, node, err_val); |
| 5958 | VariableTableEntry *var = ir_create_var(irb, node, subexpr_scope, | 5958 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| 5959 | var_symbol, var_is_const, var_is_const, is_shadowable, var_is_comptime); | 5959 | var_symbol, var_is_const, var_is_const, is_shadowable, var_is_comptime); |
| 5960 | | 5960 | |
| 5961 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, subexpr_scope, node, err_val_ptr, false); | 5961 | IrInstruction *var_ptr_value = ir_build_unwrap_err_payload(irb, subexpr_scope, node, err_val_ptr, false); |
| ... | @@ -5981,7 +5981,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -5981,7 +5981,7 @@ static IrInstruction *ir_gen_if_err_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 5981 | IrInstruction *var_type = nullptr; | 5981 | IrInstruction *var_type = nullptr; |
| 5982 | bool is_shadowable = false; | 5982 | bool is_shadowable = false; |
| 5983 | bool is_const = true; | 5983 | bool is_const = true; |
| 5984 | VariableTableEntry *var = ir_create_var(irb, node, subexpr_scope, | 5984 | ZigVar *var = ir_create_var(irb, node, subexpr_scope, |
| 5985 | err_symbol, is_const, is_const, is_shadowable, is_comptime); | 5985 | err_symbol, is_const, is_const, is_shadowable, is_comptime); |
| 5986 | | 5986 | |
| 5987 | IrInstruction *var_value = ir_build_unwrap_err_code(irb, subexpr_scope, node, err_val_ptr); | 5987 | IrInstruction *var_value = ir_build_unwrap_err_code(irb, subexpr_scope, node, err_val_ptr); |
| ... | @@ -6029,7 +6029,7 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit | ... | @@ -6029,7 +6029,7 @@ static bool ir_gen_switch_prong_expr(IrBuilder *irb, Scope *scope, AstNode *swit |
| 6029 | | 6029 | |
| 6030 | bool is_shadowable = false; | 6030 | bool is_shadowable = false; |
| 6031 | bool is_const = true; | 6031 | bool is_const = true; |
| 6032 | VariableTableEntry *var = ir_create_var(irb, var_symbol_node, scope, | 6032 | ZigVar *var = ir_create_var(irb, var_symbol_node, scope, |
| 6033 | var_name, is_const, is_const, is_shadowable, var_is_comptime); | 6033 | var_name, is_const, is_const, is_shadowable, var_is_comptime); |
| 6034 | child_scope = var->child_scope; | 6034 | child_scope = var->child_scope; |
| 6035 | IrInstruction *var_value; | 6035 | IrInstruction *var_value; |
| ... | @@ -6494,7 +6494,7 @@ static IrInstruction *ir_gen_err_ok_or(IrBuilder *irb, Scope *parent_scope, AstN | ... | @@ -6494,7 +6494,7 @@ static IrInstruction *ir_gen_err_ok_or(IrBuilder *irb, Scope *parent_scope, AstN |
| 6494 | Buf *var_name = var_node->data.symbol_expr.symbol; | 6494 | Buf *var_name = var_node->data.symbol_expr.symbol; |
| 6495 | bool is_const = true; | 6495 | bool is_const = true; |
| 6496 | bool is_shadowable = false; | 6496 | bool is_shadowable = false; |
| 6497 | VariableTableEntry *var = ir_create_var(irb, node, parent_scope, var_name, | 6497 | ZigVar *var = ir_create_var(irb, node, parent_scope, var_name, |
| 6498 | is_const, is_const, is_shadowable, is_comptime); | 6498 | is_const, is_const, is_shadowable, is_comptime); |
| 6499 | err_scope = var->child_scope; | 6499 | err_scope = var->child_scope; |
| 6500 | IrInstruction *err_val = ir_build_unwrap_err_code(irb, err_scope, node, err_union_ptr); | 6500 | IrInstruction *err_val = ir_build_unwrap_err_code(irb, err_scope, node, err_union_ptr); |
| ... | @@ -6976,7 +6976,7 @@ static IrInstruction *ir_gen_await_expr(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -6976,7 +6976,7 @@ static IrInstruction *ir_gen_await_expr(IrBuilder *irb, Scope *scope, AstNode *n |
| 6976 | IrInstruction *is_canceled_mask = ir_build_const_usize(irb, scope, node, 0x1); // 0b001 | 6976 | IrInstruction *is_canceled_mask = ir_build_const_usize(irb, scope, node, 0x1); // 0b001 |
| 6977 | IrInstruction *is_suspended_mask = ir_build_const_usize(irb, scope, node, 0x2); // 0b010 | 6977 | IrInstruction *is_suspended_mask = ir_build_const_usize(irb, scope, node, 0x2); // 0b010 |
| 6978 | | 6978 | |
| 6979 | VariableTableEntry *result_var = ir_create_var(irb, node, scope, nullptr, | 6979 | ZigVar *result_var = ir_create_var(irb, node, scope, nullptr, |
| 6980 | false, false, true, const_bool_false); | 6980 | false, false, true, const_bool_false); |
| 6981 | IrInstruction *target_promise_type = ir_build_typeof(irb, scope, node, target_inst); | 6981 | IrInstruction *target_promise_type = ir_build_typeof(irb, scope, node, target_inst); |
| 6982 | IrInstruction *promise_result_type = ir_build_promise_result_type(irb, scope, node, target_promise_type); | 6982 | IrInstruction *promise_result_type = ir_build_promise_result_type(irb, scope, node, target_promise_type); |
| ... | @@ -7388,12 +7388,12 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec | ... | @@ -7388,12 +7388,12 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 7388 | IrInstruction *err_ret_trace_ptr; | 7388 | IrInstruction *err_ret_trace_ptr; |
| 7389 | ZigType *return_type; | 7389 | ZigType *return_type; |
| 7390 | Buf *result_ptr_field_name; | 7390 | Buf *result_ptr_field_name; |
| 7391 | VariableTableEntry *coro_size_var; | 7391 | ZigVar *coro_size_var; |
| 7392 | if (is_async) { | 7392 | if (is_async) { |
| 7393 | // create the coro promise | 7393 | // create the coro promise |
| 7394 | Scope *coro_scope = create_coro_prelude_scope(node, scope); | 7394 | Scope *coro_scope = create_coro_prelude_scope(node, scope); |
| 7395 | const_bool_false = ir_build_const_bool(irb, coro_scope, node, false); | 7395 | const_bool_false = ir_build_const_bool(irb, coro_scope, node, false); |
| 7396 | VariableTableEntry *promise_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); | 7396 | ZigVar *promise_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); |
| 7397 | | 7397 | |
| 7398 | return_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; | 7398 | return_type = fn_entry->type_entry->data.fn.fn_type_id.return_type; |
| 7399 | IrInstruction *undef = ir_build_const_undefined(irb, coro_scope, node); | 7399 | IrInstruction *undef = ir_build_const_undefined(irb, coro_scope, node); |
| ... | @@ -7403,7 +7403,7 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec | ... | @@ -7403,7 +7403,7 @@ bool ir_gen(CodeGen *codegen, AstNode *node, Scope *scope, IrExecutable *ir_exec |
| 7403 | ir_build_var_decl(irb, coro_scope, node, promise_var, coro_frame_type_value, nullptr, undef); | 7403 | ir_build_var_decl(irb, coro_scope, node, promise_var, coro_frame_type_value, nullptr, undef); |
| 7404 | coro_promise_ptr = ir_build_var_ptr(irb, coro_scope, node, promise_var); | 7404 | coro_promise_ptr = ir_build_var_ptr(irb, coro_scope, node, promise_var); |
| 7405 | | 7405 | |
| 7406 | VariableTableEntry *await_handle_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); | 7406 | ZigVar *await_handle_var = ir_create_var(irb, node, coro_scope, nullptr, false, false, true, const_bool_false); |
| 7407 | IrInstruction *null_value = ir_build_const_null(irb, coro_scope, node); | 7407 | IrInstruction *null_value = ir_build_const_null(irb, coro_scope, node); |
| 7408 | IrInstruction *await_handle_type_val = ir_build_const_type(irb, coro_scope, node, | 7408 | IrInstruction *await_handle_type_val = ir_build_const_type(irb, coro_scope, node, |
| 7409 | get_optional_type(irb->codegen, irb->codegen->builtin_types.entry_promise)); | 7409 | get_optional_type(irb->codegen, irb->codegen->builtin_types.entry_promise)); |
| ... | @@ -12518,7 +12518,7 @@ static ZigType *ir_analyze_instruction_bin_op(IrAnalyze *ira, IrInstructionBinOp | ... | @@ -12518,7 +12518,7 @@ static ZigType *ir_analyze_instruction_bin_op(IrAnalyze *ira, IrInstructionBinOp |
| 12518 | | 12518 | |
| 12519 | static ZigType *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstructionDeclVar *decl_var_instruction) { | 12519 | static ZigType *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstructionDeclVar *decl_var_instruction) { |
| 12520 | Error err; | 12520 | Error err; |
| 12521 | VariableTableEntry *var = decl_var_instruction->var; | 12521 | ZigVar *var = decl_var_instruction->var; |
| 12522 | | 12522 | |
| 12523 | IrInstruction *init_value = decl_var_instruction->init_value->other; | 12523 | IrInstruction *init_value = decl_var_instruction->init_value->other; |
| 12524 | if (type_is_invalid(init_value->value.type)) { | 12524 | if (type_is_invalid(init_value->value.type)) { |
| ... | @@ -12591,7 +12591,7 @@ static ZigType *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstructionDec | ... | @@ -12591,7 +12591,7 @@ static ZigType *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstructionDec |
| 12591 | // This means that this is actually a different variable due to, e.g. an inline while loop. | 12591 | // This means that this is actually a different variable due to, e.g. an inline while loop. |
| 12592 | // We make a new variable so that it can hold a different type, and so the debug info can | 12592 | // We make a new variable so that it can hold a different type, and so the debug info can |
| 12593 | // be distinct. | 12593 | // be distinct. |
| 12594 | VariableTableEntry *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope, | 12594 | ZigVar *new_var = create_local_var(ira->codegen, var->decl_node, var->child_scope, |
| 12595 | &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true); | 12595 | &var->name, var->src_is_const, var->gen_is_const, var->shadowable, var->is_comptime, true); |
| 12596 | new_var->owner_exec = var->owner_exec; | 12596 | new_var->owner_exec = var->owner_exec; |
| 12597 | new_var->align_bytes = var->align_bytes; | 12597 | new_var->align_bytes = var->align_bytes; |
| ... | @@ -12902,7 +12902,7 @@ IrInstruction *ir_get_implicit_allocator(IrAnalyze *ira, IrInstruction *source_i | ... | @@ -12902,7 +12902,7 @@ IrInstruction *ir_get_implicit_allocator(IrAnalyze *ira, IrInstruction *source_i |
| 12902 | } | 12902 | } |
| 12903 | case ImplicitAllocatorIdLocalVar: | 12903 | case ImplicitAllocatorIdLocalVar: |
| 12904 | { | 12904 | { |
| 12905 | VariableTableEntry *coro_allocator_var = ira->old_irb.exec->coro_allocator_var; | 12905 | ZigVar *coro_allocator_var = ira->old_irb.exec->coro_allocator_var; |
| 12906 | assert(coro_allocator_var != nullptr); | 12906 | assert(coro_allocator_var != nullptr); |
| 12907 | IrInstruction *var_ptr_inst = ir_get_var_ptr(ira, source_instr, coro_allocator_var); | 12907 | IrInstruction *var_ptr_inst = ir_get_var_ptr(ira, source_instr, coro_allocator_var); |
| 12908 | IrInstruction *result = ir_get_deref(ira, source_instr, var_ptr_inst); | 12908 | IrInstruction *result = ir_get_deref(ira, source_instr, var_ptr_inst); |
| ... | @@ -12977,7 +12977,7 @@ static bool ir_analyze_fn_call_inline_arg(IrAnalyze *ira, AstNode *fn_proto_node | ... | @@ -12977,7 +12977,7 @@ static bool ir_analyze_fn_call_inline_arg(IrAnalyze *ira, AstNode *fn_proto_node |
| 12977 | return false; | 12977 | return false; |
| 12978 | | 12978 | |
| 12979 | Buf *param_name = param_decl_node->data.param_decl.name; | 12979 | Buf *param_name = param_decl_node->data.param_decl.name; |
| 12980 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, | 12980 | ZigVar *var = add_variable(ira->codegen, param_decl_node, |
| 12981 | *exec_scope, param_name, true, arg_val, nullptr); | 12981 | *exec_scope, param_name, true, arg_val, nullptr); |
| 12982 | *exec_scope = var->child_scope; | 12982 | *exec_scope = var->child_scope; |
| 12983 | *next_proto_i += 1; | 12983 | *next_proto_i += 1; |
| ... | @@ -13035,7 +13035,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod | ... | @@ -13035,7 +13035,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod |
| 13035 | Buf *param_name = param_decl_node->data.param_decl.name; | 13035 | Buf *param_name = param_decl_node->data.param_decl.name; |
| 13036 | if (!param_name) return false; | 13036 | if (!param_name) return false; |
| 13037 | if (!is_var_args) { | 13037 | if (!is_var_args) { |
| 13038 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, | 13038 | ZigVar *var = add_variable(ira->codegen, param_decl_node, |
| 13039 | *child_scope, param_name, true, arg_val, nullptr); | 13039 | *child_scope, param_name, true, arg_val, nullptr); |
| 13040 | *child_scope = var->child_scope; | 13040 | *child_scope = var->child_scope; |
| 13041 | var->shadowable = !comptime_arg; | 13041 | var->shadowable = !comptime_arg; |
| ... | @@ -13067,7 +13067,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod | ... | @@ -13067,7 +13067,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod |
| 13067 | return true; | 13067 | return true; |
| 13068 | } | 13068 | } |
| 13069 | | 13069 | |
| 13070 | static VariableTableEntry *get_fn_var_by_index(ZigFn *fn_entry, size_t index) { | 13070 | static ZigVar *get_fn_var_by_index(ZigFn *fn_entry, size_t index) { |
| 13071 | size_t next_var_i = 0; | 13071 | size_t next_var_i = 0; |
| 13072 | FnGenParamInfo *gen_param_info = fn_entry->type_entry->data.fn.gen_param_info; | 13072 | FnGenParamInfo *gen_param_info = fn_entry->type_entry->data.fn.gen_param_info; |
| 13073 | assert(gen_param_info != nullptr); | 13073 | assert(gen_param_info != nullptr); |
| ... | @@ -13086,7 +13086,7 @@ static VariableTableEntry *get_fn_var_by_index(ZigFn *fn_entry, size_t index) { | ... | @@ -13086,7 +13086,7 @@ static VariableTableEntry *get_fn_var_by_index(ZigFn *fn_entry, size_t index) { |
| 13086 | } | 13086 | } |
| 13087 | | 13087 | |
| 13088 | static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | 13088 | static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 13089 | VariableTableEntry *var) | 13089 | ZigVar *var) |
| 13090 | { | 13090 | { |
| 13091 | Error err; | 13091 | Error err; |
| 13092 | while (var->next_var != nullptr) { | 13092 | while (var->next_var != nullptr) { |
| ... | @@ -13449,7 +13449,7 @@ static ZigType *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *call_instr | ... | @@ -13449,7 +13449,7 @@ static ZigType *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *call_instr |
| 13449 | found_first_var_arg = true; | 13449 | found_first_var_arg = true; |
| 13450 | } | 13450 | } |
| 13451 | | 13451 | |
| 13452 | VariableTableEntry *arg_var = get_fn_var_by_index(parent_fn_entry, arg_tuple_i); | 13452 | ZigVar *arg_var = get_fn_var_by_index(parent_fn_entry, arg_tuple_i); |
| 13453 | if (arg_var == nullptr) { | 13453 | if (arg_var == nullptr) { |
| 13454 | ir_add_error(ira, arg, | 13454 | ir_add_error(ira, arg, |
| 13455 | buf_sprintf("compiler bug: var args can't handle void. https://github.com/ziglang/zig/issues/557")); | 13455 | buf_sprintf("compiler bug: var args can't handle void. https://github.com/ziglang/zig/issues/557")); |
| ... | @@ -13496,7 +13496,7 @@ static ZigType *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *call_instr | ... | @@ -13496,7 +13496,7 @@ static ZigType *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *call_instr |
| 13496 | | 13496 | |
| 13497 | ConstExprValue *var_args_val = create_const_arg_tuple(ira->codegen, | 13497 | ConstExprValue *var_args_val = create_const_arg_tuple(ira->codegen, |
| 13498 | first_var_arg, inst_fn_type_id.param_count); | 13498 | first_var_arg, inst_fn_type_id.param_count); |
| 13499 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, | 13499 | ZigVar *var = add_variable(ira->codegen, param_decl_node, |
| 13500 | impl_fn->child_scope, param_name, true, var_args_val, nullptr); | 13500 | impl_fn->child_scope, param_name, true, var_args_val, nullptr); |
| 13501 | impl_fn->child_scope = var->child_scope; | 13501 | impl_fn->child_scope = var->child_scope; |
| 13502 | } | 13502 | } |
| ... | @@ -14158,7 +14158,7 @@ static ZigType *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPhi *phi | ... | @@ -14158,7 +14158,7 @@ static ZigType *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPhi *phi |
| 14158 | } | 14158 | } |
| 14159 | | 14159 | |
| 14160 | static ZigType *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | 14160 | static ZigType *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 14161 | VariableTableEntry *var) | 14161 | ZigVar *var) |
| 14162 | { | 14162 | { |
| 14163 | IrInstruction *result = ir_get_var_ptr(ira, instruction, var); | 14163 | IrInstruction *result = ir_get_var_ptr(ira, instruction, var); |
| 14164 | ir_link_new_instruction(result, instruction); | 14164 | ir_link_new_instruction(result, instruction); |
| ... | @@ -14166,7 +14166,7 @@ static ZigType *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | ... | @@ -14166,7 +14166,7 @@ static ZigType *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 14166 | } | 14166 | } |
| 14167 | | 14167 | |
| 14168 | static ZigType *ir_analyze_instruction_var_ptr(IrAnalyze *ira, IrInstructionVarPtr *var_ptr_instruction) { | 14168 | static ZigType *ir_analyze_instruction_var_ptr(IrAnalyze *ira, IrInstructionVarPtr *var_ptr_instruction) { |
| 14169 | VariableTableEntry *var = var_ptr_instruction->var; | 14169 | ZigVar *var = var_ptr_instruction->var; |
| 14170 | return ir_analyze_var_ptr(ira, &var_ptr_instruction->base, var); | 14170 | return ir_analyze_var_ptr(ira, &var_ptr_instruction->base, var); |
| 14171 | } | 14171 | } |
| 14172 | | 14172 | |
| ... | @@ -14291,7 +14291,7 @@ static ZigType *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstructionEle | ... | @@ -14291,7 +14291,7 @@ static ZigType *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstructionEle |
| 14291 | size_t abs_index = start + index; | 14291 | size_t abs_index = start + index; |
| 14292 | ZigFn *fn_entry = exec_fn_entry(ira->new_irb.exec); | 14292 | ZigFn *fn_entry = exec_fn_entry(ira->new_irb.exec); |
| 14293 | assert(fn_entry); | 14293 | assert(fn_entry); |
| 14294 | VariableTableEntry *var = get_fn_var_by_index(fn_entry, abs_index); | 14294 | ZigVar *var = get_fn_var_by_index(fn_entry, abs_index); |
| 14295 | bool is_const = true; | 14295 | bool is_const = true; |
| 14296 | bool is_volatile = false; | 14296 | bool is_volatile = false; |
| 14297 | if (var) { | 14297 | if (var) { |
| ... | @@ -14693,7 +14693,7 @@ static ZigType *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source_instru | ... | @@ -14693,7 +14693,7 @@ static ZigType *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source_instru |
| 14693 | case TldIdVar: | 14693 | case TldIdVar: |
| 14694 | { | 14694 | { |
| 14695 | TldVar *tld_var = (TldVar *)tld; | 14695 | TldVar *tld_var = (TldVar *)tld; |
| 14696 | VariableTableEntry *var = tld_var->var; | 14696 | ZigVar *var = tld_var->var; |
| 14697 | if (tld_var->extern_lib_name != nullptr) { | 14697 | if (tld_var->extern_lib_name != nullptr) { |
| 14698 | add_link_lib_symbol(ira, tld_var->extern_lib_name, &var->name, source_instruction->source_node); | 14698 | add_link_lib_symbol(ira, tld_var->extern_lib_name, &var->name, source_instruction->source_node); |
| 14699 | } | 14699 | } |
| ... | @@ -16976,7 +16976,7 @@ static ZigType *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, Zig | ... | @@ -16976,7 +16976,7 @@ static ZigType *ir_type_info_get_type(IrAnalyze *ira, const char *type_name, Zig |
| 16976 | TldVar *tld = (TldVar *)entry; | 16976 | TldVar *tld = (TldVar *)entry; |
| 16977 | assert(tld->base.id == TldIdVar); | 16977 | assert(tld->base.id == TldIdVar); |
| 16978 | | 16978 | |
| 16979 | VariableTableEntry *var = tld->var; | 16979 | ZigVar *var = tld->var; |
| 16980 | | 16980 | |
| 16981 | if ((err = ensure_complete_type(ira->codegen, var->value->type))) | 16981 | if ((err = ensure_complete_type(ira->codegen, var->value->type))) |
| 16982 | return ira->codegen->builtin_types.entry_invalid; | 16982 | return ira->codegen->builtin_types.entry_invalid; |
| ... | @@ -17074,7 +17074,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Sco | ... | @@ -17074,7 +17074,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Sco |
| 17074 | switch (curr_entry->value->id) { | 17074 | switch (curr_entry->value->id) { |
| 17075 | case TldIdVar: | 17075 | case TldIdVar: |
| 17076 | { | 17076 | { |
| 17077 | VariableTableEntry *var = ((TldVar *)curr_entry->value)->var; | 17077 | ZigVar *var = ((TldVar *)curr_entry->value)->var; |
| 17078 | if ((err = ensure_complete_type(ira->codegen, var->value->type))) | 17078 | if ((err = ensure_complete_type(ira->codegen, var->value->type))) |
| 17079 | return ErrorSemanticAnalyzeFail; | 17079 | return ErrorSemanticAnalyzeFail; |
| 17080 | | 17080 | |
| ... | @@ -17191,7 +17191,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Sco | ... | @@ -17191,7 +17191,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Sco |
| 17191 | | 17191 | |
| 17192 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) | 17192 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) |
| 17193 | { | 17193 | { |
| 17194 | VariableTableEntry *arg_var = fn_entry->variable_list.at(fn_arg_index); | 17194 | ZigVar *arg_var = fn_entry->variable_list.at(fn_arg_index); |
| 17195 | ConstExprValue *fn_arg_name_val = &fn_arg_name_array->data.x_array.s_none.elements[fn_arg_index]; | 17195 | ConstExprValue *fn_arg_name_val = &fn_arg_name_array->data.x_array.s_none.elements[fn_arg_index]; |
| 17196 | ConstExprValue *arg_name = create_const_str_lit(ira->codegen, &arg_var->name); | 17196 | ConstExprValue *arg_name = create_const_str_lit(ira->codegen, &arg_var->name); |
| 17197 | init_const_slice(ira->codegen, fn_arg_name_val, arg_name, 0, buf_len(&arg_var->name), true); | 17197 | init_const_slice(ira->codegen, fn_arg_name_val, arg_name, 0, buf_len(&arg_var->name), true); |
| ... | @@ -20317,7 +20317,7 @@ static ZigType *ir_analyze_instruction_decl_ref(IrAnalyze *ira, | ... | @@ -20317,7 +20317,7 @@ static ZigType *ir_analyze_instruction_decl_ref(IrAnalyze *ira, |
| 20317 | case TldIdVar: | 20317 | case TldIdVar: |
| 20318 | { | 20318 | { |
| 20319 | TldVar *tld_var = (TldVar *)tld; | 20319 | TldVar *tld_var = (TldVar *)tld; |
| 20320 | VariableTableEntry *var = tld_var->var; | 20320 | ZigVar *var = tld_var->var; |
| 20321 | | 20321 | |
| 20322 | IrInstruction *var_ptr = ir_get_var_ptr(ira, &instruction->base, var); | 20322 | IrInstruction *var_ptr = ir_get_var_ptr(ira, &instruction->base, var); |
| 20323 | if (type_is_invalid(var_ptr->value.type)) | 20323 | if (type_is_invalid(var_ptr->value.type)) |