| ... | @@ -3290,13 +3290,9 @@ static IrInstSrc *ir_build_import(IrBuilderSrc *irb, Scope *scope, AstNode *sour | ... | @@ -3290,13 +3290,9 @@ static IrInstSrc *ir_build_import(IrBuilderSrc *irb, Scope *scope, AstNode *sour |
| 3290 | return &instruction->base; | 3290 | return &instruction->base; |
| 3291 | } | 3291 | } |
| 3292 | | 3292 | |
| 3293 | static IrInstSrc *ir_build_ref_src(IrBuilderSrc *irb, Scope *scope, AstNode *source_node, IrInstSrc *value, | 3293 | static IrInstSrc *ir_build_ref_src(IrBuilderSrc *irb, Scope *scope, AstNode *source_node, IrInstSrc *value) { |
| 3294 | bool is_const, bool is_volatile) | | |
| 3295 | { | | |
| 3296 | IrInstSrcRef *instruction = ir_build_instruction<IrInstSrcRef>(irb, scope, source_node); | 3294 | IrInstSrcRef *instruction = ir_build_instruction<IrInstSrcRef>(irb, scope, source_node); |
| 3297 | instruction->value = value; | 3295 | instruction->value = value; |
| 3298 | instruction->is_const = is_const; | | |
| 3299 | instruction->is_volatile = is_volatile; | | |
| 3300 | | 3296 | |
| 3301 | ir_ref_instruction(value, irb->current_basic_block); | 3297 | ir_ref_instruction(value, irb->current_basic_block); |
| 3302 | | 3298 | |
| ... | @@ -5938,7 +5934,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, | ... | @@ -5938,7 +5934,7 @@ static IrInstSrc *ir_gen_symbol(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5938 | } else { | 5934 | } else { |
| 5939 | IrInstSrc *value = ir_build_const_type(irb, scope, node, primitive_type); | 5935 | IrInstSrc *value = ir_build_const_type(irb, scope, node, primitive_type); |
| 5940 | if (lval == LValPtr) { | 5936 | if (lval == LValPtr) { |
| 5941 | return ir_build_ref_src(irb, scope, node, value, false, false); | 5937 | return ir_build_ref_src(irb, scope, node, value); |
| 5942 | } else { | 5938 | } else { |
| 5943 | return ir_expr_wrap(irb, scope, value, result_loc); | 5939 | return ir_expr_wrap(irb, scope, value, result_loc); |
| 5944 | } | 5940 | } |
| ... | @@ -7486,7 +7482,7 @@ static IrInstSrc *ir_lval_wrap(IrBuilderSrc *irb, Scope *scope, IrInstSrc *value | ... | @@ -7486,7 +7482,7 @@ static IrInstSrc *ir_lval_wrap(IrBuilderSrc *irb, Scope *scope, IrInstSrc *value |
| 7486 | if (lval == LValPtr) { | 7482 | if (lval == LValPtr) { |
| 7487 | // We needed a pointer to a value, but we got a value. So we create | 7483 | // We needed a pointer to a value, but we got a value. So we create |
| 7488 | // an instruction which just makes a pointer of it. | 7484 | // an instruction which just makes a pointer of it. |
| 7489 | return ir_build_ref_src(irb, scope, value->base.source_node, value, false, false); | 7485 | return ir_build_ref_src(irb, scope, value->base.source_node, value); |
| 7490 | } else if (result_loc != nullptr) { | 7486 | } else if (result_loc != nullptr) { |
| 7491 | return ir_expr_wrap(irb, scope, value, result_loc); | 7487 | return ir_expr_wrap(irb, scope, value, result_loc); |
| 7492 | } else { | 7488 | } else { |
| ... | @@ -23348,7 +23344,16 @@ static IrInstGen *ir_analyze_instruction_ref(IrAnalyze *ira, IrInstSrcRef *ref_i | ... | @@ -23348,7 +23344,16 @@ static IrInstGen *ir_analyze_instruction_ref(IrAnalyze *ira, IrInstSrcRef *ref_i |
| 23348 | IrInstGen *value = ref_instruction->value->child; | 23344 | IrInstGen *value = ref_instruction->value->child; |
| 23349 | if (type_is_invalid(value->value->type)) | 23345 | if (type_is_invalid(value->value->type)) |
| 23350 | return ira->codegen->invalid_inst_gen; | 23346 | return ira->codegen->invalid_inst_gen; |
| 23351 | return ir_get_ref(ira, &ref_instruction->base.base, value, ref_instruction->is_const, ref_instruction->is_volatile); | 23347 | |
| | 23348 | bool is_const = false; |
| | 23349 | bool is_volatile = false; |
| | 23350 | |
| | 23351 | ZigValue *child_value = value->value; |
| | 23352 | if (child_value->special == ConstValSpecialStatic) { |
| | 23353 | is_const = true; |
| | 23354 | } |
| | 23355 | |
| | 23356 | return ir_get_ref(ira, &ref_instruction->base.base, value, is_const, is_volatile); |
| 23352 | } | 23357 | } |
| 23353 | | 23358 | |
| 23354 | static IrInstGen *ir_analyze_union_init(IrAnalyze *ira, IrInst* source_instruction, | 23359 | static IrInstGen *ir_analyze_union_init(IrAnalyze *ira, IrInst* source_instruction, |