Set the symbol type for structs etc as soon as the tag is created.

Tags (struct/union/enum) are always types.
This commit is contained in:
Bill Currie 2011-02-07 15:30:49 +09:00
parent 65a07ada1c
commit 265a244ba2

View file

@ -90,6 +90,7 @@ find_tag (ty_type_e ty, symbol_t *tag, type_t *type)
sym->type = type;
sym->type->type = ev_invalid;
sym->type->ty = ty;
sym->sy_type = sy_type;
return sym;
}
@ -128,7 +129,6 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type)
symtab->size = size;
}
}
sym->sy_type = sy_type;
sym->type->t.symtab = symtab;
sym->type = find_type (sym->type);
return sym;