[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:
parent
a2eb3ea774
commit
a1abd424a5
10
dwarves.c
10
dwarves.c
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
10
pahole.c
10
pahole.c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue