- if (sym != NULL) {
- const char *name = sym->string;
- obstack_printf(&obst, "%zu%s", strlen(name), name);
+ if (sym == NULL) {
+ if (type->compound->alias == NULL)
+ panic("mangling anonymous type");
+ sym = type->compound->alias->base.symbol;
+ }
+ print_name(sym->string);
+}
+
+static void mangle_enum_type(const enum_type_t *type)
+{
+ const symbol_t *sym = type->enume->base.symbol;
+ if (sym == NULL) {
+ if (type->enume->alias == NULL)
+ panic("mangling anonymous type");
+ sym = type->enume->alias->base.symbol;
+ }
+ print_name(sym->string);
+}
+
+static void mangle_array_type(const array_type_t *type)
+{
+ if (type->is_vla) {
+ obstack_1grow(&obst, 'A');
+ obstack_1grow(&obst, '_');
+ } else if (type->size_constant) {
+ obstack_printf(&obst, "A%u_", (unsigned) type->size);