aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-08-17 15:11:41 +0100
committergingerBill <bill@gingerbill.org>2018-08-17 15:11:41 +0100
commitb216e44870b1883cf3fb71994eb94f642fea43a1 (patch)
tree35deeadee9a5d2c5c0d7fe74d4d874385ce68897 /src/ir_print.cpp
parent7d39b26cf4537943ecd668777d830dfa8579edbe (diff)
Add underlying type for `bit_set`
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 85efd12ba..547235dd0 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -508,16 +508,13 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t, bool in_struct) {
}
case Type_BitSet: {
- i64 align = type_align_of(t);
- i64 size = type_size_of(t);
- switch (size) {
- case 0: ir_write_str_lit(f, "{}"); return;
- case 1: ir_write_str_lit(f, "i8"); return;
- case 2: ir_write_str_lit(f, "i16"); return;
- case 4: ir_write_str_lit(f, "i32"); return;
- case 8: ir_write_str_lit(f, "i64"); return;
- default: GB_PANIC("Unknown bit_set size"); break;
+ i64 size = type_size_of(t);
+ if (size == 0) {
+ ir_write_str_lit(f, "{}");
+ return;
}
+ ir_print_type(f, m, bit_set_to_int(t));
+ return;
}
}
}