Print the decl file and line at class__print, not at class__print_struct, that

way we get it for free for the upcoming types, as class__print_function got
now.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-10-28 19:13:27 -03:00
parent e038f068b1
commit d23a3a6e64
1 changed files with 3 additions and 2 deletions

View File

@ -322,7 +322,6 @@ static void class__print_struct(struct class *self)
int last_bit_size = 0;
int last_offset = -1;
printf("/* %s %u */\n", self->decl_file, self->decl_line);
printf("%s {\n", class__name(self, name, sizeof(name)));
list_for_each_entry(pos, &self->members, node) {
size = class_member__print(pos);
@ -361,11 +360,12 @@ static void class__print_struct(struct class *self)
self->size, sum, sum_holes,
self->size - (sum + sum_holes));
putchar('\n');
putchar('\n');
}
void class__print(struct class *self)
{
printf("/* %s %u */\n", self->decl_file, self->decl_line);
switch (self->tag) {
case DW_TAG_structure_type:
class__print_struct(self);
@ -377,6 +377,7 @@ void class__print(struct class *self)
printf("%s%s;\n", tag_name(self->tag), self->name);
break;
}
putchar('\n');
}
static void classes__add(struct class *class)