[qfcc] Add a type check helper for structural types

ie, struct/union/array. I finally though up a decent name (didn't want
to use record as that's a pascal type).
This commit is contained in:
Bill Currie 2020-03-13 17:54:05 +09:00
parent a0d85e33c2
commit 2c9c15f4c8
2 changed files with 7 additions and 0 deletions

View File

@ -164,6 +164,7 @@ int is_pointer (const type_t *type) __attribute__((pure));
int is_field (const type_t *type) __attribute__((pure));
int is_struct (const type_t *type) __attribute__((pure));
int is_array (const type_t *type) __attribute__((pure));
int is_structural (const type_t *type) __attribute__((pure));
int is_func (const type_t *type) __attribute__((pure));
int is_string (const type_t *type) __attribute__((pure));
int type_compatible (const type_t *dst, const type_t *src) __attribute__((pure));

View File

@ -827,6 +827,12 @@ is_func (const type_t *type)
return 0;
}
int
is_structural (const type_t *type)
{
return is_struct (type) || is_array (type);
}
int
is_string (const type_t *type)
{