aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-03-31 06:18:20 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-03-31 06:18:20 -0400
commitf8e63c458478022813a67bfd5ee64bfad6eee82e (patch)
tree52952d63618068cbe76ee1175623e7f9e2976de2 /src/ir_print.cpp
parent3ca027ca8219dbdbb6467645944c4daada037f51 (diff)
downloadzig-f8e63c458478022813a67bfd5ee64bfad6eee82e.tar.gz
zig-f8e63c458478022813a67bfd5ee64bfad6eee82e.zip
change `@bitcast` to `@ptrcast`
See #290
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 9446be43bd..7814064f85 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -765,9 +765,13 @@ static void ir_print_init_enum(IrPrint *irp, IrInstructionInitEnum *instruction)
fprintf(irp->f, "}");
}
-static void ir_print_bit_cast(IrPrint *irp, IrInstructionBitCast *instruction) {
- fprintf(irp->f, "@bitcast(");
- ir_print_other_instruction(irp, instruction->target);
+static void ir_print_ptr_cast(IrPrint *irp, IrInstructionPtrCast *instruction) {
+ fprintf(irp->f, "@ptrcast(");
+ if (instruction->dest_type) {
+ ir_print_other_instruction(irp, instruction->dest_type);
+ }
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->ptr);
fprintf(irp->f, ")");
}
@@ -1098,8 +1102,8 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdInitEnum:
ir_print_init_enum(irp, (IrInstructionInitEnum *)instruction);
break;
- case IrInstructionIdBitCast:
- ir_print_bit_cast(irp, (IrInstructionBitCast *)instruction);
+ case IrInstructionIdPtrCast:
+ ir_print_ptr_cast(irp, (IrInstructionPtrCast *)instruction);
break;
case IrInstructionIdWidenOrShorten:
ir_print_widen_or_shorten(irp, (IrInstructionWidenOrShorten *)instruction);