- switch (entity->declaration.type->function.linkage) {
- case LINKAGE_INVALID:
- panic("linkage type of function is invalid");
-
- case LINKAGE_C: break;
- case LINKAGE_CXX: needs_mangling = true; break;
+ type_t *type = skip_typeref(entity->declaration.type);
+ assert(is_type_function(type));
+ switch (type->function.linkage) {
+ case LINKAGE_C:
+ if (entity->function.actual_name != NULL)
+ name = entity->function.actual_name->string;
+ break;
+ case LINKAGE_CXX:
+ // TODO What about __REDIRECT/actual_name with mangling?
+ mangle_entity(entity);
+ return make_id_from_obst();