aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-26 02:36:04 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-26 02:36:04 -0500
commit4664f793dc3fed2254863a5b6efc302c095890cb (patch)
tree1c52e0597e181d09ebf199797894945de1eb25f4 /src/ir_print.cpp
parent1b5d1877aea6c0db7fbe6f56ffe4412ce2cffff7 (diff)
downloadzig-4664f793dc3fed2254863a5b6efc302c095890cb.tar.gz
zig-4664f793dc3fed2254863a5b6efc302c095890cb.zip
IR: pass enumToInt test
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index be1089f895..f0dda04c6d 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -923,11 +923,17 @@ static void ir_print_init_enum(IrPrint *irp, IrInstructionInitEnum *instruction)
}
static void ir_print_pointer_reinterpret(IrPrint *irp, IrInstructionPointerReinterpret *instruction) {
- fprintf(irp->f, "(%s)(", buf_ptr(&instruction->base.value.type->name));
+ fprintf(irp->f, "@pointerReinterpret(");
ir_print_other_instruction(irp, instruction->ptr);
fprintf(irp->f, ")");
}
+static void ir_print_widen_or_shorten(IrPrint *irp, IrInstructionWidenOrShorten *instruction) {
+ fprintf(irp->f, "@widenOrShorten(");
+ ir_print_other_instruction(irp, instruction->target);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
ir_print_prefix(irp, instruction);
switch (instruction->id) {
@@ -1170,6 +1176,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdPointerReinterpret:
ir_print_pointer_reinterpret(irp, (IrInstructionPointerReinterpret *)instruction);
break;
+ case IrInstructionIdWidenOrShorten:
+ ir_print_widen_or_shorten(irp, (IrInstructionWidenOrShorten *)instruction);
+ break;
}
fprintf(irp->f, "\n");
}