diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 15:44:06 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 15:44:06 -0400 |
| commit | e1d14e73b5f9c7a8d1a92ccd36cb689d625faf57 (patch) | |
| tree | 29253dfee7859ccb360887e347f021335cdffaa7 /src/ir_print.cpp | |
| parent | 60c386180570d9d3830f8375bbad761cf721c6d3 (diff) | |
| download | zig-e1d14e73b5f9c7a8d1a92ccd36cb689d625faf57.tar.gz zig-e1d14e73b5f9c7a8d1a92ccd36cb689d625faf57.zip | |
fix `@bitCast` semantics when there is no parent result loc
Diffstat (limited to 'src/ir_print.cpp')
| -rw-r--r-- | src/ir_print.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 64e6f07ade..4b8b175be0 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -1046,6 +1046,13 @@ static void ir_print_ptr_cast_gen(IrPrint *irp, IrInstructionPtrCastGen *instruc fprintf(irp->f, ")"); } +static void ir_print_bit_cast_src(IrPrint *irp, IrInstructionBitCastSrc *instruction) { + fprintf(irp->f, "@bitCast("); + ir_print_other_instruction(irp, instruction->operand); + fprintf(irp->f, ")result="); + ir_print_result_loc(irp, &instruction->result_loc_bit_cast->base); +} + static void ir_print_bit_cast_gen(IrPrint *irp, IrInstructionBitCastGen *instruction) { fprintf(irp->f, "@bitCast("); ir_print_other_instruction(irp, instruction->operand); @@ -1860,6 +1867,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) { case IrInstructionIdPtrCastGen: ir_print_ptr_cast_gen(irp, (IrInstructionPtrCastGen *)instruction); break; + case IrInstructionIdBitCastSrc: + ir_print_bit_cast_src(irp, (IrInstructionBitCastSrc *)instruction); + break; case IrInstructionIdBitCastGen: ir_print_bit_cast_gen(irp, (IrInstructionBitCastGen *)instruction); break; |
