[PAHOLE]: Handle typedef'ed anonymous structs in --reorganize

In fact in any place that uses -a.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-04-04 14:44:56 -03:00
parent e8926e6bc0
commit bd4e74162c
1 changed files with 18 additions and 3 deletions

View File

@ -71,10 +71,25 @@ static struct structure *structures__find(const char *name)
return NULL;
list_for_each_entry(pos, &structures__list, node) {
const char *class_name = class__name(pos->class);
const struct class *c = pos->class;
const char *class_name = class__name(c);
if (class_name != NULL &&
strcmp(class__name(pos->class), name) == 0)
if (class_name == NULL) {
if (class__include_anonymous) {
const struct tag *tdef =
cu__find_first_typedef_of_type(pos->cu,
class__tag(c)->id);
if (tdef == NULL)
continue;
class_name = class__name(tag__class(tdef));
if (class_name == NULL)
continue;
} else
continue;
}
if (strcmp(class_name, name) == 0)
return pos;
}