| ... | @@ -307,6 +307,10 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionStaticEval *) { | ... | @@ -307,6 +307,10 @@ static constexpr IrInstructionId ir_instruction_id(IrInstructionStaticEval *) { |
| 307 | return IrInstructionIdStaticEval; | 307 | return IrInstructionIdStaticEval; |
| 308 | } | 308 | } |
| 309 | | 309 | |
| | 310 | static constexpr IrInstructionId ir_instruction_id(IrInstructionGeneratedCode *) { |
| | 311 | return IrInstructionIdGeneratedCode; |
| | 312 | } |
| | 313 | |
| 310 | static constexpr IrInstructionId ir_instruction_id(IrInstructionImport *) { | 314 | static constexpr IrInstructionId ir_instruction_id(IrInstructionImport *) { |
| 311 | return IrInstructionIdImport; | 315 | return IrInstructionIdImport; |
| 312 | } | 316 | } |
| ... | @@ -616,19 +620,20 @@ static IrInstruction *ir_build_const_usize(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -616,19 +620,20 @@ static IrInstruction *ir_build_const_usize(IrBuilder *irb, Scope *scope, AstNode |
| 616 | } | 620 | } |
| 617 | | 621 | |
| 618 | static IrInstruction *ir_create_const_type(IrBuilder *irb, Scope *scope, AstNode *source_node, | 622 | static IrInstruction *ir_create_const_type(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 619 | TypeTableEntry *type_entry) | 623 | TypeTableEntry *type_entry, bool depends_on_compile_var) |
| 620 | { | 624 | { |
| 621 | IrInstructionConst *const_instruction = ir_create_instruction<IrInstructionConst>(irb, scope, source_node); | 625 | IrInstructionConst *const_instruction = ir_create_instruction<IrInstructionConst>(irb, scope, source_node); |
| 622 | const_instruction->base.value.type = irb->codegen->builtin_types.entry_type; | 626 | const_instruction->base.value.type = irb->codegen->builtin_types.entry_type; |
| 623 | const_instruction->base.value.special = ConstValSpecialStatic; | 627 | const_instruction->base.value.special = ConstValSpecialStatic; |
| | 628 | const_instruction->base.value.depends_on_compile_var = depends_on_compile_var; |
| 624 | const_instruction->base.value.data.x_type = type_entry; | 629 | const_instruction->base.value.data.x_type = type_entry; |
| 625 | return &const_instruction->base; | 630 | return &const_instruction->base; |
| 626 | } | 631 | } |
| 627 | | 632 | |
| 628 | static IrInstruction *ir_build_const_type(IrBuilder *irb, Scope *scope, AstNode *source_node, | 633 | static IrInstruction *ir_build_const_type(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| 629 | TypeTableEntry *type_entry) | 634 | TypeTableEntry *type_entry, bool depends_on_compile_var) |
| 630 | { | 635 | { |
| 631 | IrInstruction *instruction = ir_create_const_type(irb, scope, source_node, type_entry); | 636 | IrInstruction *instruction = ir_create_const_type(irb, scope, source_node, type_entry, depends_on_compile_var); |
| 632 | ir_instruction_append(irb->current_basic_block, instruction); | 637 | ir_instruction_append(irb->current_basic_block, instruction); |
| 633 | return instruction; | 638 | return instruction; |
| 634 | } | 639 | } |
| ... | @@ -1392,6 +1397,17 @@ static IrInstruction *ir_build_static_eval(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -1392,6 +1397,17 @@ static IrInstruction *ir_build_static_eval(IrBuilder *irb, Scope *scope, AstNode |
| 1392 | return &instruction->base; | 1397 | return &instruction->base; |
| 1393 | } | 1398 | } |
| 1394 | | 1399 | |
| | 1400 | static IrInstruction *ir_build_generated_code(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| | 1401 | IrInstruction *value) |
| | 1402 | { |
| | 1403 | IrInstructionGeneratedCode *instruction = ir_build_instruction<IrInstructionGeneratedCode>(irb, scope, source_node); |
| | 1404 | instruction->value = value; |
| | 1405 | |
| | 1406 | ir_ref_instruction(value, irb->current_basic_block); |
| | 1407 | |
| | 1408 | return &instruction->base; |
| | 1409 | } |
| | 1410 | |
| 1395 | static IrInstruction *ir_build_import(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *name) { | 1411 | static IrInstruction *ir_build_import(IrBuilder *irb, Scope *scope, AstNode *source_node, IrInstruction *name) { |
| 1396 | IrInstructionImport *instruction = ir_build_instruction<IrInstructionImport>(irb, scope, source_node); | 1412 | IrInstructionImport *instruction = ir_build_instruction<IrInstructionImport>(irb, scope, source_node); |
| 1397 | instruction->name = name; | 1413 | instruction->name = name; |
| ... | @@ -2258,6 +2274,13 @@ static IrInstruction *ir_instruction_staticeval_get_dep(IrInstructionStaticEval | ... | @@ -2258,6 +2274,13 @@ static IrInstruction *ir_instruction_staticeval_get_dep(IrInstructionStaticEval |
| 2258 | } | 2274 | } |
| 2259 | } | 2275 | } |
| 2260 | | 2276 | |
| | 2277 | static IrInstruction *ir_instruction_generatedcode_get_dep(IrInstructionGeneratedCode *instruction, size_t index) { |
| | 2278 | switch (index) { |
| | 2279 | case 0: return instruction->value; |
| | 2280 | default: return nullptr; |
| | 2281 | } |
| | 2282 | } |
| | 2283 | |
| 2261 | static IrInstruction *ir_instruction_import_get_dep(IrInstructionImport *instruction, size_t index) { | 2284 | static IrInstruction *ir_instruction_import_get_dep(IrInstructionImport *instruction, size_t index) { |
| 2262 | switch (index) { | 2285 | switch (index) { |
| 2263 | case 0: return instruction->name; | 2286 | case 0: return instruction->name; |
| ... | @@ -2645,6 +2668,8 @@ static IrInstruction *ir_instruction_get_dep(IrInstruction *instruction, size_t | ... | @@ -2645,6 +2668,8 @@ static IrInstruction *ir_instruction_get_dep(IrInstruction *instruction, size_t |
| 2645 | return ir_instruction_ctz_get_dep((IrInstructionCtz *) instruction, index); | 2668 | return ir_instruction_ctz_get_dep((IrInstructionCtz *) instruction, index); |
| 2646 | case IrInstructionIdStaticEval: | 2669 | case IrInstructionIdStaticEval: |
| 2647 | return ir_instruction_staticeval_get_dep((IrInstructionStaticEval *) instruction, index); | 2670 | return ir_instruction_staticeval_get_dep((IrInstructionStaticEval *) instruction, index); |
| | 2671 | case IrInstructionIdGeneratedCode: |
| | 2672 | return ir_instruction_generatedcode_get_dep((IrInstructionGeneratedCode *) instruction, index); |
| 2648 | case IrInstructionIdImport: | 2673 | case IrInstructionIdImport: |
| 2649 | return ir_instruction_import_get_dep((IrInstructionImport *) instruction, index); | 2674 | return ir_instruction_import_get_dep((IrInstructionImport *) instruction, index); |
| 2650 | case IrInstructionIdCImport: | 2675 | case IrInstructionIdCImport: |
| ... | @@ -2846,7 +2871,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -2846,7 +2871,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, |
| 2846 | is_comptime = ir_build_test_comptime(irb, scope, node, is_err); | 2871 | is_comptime = ir_build_test_comptime(irb, scope, node, is_err); |
| 2847 | } | 2872 | } |
| 2848 | | 2873 | |
| 2849 | ir_build_cond_br(irb, scope, node, is_err, err_block, ok_block, is_comptime); | 2874 | ir_mark_gen(ir_build_cond_br(irb, scope, node, is_err, err_block, ok_block, is_comptime)); |
| 2850 | | 2875 | |
| 2851 | ir_set_cursor_at_end(irb, err_block); | 2876 | ir_set_cursor_at_end(irb, err_block); |
| 2852 | ir_gen_defers_for_block(irb, scope, outer_scope, true, false); | 2877 | ir_gen_defers_for_block(irb, scope, outer_scope, true, false); |
| ... | @@ -2868,7 +2893,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -2868,7 +2893,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, |
| 2868 | is_comptime = ir_build_test_comptime(irb, scope, node, is_non_null); | 2893 | is_comptime = ir_build_test_comptime(irb, scope, node, is_non_null); |
| 2869 | } | 2894 | } |
| 2870 | | 2895 | |
| 2871 | ir_build_cond_br(irb, scope, node, is_non_null, ok_block, null_block, is_comptime); | 2896 | ir_mark_gen(ir_build_cond_br(irb, scope, node, is_non_null, ok_block, null_block, is_comptime)); |
| 2872 | | 2897 | |
| 2873 | ir_set_cursor_at_end(irb, null_block); | 2898 | ir_set_cursor_at_end(irb, null_block); |
| 2874 | ir_gen_defers_for_block(irb, scope, outer_scope, false, true); | 2899 | ir_gen_defers_for_block(irb, scope, outer_scope, false, true); |
| ... | @@ -2895,7 +2920,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -2895,7 +2920,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, |
| 2895 | IrBasicBlock *return_block = ir_build_basic_block(irb, scope, "ErrRetReturn"); | 2920 | IrBasicBlock *return_block = ir_build_basic_block(irb, scope, "ErrRetReturn"); |
| 2896 | IrBasicBlock *continue_block = ir_build_basic_block(irb, scope, "ErrRetContinue"); | 2921 | IrBasicBlock *continue_block = ir_build_basic_block(irb, scope, "ErrRetContinue"); |
| 2897 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, ir_should_inline(irb)); | 2922 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, ir_should_inline(irb)); |
| 2898 | ir_build_cond_br(irb, scope, node, is_err_val, return_block, continue_block, is_comptime); | 2923 | ir_mark_gen(ir_build_cond_br(irb, scope, node, is_err_val, return_block, continue_block, is_comptime)); |
| 2899 | | 2924 | |
| 2900 | ir_set_cursor_at_end(irb, return_block); | 2925 | ir_set_cursor_at_end(irb, return_block); |
| 2901 | ir_gen_defers_for_block(irb, scope, outer_scope, true, false); | 2926 | ir_gen_defers_for_block(irb, scope, outer_scope, true, false); |
| ... | @@ -2921,7 +2946,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -2921,7 +2946,7 @@ static IrInstruction *ir_gen_return(IrBuilder *irb, Scope *scope, AstNode *node, |
| 2921 | IrBasicBlock *return_block = ir_build_basic_block(irb, scope, "MaybeRetReturn"); | 2946 | IrBasicBlock *return_block = ir_build_basic_block(irb, scope, "MaybeRetReturn"); |
| 2922 | IrBasicBlock *continue_block = ir_build_basic_block(irb, scope, "MaybeRetContinue"); | 2947 | IrBasicBlock *continue_block = ir_build_basic_block(irb, scope, "MaybeRetContinue"); |
| 2923 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, ir_should_inline(irb)); | 2948 | IrInstruction *is_comptime = ir_build_const_bool(irb, scope, node, ir_should_inline(irb)); |
| 2924 | ir_build_cond_br(irb, scope, node, is_non_null, continue_block, return_block, is_comptime); | 2949 | ir_mark_gen(ir_build_cond_br(irb, scope, node, is_non_null, continue_block, return_block, is_comptime)); |
| 2925 | | 2950 | |
| 2926 | ir_set_cursor_at_end(irb, return_block); | 2951 | ir_set_cursor_at_end(irb, return_block); |
| 2927 | ir_gen_defers_for_block(irb, scope, outer_scope, false, true); | 2952 | ir_gen_defers_for_block(irb, scope, outer_scope, false, true); |
| ... | @@ -3388,7 +3413,7 @@ static IrInstruction *ir_gen_null_literal(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -3388,7 +3413,7 @@ static IrInstruction *ir_gen_null_literal(IrBuilder *irb, Scope *scope, AstNode |
| 3388 | static IrInstruction *ir_gen_var_literal(IrBuilder *irb, Scope *scope, AstNode *node) { | 3413 | static IrInstruction *ir_gen_var_literal(IrBuilder *irb, Scope *scope, AstNode *node) { |
| 3389 | assert(node->type == NodeTypeVarLiteral); | 3414 | assert(node->type == NodeTypeVarLiteral); |
| 3390 | | 3415 | |
| 3391 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_var); | 3416 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_var, false); |
| 3392 | } | 3417 | } |
| 3393 | | 3418 | |
| 3394 | static IrInstruction *ir_gen_decl_ref(IrBuilder *irb, AstNode *source_node, Tld *tld, | 3419 | static IrInstruction *ir_gen_decl_ref(IrBuilder *irb, AstNode *source_node, Tld *tld, |
| ... | @@ -3426,7 +3451,7 @@ static IrInstruction *ir_gen_decl_ref(IrBuilder *irb, AstNode *source_node, Tld | ... | @@ -3426,7 +3451,7 @@ static IrInstruction *ir_gen_decl_ref(IrBuilder *irb, AstNode *source_node, Tld |
| 3426 | { | 3451 | { |
| 3427 | TldTypeDef *tld_typedef = (TldTypeDef *)tld; | 3452 | TldTypeDef *tld_typedef = (TldTypeDef *)tld; |
| 3428 | TypeTableEntry *typedef_type = tld_typedef->type_entry; | 3453 | TypeTableEntry *typedef_type = tld_typedef->type_entry; |
| 3429 | IrInstruction *ref_instruction = ir_build_const_type(irb, scope, source_node, typedef_type); | 3454 | IrInstruction *ref_instruction = ir_build_const_type(irb, scope, source_node, typedef_type, false); |
| 3430 | if (lval != LValPurposeNone) | 3455 | if (lval != LValPurposeNone) |
| 3431 | return ir_build_ref(irb, scope, source_node, ref_instruction, true); | 3456 | return ir_build_ref(irb, scope, source_node, ref_instruction, true); |
| 3432 | else | 3457 | else |
| ... | @@ -3443,7 +3468,7 @@ static IrInstruction *ir_gen_symbol(IrBuilder *irb, Scope *scope, AstNode *node, | ... | @@ -3443,7 +3468,7 @@ static IrInstruction *ir_gen_symbol(IrBuilder *irb, Scope *scope, AstNode *node, |
| 3443 | | 3468 | |
| 3444 | auto primitive_table_entry = irb->codegen->primitive_type_table.maybe_get(variable_name); | 3469 | auto primitive_table_entry = irb->codegen->primitive_type_table.maybe_get(variable_name); |
| 3445 | if (primitive_table_entry) { | 3470 | if (primitive_table_entry) { |
| 3446 | IrInstruction *value = ir_build_const_type(irb, scope, node, primitive_table_entry->value); | 3471 | IrInstruction *value = ir_build_const_type(irb, scope, node, primitive_table_entry->value, false); |
| 3447 | if (lval != LValPurposeNone) { | 3472 | if (lval != LValPurposeNone) { |
| 3448 | return ir_build_ref(irb, scope, node, value, lval == LValPurposeAddressOfConst); | 3473 | return ir_build_ref(irb, scope, node, value, lval == LValPurposeAddressOfConst); |
| 3449 | } else { | 3474 | } else { |
| ... | @@ -3664,6 +3689,15 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo | ... | @@ -3664,6 +3689,15 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo |
| 3664 | | 3689 | |
| 3665 | return ir_build_static_eval(irb, scope, node, arg0_value); | 3690 | return ir_build_static_eval(irb, scope, node, arg0_value); |
| 3666 | } | 3691 | } |
| | 3692 | case BuiltinFnIdGeneratedCode: |
| | 3693 | { |
| | 3694 | AstNode *arg0_node = node->data.fn_call_expr.params.at(0); |
| | 3695 | IrInstruction *arg0_value = ir_gen_node(irb, arg0_node, scope); |
| | 3696 | if (arg0_value == irb->codegen->invalid_instruction) |
| | 3697 | return arg0_value; |
| | 3698 | |
| | 3699 | return ir_build_generated_code(irb, scope, node, arg0_value); |
| | 3700 | } |
| 3667 | case BuiltinFnIdImport: | 3701 | case BuiltinFnIdImport: |
| 3668 | { | 3702 | { |
| 3669 | AstNode *arg0_node = node->data.fn_call_expr.params.at(0); | 3703 | AstNode *arg0_node = node->data.fn_call_expr.params.at(0); |
| ... | @@ -4327,7 +4361,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -4327,7 +4361,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 4327 | } | 4361 | } |
| 4328 | child_scope = index_var->child_scope; | 4362 | child_scope = index_var->child_scope; |
| 4329 | | 4363 | |
| 4330 | IrInstruction *usize = ir_build_const_type(irb, child_scope, node, irb->codegen->builtin_types.entry_usize); | 4364 | IrInstruction *usize = ir_build_const_type(irb, child_scope, node, irb->codegen->builtin_types.entry_usize, false); |
| 4331 | IrInstruction *zero = ir_build_const_usize(irb, child_scope, node, 0); | 4365 | IrInstruction *zero = ir_build_const_usize(irb, child_scope, node, 0); |
| 4332 | IrInstruction *one = ir_build_const_usize(irb, child_scope, node, 1); | 4366 | IrInstruction *one = ir_build_const_usize(irb, child_scope, node, 1); |
| 4333 | ir_build_var_decl(irb, child_scope, index_var_source_node, index_var, usize, zero); | 4367 | ir_build_var_decl(irb, child_scope, index_var_source_node, index_var, usize, zero); |
| ... | @@ -4345,7 +4379,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo | ... | @@ -4345,7 +4379,7 @@ static IrInstruction *ir_gen_for_expr(IrBuilder *irb, Scope *parent_scope, AstNo |
| 4345 | ir_set_cursor_at_end(irb, cond_block); | 4379 | ir_set_cursor_at_end(irb, cond_block); |
| 4346 | IrInstruction *index_val = ir_build_load_ptr(irb, child_scope, node, index_ptr); | 4380 | IrInstruction *index_val = ir_build_load_ptr(irb, child_scope, node, index_ptr); |
| 4347 | IrInstruction *cond = ir_build_bin_op(irb, child_scope, node, IrBinOpCmpLessThan, index_val, len_val, false); | 4381 | IrInstruction *cond = ir_build_bin_op(irb, child_scope, node, IrBinOpCmpLessThan, index_val, len_val, false); |
| 4348 | ir_build_cond_br(irb, child_scope, node, cond, body_block, end_block, is_comptime); | 4382 | ir_mark_gen(ir_build_cond_br(irb, child_scope, node, cond, body_block, end_block, is_comptime)); |
| 4349 | | 4383 | |
| 4350 | ir_set_cursor_at_end(irb, body_block); | 4384 | ir_set_cursor_at_end(irb, body_block); |
| 4351 | IrInstruction *elem_ptr = ir_build_elem_ptr(irb, child_scope, node, array_val_ptr, index_val, false); | 4385 | IrInstruction *elem_ptr = ir_build_elem_ptr(irb, child_scope, node, array_val_ptr, index_val, false); |
| ... | @@ -4391,7 +4425,7 @@ static IrInstruction *ir_gen_this_literal(IrBuilder *irb, Scope *scope, AstNode | ... | @@ -4391,7 +4425,7 @@ static IrInstruction *ir_gen_this_literal(IrBuilder *irb, Scope *scope, AstNode |
| 4391 | ScopeDecls *decls_scope = (ScopeDecls *)scope; | 4425 | ScopeDecls *decls_scope = (ScopeDecls *)scope; |
| 4392 | TypeTableEntry *container_type = decls_scope->container_type; | 4426 | TypeTableEntry *container_type = decls_scope->container_type; |
| 4393 | assert(container_type); | 4427 | assert(container_type); |
| 4394 | return ir_build_const_type(irb, scope, node, container_type); | 4428 | return ir_build_const_type(irb, scope, node, container_type, false); |
| 4395 | } | 4429 | } |
| 4396 | | 4430 | |
| 4397 | if (scope->id == ScopeIdBlock) | 4431 | if (scope->id == ScopeIdBlock) |
| ... | @@ -4719,7 +4753,8 @@ static IrInstruction *ir_gen_switch_expr(IrBuilder *irb, Scope *scope, AstNode * | ... | @@ -4719,7 +4753,8 @@ static IrInstruction *ir_gen_switch_expr(IrBuilder *irb, Scope *scope, AstNode * |
| 4719 | | 4753 | |
| 4720 | assert(ok_bit); | 4754 | assert(ok_bit); |
| 4721 | assert(last_item_node); | 4755 | assert(last_item_node); |
| 4722 | ir_build_cond_br(irb, scope, last_item_node, ok_bit, range_block_yes, range_block_no, is_comptime); | 4756 | ir_mark_gen(ir_build_cond_br(irb, scope, last_item_node, ok_bit, range_block_yes, |
| | 4757 | range_block_no, is_comptime)); |
| 4723 | | 4758 | |
| 4724 | ir_set_cursor_at_end(irb, range_block_yes); | 4759 | ir_set_cursor_at_end(irb, range_block_yes); |
| 4725 | if (!ir_gen_switch_prong_expr(irb, scope, node, prong_node, end_block, | 4760 | if (!ir_gen_switch_prong_expr(irb, scope, node, prong_node, end_block, |
| ... | @@ -4843,12 +4878,12 @@ static IrInstruction *ir_gen_continue(IrBuilder *irb, Scope *scope, AstNode *nod | ... | @@ -4843,12 +4878,12 @@ static IrInstruction *ir_gen_continue(IrBuilder *irb, Scope *scope, AstNode *nod |
| 4843 | | 4878 | |
| 4844 | static IrInstruction *ir_gen_type_literal(IrBuilder *irb, Scope *scope, AstNode *node) { | 4879 | static IrInstruction *ir_gen_type_literal(IrBuilder *irb, Scope *scope, AstNode *node) { |
| 4845 | assert(node->type == NodeTypeTypeLiteral); | 4880 | assert(node->type == NodeTypeTypeLiteral); |
| 4846 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_type); | 4881 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_type, false); |
| 4847 | } | 4882 | } |
| 4848 | | 4883 | |
| 4849 | static IrInstruction *ir_gen_error_type(IrBuilder *irb, Scope *scope, AstNode *node) { | 4884 | static IrInstruction *ir_gen_error_type(IrBuilder *irb, Scope *scope, AstNode *node) { |
| 4850 | assert(node->type == NodeTypeErrorType); | 4885 | assert(node->type == NodeTypeErrorType); |
| 4851 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_pure_error); | 4886 | return ir_build_const_type(irb, scope, node, irb->codegen->builtin_types.entry_pure_error, false); |
| 4852 | } | 4887 | } |
| 4853 | | 4888 | |
| 4854 | static IrInstruction *ir_gen_defer(IrBuilder *irb, Scope *parent_scope, AstNode *node) { | 4889 | static IrInstruction *ir_gen_defer(IrBuilder *irb, Scope *parent_scope, AstNode *node) { |
| ... | @@ -4922,7 +4957,7 @@ static IrInstruction *ir_gen_err_ok_or(IrBuilder *irb, Scope *parent_scope, AstN | ... | @@ -4922,7 +4957,7 @@ static IrInstruction *ir_gen_err_ok_or(IrBuilder *irb, Scope *parent_scope, AstN |
| 4922 | if (var_node) { | 4957 | if (var_node) { |
| 4923 | assert(var_node->type == NodeTypeSymbol); | 4958 | assert(var_node->type == NodeTypeSymbol); |
| 4924 | IrInstruction *var_type = ir_build_const_type(irb, parent_scope, node, | 4959 | IrInstruction *var_type = ir_build_const_type(irb, parent_scope, node, |
| 4925 | irb->codegen->builtin_types.entry_pure_error); | 4960 | irb->codegen->builtin_types.entry_pure_error, false); |
| 4926 | Buf *var_name = var_node->data.symbol_expr.symbol; | 4961 | Buf *var_name = var_node->data.symbol_expr.symbol; |
| 4927 | bool is_const = true; | 4962 | bool is_const = true; |
| 4928 | bool is_shadowable = false; | 4963 | bool is_shadowable = false; |
| ... | @@ -5008,7 +5043,7 @@ static IrInstruction *ir_gen_container_decl(IrBuilder *irb, Scope *parent_scope, | ... | @@ -5008,7 +5043,7 @@ static IrInstruction *ir_gen_container_decl(IrBuilder *irb, Scope *parent_scope, |
| 5008 | } | 5043 | } |
| 5009 | irb->codegen->resolve_queue.append(&tld_container->base); | 5044 | irb->codegen->resolve_queue.append(&tld_container->base); |
| 5010 | | 5045 | |
| 5011 | return ir_build_const_type(irb, parent_scope, node, container_type); | 5046 | return ir_build_const_type(irb, parent_scope, node, container_type, false); |
| 5012 | } | 5047 | } |
| 5013 | | 5048 | |
| 5014 | static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNode *node) { | 5049 | static IrInstruction *ir_gen_fn_proto(IrBuilder *irb, Scope *parent_scope, AstNode *node) { |
| ... | @@ -6530,8 +6565,10 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc | ... | @@ -6530,8 +6565,10 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc |
| 6530 | ConstExprValue *pointee = const_ptr_pointee(&ptr->value); | 6565 | ConstExprValue *pointee = const_ptr_pointee(&ptr->value); |
| 6531 | if (pointee->special != ConstValSpecialRuntime) { | 6566 | if (pointee->special != ConstValSpecialRuntime) { |
| 6532 | IrInstruction *result = ir_create_const(&ira->new_irb, source_instruction->scope, | 6567 | IrInstruction *result = ir_create_const(&ira->new_irb, source_instruction->scope, |
| 6533 | source_instruction->source_node, child_type, pointee->depends_on_compile_var); | 6568 | source_instruction->source_node, child_type, false); |
| 6534 | result->value = *pointee; | 6569 | result->value = *pointee; |
| | 6570 | result->value.depends_on_compile_var = pointee->depends_on_compile_var || |
| | 6571 | ptr->value.depends_on_compile_var; |
| 6535 | return result; | 6572 | return result; |
| 6536 | } | 6573 | } |
| 6537 | } | 6574 | } |
| ... | @@ -6547,7 +6584,8 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc | ... | @@ -6547,7 +6584,8 @@ static IrInstruction *ir_get_deref(IrAnalyze *ira, IrInstruction *source_instruc |
| 6547 | TypeTableEntry *ptr_type = ptr_val->data.x_type; | 6584 | TypeTableEntry *ptr_type = ptr_val->data.x_type; |
| 6548 | if (ptr_type->id == TypeTableEntryIdPointer) { | 6585 | if (ptr_type->id == TypeTableEntryIdPointer) { |
| 6549 | TypeTableEntry *child_type = ptr_type->data.pointer.child_type; | 6586 | TypeTableEntry *child_type = ptr_type->data.pointer.child_type; |
| 6550 | return ir_create_const_type(&ira->new_irb, source_instruction->scope, source_instruction->source_node, child_type); | 6587 | return ir_create_const_type(&ira->new_irb, source_instruction->scope, |
| | 6588 | source_instruction->source_node, child_type, ptr_val->depends_on_compile_var); |
| 6551 | } else { | 6589 | } else { |
| 6552 | ir_add_error(ira, source_instruction, | 6590 | ir_add_error(ira, source_instruction, |
| 6553 | buf_sprintf("attempt to dereference non pointer type '%s'", buf_ptr(&ptr_type->name))); | 6591 | buf_sprintf("attempt to dereference non pointer type '%s'", buf_ptr(&ptr_type->name))); |
| ... | @@ -6572,7 +6610,7 @@ static TypeTableEntry *ir_analyze_ref(IrAnalyze *ira, IrInstruction *source_inst | ... | @@ -6572,7 +6610,7 @@ static TypeTableEntry *ir_analyze_ref(IrAnalyze *ira, IrInstruction *source_inst |
| 6572 | if (!val) | 6610 | if (!val) |
| 6573 | return ira->codegen->builtin_types.entry_invalid; | 6611 | return ira->codegen->builtin_types.entry_invalid; |
| 6574 | return ir_analyze_const_ptr(ira, source_instruction, val, value->value.type, | 6612 | return ir_analyze_const_ptr(ira, source_instruction, val, value->value.type, |
| 6575 | false, ConstPtrSpecialNone, is_const); | 6613 | value->value.depends_on_compile_var, ConstPtrSpecialNone, is_const); |
| 6576 | } | 6614 | } |
| 6577 | | 6615 | |
| 6578 | TypeTableEntry *ptr_type = get_pointer_to_type(ira->codegen, value->value.type, true); | 6616 | TypeTableEntry *ptr_type = get_pointer_to_type(ira->codegen, value->value.type, true); |
| ... | @@ -7367,6 +7405,7 @@ static bool ir_analyze_fn_call_inline_arg(IrAnalyze *ira, AstNode *fn_proto_node | ... | @@ -7367,6 +7405,7 @@ static bool ir_analyze_fn_call_inline_arg(IrAnalyze *ira, AstNode *fn_proto_node |
| 7367 | Buf *param_name = param_decl_node->data.param_decl.name; | 7405 | Buf *param_name = param_decl_node->data.param_decl.name; |
| 7368 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, | 7406 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, |
| 7369 | *exec_scope, param_name, true, arg_val); | 7407 | *exec_scope, param_name, true, arg_val); |
| | 7408 | var->value.depends_on_compile_var = true; |
| 7370 | *exec_scope = var->child_scope; | 7409 | *exec_scope = var->child_scope; |
| 7371 | *next_proto_i += 1; | 7410 | *next_proto_i += 1; |
| 7372 | | 7411 | |
| ... | @@ -7408,6 +7447,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod | ... | @@ -7408,6 +7447,7 @@ static bool ir_analyze_fn_call_generic_arg(IrAnalyze *ira, AstNode *fn_proto_nod |
| 7408 | Buf *param_name = param_decl_node->data.param_decl.name; | 7447 | Buf *param_name = param_decl_node->data.param_decl.name; |
| 7409 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, | 7448 | VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, |
| 7410 | *child_scope, param_name, true, arg_val); | 7449 | *child_scope, param_name, true, arg_val); |
| | 7450 | var->value.depends_on_compile_var = true; |
| 7411 | *child_scope = var->child_scope; | 7451 | *child_scope = var->child_scope; |
| 7412 | | 7452 | |
| 7413 | if (inline_arg || is_var_type) { | 7453 | if (inline_arg || is_var_type) { |
| ... | @@ -7986,6 +8026,14 @@ static TypeTableEntry *ir_analyze_instruction_cond_br(IrAnalyze *ira, IrInstruct | ... | @@ -7986,6 +8026,14 @@ static TypeTableEntry *ir_analyze_instruction_cond_br(IrAnalyze *ira, IrInstruct |
| 7986 | if (!ir_resolve_bool(ira, condition, &cond_is_true)) | 8026 | if (!ir_resolve_bool(ira, condition, &cond_is_true)) |
| 7987 | return ir_unreach_error(ira); | 8027 | return ir_unreach_error(ira); |
| 7988 | | 8028 | |
| | 8029 | if (!cond_br_instruction->base.is_gen && !condition->value.depends_on_compile_var && |
| | 8030 | !ir_should_inline(&ira->new_irb)) |
| | 8031 | { |
| | 8032 | const char *true_or_false = cond_is_true ? "true" : "false"; |
| | 8033 | ir_add_error(ira, &cond_br_instruction->base, |
| | 8034 | buf_sprintf("condition is always %s; unnecessary if statement", true_or_false)); |
| | 8035 | } |
| | 8036 | |
| 7989 | IrBasicBlock *old_dest_block = cond_is_true ? | 8037 | IrBasicBlock *old_dest_block = cond_is_true ? |
| 7990 | cond_br_instruction->then_block : cond_br_instruction->else_block; | 8038 | cond_br_instruction->then_block : cond_br_instruction->else_block; |
| 7991 | | 8039 | |
| ... | @@ -8028,9 +8076,9 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP | ... | @@ -8028,9 +8076,9 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP |
| 8028 | return ira->codegen->builtin_types.entry_invalid; | 8076 | return ira->codegen->builtin_types.entry_invalid; |
| 8029 | | 8077 | |
| 8030 | if (value->value.special != ConstValSpecialRuntime) { | 8078 | if (value->value.special != ConstValSpecialRuntime) { |
| 8031 | ConstExprValue *out_val = ir_build_const_from(ira, &phi_instruction->base, | 8079 | ConstExprValue *out_val = ir_build_const_from(ira, &phi_instruction->base, true); |
| 8032 | value->value.depends_on_compile_var); | | |
| 8033 | *out_val = value->value; | 8080 | *out_val = value->value; |
| | 8081 | out_val->depends_on_compile_var = true; |
| 8034 | } else { | 8082 | } else { |
| 8035 | phi_instruction->base.other = value; | 8083 | phi_instruction->base.other = value; |
| 8036 | } | 8084 | } |
| ... | @@ -8064,7 +8112,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP | ... | @@ -8064,7 +8112,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP |
| 8064 | } | 8112 | } |
| 8065 | | 8113 | |
| 8066 | if (new_incoming_blocks.length == 0) { | 8114 | if (new_incoming_blocks.length == 0) { |
| 8067 | ir_build_const_from(ira, &phi_instruction->base, false); | 8115 | ir_build_const_from(ira, &phi_instruction->base, true); |
| 8068 | return ira->codegen->builtin_types.entry_void; | 8116 | return ira->codegen->builtin_types.entry_void; |
| 8069 | } | 8117 | } |
| 8070 | | 8118 | |
| ... | @@ -8080,7 +8128,9 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP | ... | @@ -8080,7 +8128,9 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP |
| 8080 | return resolved_type; | 8128 | return resolved_type; |
| 8081 | | 8129 | |
| 8082 | if (resolved_type->id == TypeTableEntryIdNumLitFloat || | 8130 | if (resolved_type->id == TypeTableEntryIdNumLitFloat || |
| 8083 | resolved_type->id == TypeTableEntryIdNumLitInt) | 8131 | resolved_type->id == TypeTableEntryIdNumLitInt || |
| | 8132 | resolved_type->id == TypeTableEntryIdNullLit || |
| | 8133 | resolved_type->id == TypeTableEntryIdUndefLit) |
| 8084 | { | 8134 | { |
| 8085 | ir_add_error_node(ira, phi_instruction->base.source_node, | 8135 | ir_add_error_node(ira, phi_instruction->base.source_node, |
| 8086 | buf_sprintf("unable to infer expression type")); | 8136 | buf_sprintf("unable to infer expression type")); |
| ... | @@ -8109,7 +8159,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP | ... | @@ -8109,7 +8159,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP |
| 8109 | } | 8159 | } |
| 8110 | | 8160 | |
| 8111 | static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, | 8161 | static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruction, |
| 8112 | VariableTableEntry *var, bool is_const_ptr) | 8162 | VariableTableEntry *var, bool is_const_ptr, bool depends_on_compile_var) |
| 8113 | { | 8163 | { |
| 8114 | assert(var->value.type); | 8164 | assert(var->value.type); |
| 8115 | if (var->value.type->id == TypeTableEntryIdInvalid) | 8165 | if (var->value.type->id == TypeTableEntryIdInvalid) |
| ... | @@ -8131,7 +8181,8 @@ static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruc | ... | @@ -8131,7 +8181,8 @@ static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruc |
| 8131 | if (mem_slot && mem_slot->special != ConstValSpecialRuntime) { | 8181 | if (mem_slot && mem_slot->special != ConstValSpecialRuntime) { |
| 8132 | ConstPtrSpecial ptr_special = is_comptime ? ConstPtrSpecialInline : ConstPtrSpecialNone; | 8182 | ConstPtrSpecial ptr_special = is_comptime ? ConstPtrSpecialInline : ConstPtrSpecialNone; |
| 8133 | bool is_const = (var->value.type->id == TypeTableEntryIdMetaType) ? is_const_ptr : var->src_is_const; | 8183 | bool is_const = (var->value.type->id == TypeTableEntryIdMetaType) ? is_const_ptr : var->src_is_const; |
| 8134 | return ir_analyze_const_ptr(ira, instruction, mem_slot, var->value.type, false, ptr_special, is_const); | 8184 | return ir_analyze_const_ptr(ira, instruction, mem_slot, var->value.type, |
| | 8185 | mem_slot->depends_on_compile_var || depends_on_compile_var, ptr_special, is_const); |
| 8135 | } else { | 8186 | } else { |
| 8136 | ir_build_var_ptr_from(&ira->new_irb, instruction, var, false); | 8187 | ir_build_var_ptr_from(&ira->new_irb, instruction, var, false); |
| 8137 | type_ensure_zero_bits_known(ira->codegen, var->value.type); | 8188 | type_ensure_zero_bits_known(ira->codegen, var->value.type); |
| ... | @@ -8141,7 +8192,7 @@ static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruc | ... | @@ -8141,7 +8192,7 @@ static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruc |
| 8141 | | 8192 | |
| 8142 | static TypeTableEntry *ir_analyze_instruction_var_ptr(IrAnalyze *ira, IrInstructionVarPtr *var_ptr_instruction) { | 8193 | static TypeTableEntry *ir_analyze_instruction_var_ptr(IrAnalyze *ira, IrInstructionVarPtr *var_ptr_instruction) { |
| 8143 | VariableTableEntry *var = var_ptr_instruction->var; | 8194 | VariableTableEntry *var = var_ptr_instruction->var; |
| 8144 | return ir_analyze_var_ptr(ira, &var_ptr_instruction->base, var, var_ptr_instruction->is_const); | 8195 | return ir_analyze_var_ptr(ira, &var_ptr_instruction->base, var, var_ptr_instruction->is_const, false); |
| 8145 | } | 8196 | } |
| 8146 | | 8197 | |
| 8147 | static TypeTableEntry *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstructionElemPtr *elem_ptr_instruction) { | 8198 | static TypeTableEntry *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstructionElemPtr *elem_ptr_instruction) { |
| ... | @@ -8295,6 +8346,9 @@ static TypeTableEntry *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field | ... | @@ -8295,6 +8346,9 @@ static TypeTableEntry *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field |
| 8295 | ensure_complete_type(ira->codegen, bare_type); | 8346 | ensure_complete_type(ira->codegen, bare_type); |
| 8296 | | 8347 | |
| 8297 | if (bare_type->id == TypeTableEntryIdStruct) { | 8348 | if (bare_type->id == TypeTableEntryIdStruct) { |
| | 8349 | if (bare_type->data.structure.is_invalid) |
| | 8350 | return ira->codegen->builtin_types.entry_invalid; |
| | 8351 | |
| 8298 | TypeStructField *field = find_struct_type_field(bare_type, field_name); | 8352 | TypeStructField *field = find_struct_type_field(bare_type, field_name); |
| 8299 | if (field) { | 8353 | if (field) { |
| 8300 | ir_build_struct_field_ptr_from(&ira->new_irb, &field_ptr_instruction->base, container_ptr, field); | 8354 | ir_build_struct_field_ptr_from(&ira->new_irb, &field_ptr_instruction->base, container_ptr, field); |
| ... | @@ -8304,6 +8358,9 @@ static TypeTableEntry *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field | ... | @@ -8304,6 +8358,9 @@ static TypeTableEntry *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field |
| 8304 | field_ptr_instruction, container_ptr, container_type); | 8358 | field_ptr_instruction, container_ptr, container_type); |
| 8305 | } | 8359 | } |
| 8306 | } else if (bare_type->id == TypeTableEntryIdEnum) { | 8360 | } else if (bare_type->id == TypeTableEntryIdEnum) { |
| | 8361 | if (bare_type->data.enumeration.is_invalid) |
| | 8362 | return ira->codegen->builtin_types.entry_invalid; |
| | 8363 | |
| 8307 | TypeEnumField *field = find_enum_type_field(bare_type, field_name); | 8364 | TypeEnumField *field = find_enum_type_field(bare_type, field_name); |
| 8308 | if (field) { | 8365 | if (field) { |
| 8309 | ir_build_enum_field_ptr_from(&ira->new_irb, &field_ptr_instruction->base, container_ptr, field); | 8366 | ir_build_enum_field_ptr_from(&ira->new_irb, &field_ptr_instruction->base, container_ptr, field); |
| ... | @@ -8334,7 +8391,7 @@ static TypeTableEntry *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source | ... | @@ -8334,7 +8391,7 @@ static TypeTableEntry *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source |
| 8334 | { | 8391 | { |
| 8335 | TldVar *tld_var = (TldVar *)tld; | 8392 | TldVar *tld_var = (TldVar *)tld; |
| 8336 | VariableTableEntry *var = tld_var->var; | 8393 | VariableTableEntry *var = tld_var->var; |
| 8337 | return ir_analyze_var_ptr(ira, source_instruction, var, false); | 8394 | return ir_analyze_var_ptr(ira, source_instruction, var, false, depends_on_compile_var); |
| 8338 | } | 8395 | } |
| 8339 | case TldIdFn: | 8396 | case TldIdFn: |
| 8340 | { | 8397 | { |
| ... | @@ -9065,9 +9122,8 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira, | ... | @@ -9065,9 +9122,8 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira, |
| 9065 | case TypeTableEntryIdEnumTag: | 9122 | case TypeTableEntryIdEnumTag: |
| 9066 | { | 9123 | { |
| 9067 | uint64_t size_in_bytes = type_size(ira->codegen, type_entry); | 9124 | uint64_t size_in_bytes = type_size(ira->codegen, type_entry); |
| 9068 | bool depends_on_compile_var = false; // TODO types should be able to depend on compile var | | |
| 9069 | ConstExprValue *out_val = ir_build_const_from(ira, &size_of_instruction->base, | 9125 | ConstExprValue *out_val = ir_build_const_from(ira, &size_of_instruction->base, |
| 9070 | depends_on_compile_var); | 9126 | type_entry->size_depends_on_compile_var); |
| 9071 | bignum_init_unsigned(&out_val->data.x_bignum, size_in_bytes); | 9127 | bignum_init_unsigned(&out_val->data.x_bignum, size_in_bytes); |
| 9072 | return ira->codegen->builtin_types.entry_num_lit_int; | 9128 | return ira->codegen->builtin_types.entry_num_lit_int; |
| 9073 | } | 9129 | } |
| ... | @@ -9463,6 +9519,26 @@ static TypeTableEntry *ir_analyze_instruction_static_eval(IrAnalyze *ira, | ... | @@ -9463,6 +9519,26 @@ static TypeTableEntry *ir_analyze_instruction_static_eval(IrAnalyze *ira, |
| 9463 | return value->value.type; | 9519 | return value->value.type; |
| 9464 | } | 9520 | } |
| 9465 | | 9521 | |
| | 9522 | static TypeTableEntry *ir_analyze_instruction_generated_code(IrAnalyze *ira, IrInstructionGeneratedCode *instruction) { |
| | 9523 | IrInstruction *value = instruction->value->other; |
| | 9524 | if (value->value.type->id == TypeTableEntryIdInvalid) |
| | 9525 | return ira->codegen->builtin_types.entry_invalid; |
| | 9526 | |
| | 9527 | if (instr_is_comptime(value)) { |
| | 9528 | ConstExprValue *val = ir_resolve_const(ira, value, UndefOk); |
| | 9529 | if (!val) |
| | 9530 | return ira->codegen->builtin_types.entry_invalid; |
| | 9531 | |
| | 9532 | ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base, false); |
| | 9533 | *out_val = *val; |
| | 9534 | out_val->depends_on_compile_var = true; |
| | 9535 | return value->value.type; |
| | 9536 | } |
| | 9537 | |
| | 9538 | instruction->base.other = value; |
| | 9539 | return value->value.type; |
| | 9540 | } |
| | 9541 | |
| 9466 | static TypeTableEntry *ir_analyze_instruction_import(IrAnalyze *ira, IrInstructionImport *import_instruction) { | 9542 | static TypeTableEntry *ir_analyze_instruction_import(IrAnalyze *ira, IrInstructionImport *import_instruction) { |
| 9467 | IrInstruction *name_value = import_instruction->name->other; | 9543 | IrInstruction *name_value = import_instruction->name->other; |
| 9468 | Buf *import_target_str = ir_resolve_str(ira, name_value); | 9544 | Buf *import_target_str = ir_resolve_str(ira, name_value); |
| ... | @@ -11078,6 +11154,8 @@ static TypeTableEntry *ir_analyze_instruction_nocast(IrAnalyze *ira, IrInstructi | ... | @@ -11078,6 +11154,8 @@ static TypeTableEntry *ir_analyze_instruction_nocast(IrAnalyze *ira, IrInstructi |
| 11078 | return ir_analyze_instruction_enum_tag(ira, (IrInstructionEnumTag *)instruction); | 11154 | return ir_analyze_instruction_enum_tag(ira, (IrInstructionEnumTag *)instruction); |
| 11079 | case IrInstructionIdStaticEval: | 11155 | case IrInstructionIdStaticEval: |
| 11080 | return ir_analyze_instruction_static_eval(ira, (IrInstructionStaticEval *)instruction); | 11156 | return ir_analyze_instruction_static_eval(ira, (IrInstructionStaticEval *)instruction); |
| | 11157 | case IrInstructionIdGeneratedCode: |
| | 11158 | return ir_analyze_instruction_generated_code(ira, (IrInstructionGeneratedCode *)instruction); |
| 11081 | case IrInstructionIdImport: | 11159 | case IrInstructionIdImport: |
| 11082 | return ir_analyze_instruction_import(ira, (IrInstructionImport *)instruction); | 11160 | return ir_analyze_instruction_import(ira, (IrInstructionImport *)instruction); |
| 11083 | case IrInstructionIdArrayLen: | 11161 | case IrInstructionIdArrayLen: |
| ... | @@ -11284,6 +11362,7 @@ bool ir_has_side_effects(IrInstruction *instruction) { | ... | @@ -11284,6 +11362,7 @@ bool ir_has_side_effects(IrInstruction *instruction) { |
| 11284 | case IrInstructionIdSwitchTarget: | 11362 | case IrInstructionIdSwitchTarget: |
| 11285 | case IrInstructionIdEnumTag: | 11363 | case IrInstructionIdEnumTag: |
| 11286 | case IrInstructionIdStaticEval: | 11364 | case IrInstructionIdStaticEval: |
| | 11365 | case IrInstructionIdGeneratedCode: |
| 11287 | case IrInstructionIdRef: | 11366 | case IrInstructionIdRef: |
| 11288 | case IrInstructionIdMinValue: | 11367 | case IrInstructionIdMinValue: |
| 11289 | case IrInstructionIdMaxValue: | 11368 | case IrInstructionIdMaxValue: |