return NULL;
}
- if (is_main(entity)) {
- /* force main to C linkage */
- type_t *type = entity->declaration.type;
- assert(is_type_function(type));
- if (type->function.linkage != LINKAGE_C) {
- type_t *new_type = duplicate_type(type);
- new_type->function.linkage = LINKAGE_C;
- type = identify_new_type(new_type);
- entity->declaration.type = type;
- }
- }
-
symbol_t *symbol = entity->base.symbol;
ident *id = new_id_from_str(symbol->string);
}
}
- if (is_main(entity) && enable_main_collect2_hack)
- prepare_main_collect2(entity);
+ if (is_main(entity)) {
+ /* Force main to C linkage. */
+ type_t *const type = entity->declaration.type;
+ assert(is_type_function(type));
+ if (type->function.linkage != LINKAGE_C) {
+ type_t *new_type = duplicate_type(type);
+ new_type->function.linkage = LINKAGE_C;
+ entity->declaration.type = identify_new_type(new_type);
+ }
+
+ if (enable_main_collect2_hack)
+ prepare_main_collect2(entity);
+ }
POP_CURRENT_ENTITY();
POP_PARENT();