- const symbol_t *sym = ent->symbol;
- if (sym != NULL) {
- const char *name = sym->string;
- obstack_printf(&obst, SIZET_FMT "%s", strlen(name), name);
- } else {
- /* TODO need the first typedef name here */
- panic("mangling of unnamed class/enum types not implemented yet");
+ obstack_printf(&obst, "%u%s", (unsigned)strlen(name), name);
+}
+
+static void mangle_class_type(const compound_type_t *type)
+{
+ const symbol_t *sym = type->compound->base.symbol;
+ if (sym == NULL) {
+ if (type->compound->alias == NULL)
+ panic("mangling anonymous type");
+ sym = type->compound->alias->base.symbol;