Skip to content

Commit

Permalink
add helpers is_struct_type() & is_union_type()
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
  • Loading branch information
igsilya authored and lucvoo committed Oct 7, 2020
1 parent c0e96d6 commit 1ba7c82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1ba7c82

Please sign in to comment.