aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-29 13:01:28 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-29 13:01:28 +0100
commit3546391311d84376a758ee0fcc806e192d6a18ce (patch)
treef8b68340491e86192b8acbe6e7287a8236fed127 /src/types.cpp
parent24c812115e8cbc905b1a5c1d73182da5db94dfde (diff)
parent28be0ad69b98868c5a77f0fe9d2898391b1ac400 (diff)
Merge branch 'master' of https://github.com/gingerBill/Odin
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 becb4cf06..abe66c7f7 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -881,6 +881,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) {