From d2d07eab08b274e165bfebe21cd70c3a2cf8103c Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 3 Mar 2009 13:18:51 -0300 Subject: [PATCH] dwarves: Introduce tag__is_tag_type And comment the difference to tag__is_type: tag__is_type == is this tag derived from the 'type' class? tag__is_tag_type == is this tag a possible type for a tag, i.e. one we will find in struct tag->type? Signed-off-by: Arnaldo Carvalho de Melo --- dwarves.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dwarves.h b/dwarves.h index 6494913..35c26b7 100644 --- a/dwarves.h +++ b/dwarves.h @@ -100,6 +100,10 @@ static inline bool tag__has_namespace(const struct tag *self) tag__is_enumeration(self); } +/** + * tag__is_tag_type - is this tag derived from the 'type' class? + * @tag - tag queried + */ static inline int tag__is_type(const struct tag *self) { return tag__is_union(self) || @@ -107,6 +111,22 @@ static inline int tag__is_type(const struct tag *self) tag__is_typedef(self) || tag__is_enumeration(self); } + +/** + * tag__is_tag_type - is this one of the possible types for a tag? + * @tag - tag queried + */ +static inline int tag__is_tag_type(const struct tag *self) +{ + return tag__is_type(self) || + tag__is_enumeration(self) || + self->tag == DW_TAG_array_type || + self->tag == DW_TAG_base_type || + self->tag == DW_TAG_const_type || + self->tag == DW_TAG_pointer_type || + self->tag == DW_TAG_subroutine_type || + self->tag == DW_TAG_volatile_type; +} static inline const char *tag__decl_file(const struct tag *self) {