From 28be0ad69b98868c5a77f0fe9d2898391b1ac400 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 28 Jul 2017 11:35:01 +0100 Subject: Fix IR print bug for empty structs; --- src/types.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/types.cpp') 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) { -- cgit v1.2.3