diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2020-10-07 13:52:34 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-08 00:26:43 +0200 |
commit | 1ba7c820275c3afe21b6fb70f4abe208ef67566c (patch) | |
tree | 1c5633a0ec203fb236ac7c9f14a1d7e569e8ab6b | |
parent | c0e96d6d3b95ae3f34ca54720e8a1196b201e119 (diff) | |
download | sparse-1ba7c820275c3afe21b6fb70f4abe208ef67566c.tar.gz |
add helpers is_struct_type() & is_union_type()
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | symbol.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -425,6 +425,20 @@ static inline int is_array_type(struct symbol *type) return type->type == SYM_ARRAY; } +static inline int is_struct_type(struct symbol *type) +{ + if (type->type == SYM_NODE) + type = type->ctype.base_type; + return type->type == SYM_STRUCT; +} + +static inline int is_union_type(struct symbol *type) +{ + if (type->type == SYM_NODE) + type = type->ctype.base_type; + return type->type == SYM_UNION; +} + static inline int is_float_type(struct symbol *type) { if (type->type == SYM_NODE) |