aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-21 14:16:14 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-21 14:16:14 -0400
commit0ca12ded2ffbbc6f703d66541481bab5d8cbb2e3 (patch)
tree5bc73aa60ecc49695fd9bf8bab550ac1e75657be /src/ir_print.cpp
parent44f2ee101f244342ec7e4cd81bb21d9a0c23267b (diff)
parent7c5e3e1f8e4671b383865df0150b549e2445d170 (diff)
downloadzig-0ca12ded2ffbbc6f703d66541481bab5d8cbb2e3.tar.gz
zig-0ca12ded2ffbbc6f703d66541481bab5d8cbb2e3.zip
Merge branch 'raulgrell-BitByteOffsetOfs'
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index d57d554c72..dc756cf492 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1041,8 +1041,16 @@ static void ir_print_field_parent_ptr(IrPrint *irp, IrInstructionFieldParentPtr
fprintf(irp->f, ")");
}
-static void ir_print_offset_of(IrPrint *irp, IrInstructionOffsetOf *instruction) {
- fprintf(irp->f, "@offset_of(");
+static void ir_print_byte_offset_of(IrPrint *irp, IrInstructionByteOffsetOf *instruction) {
+ fprintf(irp->f, "@byte_offset_of(");
+ ir_print_other_instruction(irp, instruction->type_value);
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->field_name);
+ fprintf(irp->f, ")");
+}
+
+static void ir_print_bit_offset_of(IrPrint *irp, IrInstructionBitOffsetOf *instruction) {
+ fprintf(irp->f, "@bit_offset_of(");
ir_print_other_instruction(irp, instruction->type_value);
fprintf(irp->f, ",");
ir_print_other_instruction(irp, instruction->field_name);
@@ -1649,8 +1657,11 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdFieldParentPtr:
ir_print_field_parent_ptr(irp, (IrInstructionFieldParentPtr *)instruction);
break;
- case IrInstructionIdOffsetOf:
- ir_print_offset_of(irp, (IrInstructionOffsetOf *)instruction);
+ case IrInstructionIdByteOffsetOf:
+ ir_print_byte_offset_of(irp, (IrInstructionByteOffsetOf *)instruction);
+ break;
+ case IrInstructionIdBitOffsetOf:
+ ir_print_bit_offset_of(irp, (IrInstructionBitOffsetOf *)instruction);
break;
case IrInstructionIdTypeInfo:
ir_print_type_info(irp, (IrInstructionTypeInfo *)instruction);