Wed Jan 24 12:06:05 1996 Ian Lance Taylor <ian@cygnus.com>
+ * ieee.c (ieee_define_named_type): When creating a tag for an
+ anonymous struct, copy the name into memory.
+ (ieee_tag_type): Likewise.
+ * debug.c (debug_write_type): Only check and set id field for an
+ unnamed object.
+ (debug_write_class_type): Likewise.
+
* ieee.c: Various changes to write out types for functions and
references, and to not write out unnecessary function types.
if (type->u.kclass != NULL)
{
if (info->class_mark == type->u.kclass->mark
- || type->u.kclass->id > info->base_id)
+ || (tag == NULL && type->u.kclass->id > info->base_id))
{
/* We are currently outputting this struct, or we have
already output it. I don't know if this can happen,
type->kind);
}
type->u.kclass->mark = info->class_mark;
- ++info->class_id;
- type->u.kclass->id = info->class_id;
+ if (tag == NULL)
+ {
+ ++info->class_id;
+ type->u.kclass->id = info->class_id;
+ }
}
if (! (*fns->start_struct_type) (fhandle, tag,
else
{
if (info->class_mark == type->u.kclass->mark
- || type->u.kclass->id > info->base_id)
+ || (tag == NULL && type->u.kclass->id > info->base_id))
{
/* We are currently outputting this class, or we have
already output it. This can happen when there are
type->kind);
}
type->u.kclass->mark = info->class_mark;
- ++info->class_id;
- id = info->class_id;
- type->u.kclass->id = id;
+ if (tag == NULL)
+ {
+ ++info->class_id;
+ type->u.kclass->id = info->class_id;
+ }
+ id = type->u.kclass->id;
vptrbase = type->u.kclass->vptrbase;
if (vptrbase != NULL && vptrbase != type)
{
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (tag != name)
+ tag = xstrdup (ab);
nt->name = tag;
nt->next = info->tags;
info->tags = nt;
nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
memset (nt, 0, sizeof *nt);
+ if (name == ab)
+ name = xstrdup (ab);
nt->name = name;
nt->type.indx = info->type_indx;
++info->type_indx;