Commit 9892d7b1 authored by Matthias Braun's avatar Matthias Braun
Browse files

constructors/destructors must not have a name

[r27077]
parent d435972c
......@@ -60,8 +60,6 @@ static ident *set_new_id_from_chars(void *handle, const char *str, int len)
{
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));
}
......@@ -160,13 +158,12 @@ void init_ident(ident_if_t *id_if, int initial_n_idents)
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);
}
......
......@@ -418,6 +418,10 @@ int tr_vrfy(void)
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);
......@@ -427,6 +431,9 @@ int tr_vrfy(void)
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) {
......@@ -434,6 +441,9 @@ int tr_vrfy(void)
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment