aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill+github@gingerbill.org>2017-07-28 11:35:01 +0100
committergingerBill <bill+github@gingerbill.org>2017-07-28 11:35:01 +0100
commit28be0ad69b98868c5a77f0fe9d2898391b1ac400 (patch)
tree74ca2ff1efd92e544054afe7b6984b0440c147d2 /src/types.cpp
parentf0980c0a98aad1ce4712197e98608e0b1a886a44 (diff)
Fix IR print bug for empty structs;
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 13480eb3f..bd3f5fd7e 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -878,6 +878,10 @@ bool is_type_empty_union(Type *t) {
t = base_type(t);
return t->kind == Type_Union && t->Union.variants.count == 0;
}
+bool is_type_empty_struct(Type *t) {
+ t = base_type(t);
+ return t->kind == Type_Struct && !t->Struct.is_raw_union && t->Struct.fields.count == 0;
+}
bool is_type_valid_for_keys(Type *t) {