{
set *id_set = handle;
- /* GL: Who added this assert? And why? */
- //assert(len > 0);
return (ident *)set_hinsert0(id_set, str, len, ID_HASH(unsigned char, str, len));
}
ident *new_id_from_str(const char *str)
{
- assert(str);
+ assert(str != NULL);
return impl.new_id_from_str(impl.handle, str);
}
ident *new_id_from_chars(const char *str, int len)
{
- assert(len > 0);
return impl.new_id_from_chars(impl.handle, str, len);
}
ir_type *constructors;
ir_type *destructors;
int i;
+ static ident *empty = NULL;
+
+ if (empty == NULL)
+ empty = new_id_from_chars("", 0);
type_walk(check_tore, NULL, &res);
ASSERT_AND_RET(get_entity_linkage(entity) & IR_LINKAGE_HIDDEN_USER,
"entity without LINKAGE_HIDDEN_USER in constructors is pointless",
1);
+ /* Mach-O doesn't like labels in this section */
+ ASSERT_AND_RET(get_entity_ld_ident(entity),
+ "entity in constructors should have ld_ident ''", 1);
}
destructors = get_segment_type(IR_SEGMENT_DESTRUCTORS);
for (i = get_compound_n_members(destructors)-1; i >= 0; --i) {
ASSERT_AND_RET(get_entity_linkage(entity) & IR_LINKAGE_HIDDEN_USER,
"entity without LINKAGE_HIDDEN_USER in destructors is pointless",
1);
+ /* Mach-O doesn't like labels in this section */
+ ASSERT_AND_RET(get_entity_ld_ident(entity),
+ "entity in destructors should have ld_ident ''", 1);
}
return res;