[DWARVES]: Adopt tag__follow_typedef from pahole

Useful for other cases, such as class__fixup_alignment in dwarves_reorganize.c.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2008-01-14 21:36:30 -02:00
parent a2eb3ea774
commit a1abd424a5
3 changed files with 11 additions and 10 deletions

View File

@ -319,6 +319,16 @@ static void tag__delete(struct tag *self)
free(self);
}
struct tag *tag__follow_typedef(struct tag *tag, const struct cu *cu)
{
struct tag *type = cu__find_tag_by_id(cu, tag->type);
if (type->tag == DW_TAG_typedef)
return tag__follow_typedef(type, cu);
return type;
}
static const char *tag__accessibility(const struct tag *self)
{
int a;

View File

@ -555,6 +555,7 @@ extern const char *tag__name(const struct tag *self, const struct cu *cu,
char *bf, size_t len);
extern size_t tag__size(const struct tag *self, const struct cu *cu);
extern size_t tag__nr_cachelines(const struct tag *self, const struct cu *cu);
extern struct tag *tag__follow_typedef(struct tag *tag, const struct cu *cu);
extern struct class_member *type__find_member_by_name(const struct type *self,
const char *name);

View File

@ -388,16 +388,6 @@ static int cu_unique_iterator(struct cu *cu, void *cookie)
return cu__for_each_tag(cu, unique_iterator, cookie, tag__filter);
}
static struct tag *tag__follow_typedef(struct tag *tag, struct cu *cu)
{
struct tag *type = cu__find_tag_by_id(cu, tag->type);
if (type->tag == DW_TAG_typedef)
return tag__follow_typedef(type, cu);
return type;
}
static void union__find_new_size(struct tag *tag, struct cu *cu);
static void class__resize_LP(struct tag *tag, struct cu *cu)