| ... | ... | @@ -1303,15 +1303,23 @@ static IrInstruction *ir_build_ptr_type(IrBuilder *irb, Scope *scope, AstNode *s |
| 1303 | 1303 | return &ptr_type_of_instruction->base; |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | | static IrInstruction *ir_build_un_op(IrBuilder *irb, Scope *scope, AstNode *source_node, IrUnOp op_id, IrInstruction *value) { |
| 1307 | | IrInstructionUnOp *br_instruction = ir_build_instruction<IrInstructionUnOp>(irb, scope, source_node); |
| 1308 | | br_instruction->op_id = op_id; |
| 1309 | | br_instruction->value = value; |
| 1310 | | br_instruction->lval = LValNone; |
| 1306 | static IrInstruction *ir_build_un_op_lval(IrBuilder *irb, Scope *scope, AstNode *source_node, IrUnOp op_id, |
| 1307 | IrInstruction *value, LVal lval) |
| 1308 | { |
| 1309 | IrInstructionUnOp *instruction = ir_build_instruction<IrInstructionUnOp>(irb, scope, source_node); |
| 1310 | instruction->op_id = op_id; |
| 1311 | instruction->value = value; |
| 1312 | instruction->lval = lval; |
| 1311 | 1313 | |
| 1312 | 1314 | ir_ref_instruction(value, irb->current_basic_block); |
| 1313 | 1315 | |
| 1314 | | return &br_instruction->base; |
| 1316 | return &instruction->base; |
| 1317 | } |
| 1318 | |
| 1319 | static IrInstruction *ir_build_un_op(IrBuilder *irb, Scope *scope, AstNode *source_node, IrUnOp op_id, |
| 1320 | IrInstruction *value) |
| 1321 | { |
| 1322 | return ir_build_un_op_lval(irb, scope, source_node, op_id, value, LValNone); |
| 1315 | 1323 | } |
| 1316 | 1324 | |
| 1317 | 1325 | static IrInstruction *ir_build_container_init_list(IrBuilder *irb, Scope *scope, AstNode *source_node, |
| ... | ... | @@ -7227,10 +7235,7 @@ static IrInstruction *ir_gen_node_raw(IrBuilder *irb, AstNode *node, Scope *scop |
| 7227 | 7235 | // We essentially just converted any lvalue from &(x.*) to (&x).*; |
| 7228 | 7236 | // this inhibits checking that x is a pointer later, so we directly |
| 7229 | 7237 | // record whether the pointer check is needed |
| 7230 | | IrInstructionUnOp *result = (IrInstructionUnOp*)ir_build_un_op(irb, scope, node, IrUnOpDereference, value); |
| 7231 | | result->lval = lval; |
| 7232 | | |
| 7233 | | return &result->base; |
| 7238 | return ir_build_un_op_lval(irb, scope, node, IrUnOpDereference, value, lval); |
| 7234 | 7239 | } |
| 7235 | 7240 | case NodeTypeUnwrapOptional: { |
| 7236 | 7241 | AstNode *expr_node = node->data.unwrap_optional.expr; |
| ... | ... | @@ -13685,6 +13690,8 @@ no_mem_slot: |
| 13685 | 13690 | static IrInstruction *ir_analyze_store_ptr(IrAnalyze *ira, IrInstruction *source_instr, |
| 13686 | 13691 | IrInstruction *ptr, IrInstruction *uncasted_value) |
| 13687 | 13692 | { |
| 13693 | assert(ptr->value.type->id == ZigTypeIdPointer); |
| 13694 | |
| 13688 | 13695 | if (ptr->value.data.x_ptr.special == ConstPtrSpecialDiscard) { |
| 13689 | 13696 | return ir_const_void(ira, source_instr); |
| 13690 | 13697 | } |