Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
8e504f6f
Commit
8e504f6f
authored
Jan 08, 2011
by
Matthias Braun
Browse files
add type verifier: entities in global types must have names
[r28228]
parent
df99857f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/begnuas.c
View file @
8e504f6f
...
...
@@ -1524,8 +1524,6 @@ static void emit_global(be_gas_decl_env_t *env, const ir_entity *entity)
be_dbg_variable
(
entity
);
if
(
section
==
GAS_SECTION_BSS
)
{
ir_visibility
visibility
=
get_entity_visibility
(
entity
);
switch
(
visibility
)
{
case
ir_visibility_local
:
case
ir_visibility_private
:
...
...
@@ -1566,7 +1564,8 @@ static void emit_global(be_gas_decl_env_t *env, const ir_entity *entity)
emit_align
(
alignment
);
}
if
(
be_gas_object_file_format
==
OBJECT_FILE_FORMAT_ELF
&&
be_gas_emit_types
)
{
&&
be_gas_emit_types
&&
visibility
!=
ir_visibility_private
)
{
be_emit_cstring
(
"
\t
.type
\t
"
);
be_gas_emit_entity
(
entity
);
be_emit_cstring
(
", "
);
...
...
ir/tr/trverify.c
View file @
8e504f6f
...
...
@@ -423,18 +423,31 @@ static void check_tore(type_or_ent tore, void *env)
*/
int
tr_verify
(
void
)
{
int
res
=
no_error
;
ir_type
*
constructors
;
ir_type
*
destructors
;
ir_type
*
thread_locals
;
int
i
;
static
ident
*
empty
=
NULL
;
int
res
=
no_error
;
ir_type
*
constructors
;
ir_type
*
destructors
;
ir_type
*
thread_locals
;
int
i
;
ir_segment_t
s
;
if
(
empty
==
NULL
)
empty
=
new_id_from_chars
(
""
,
0
);
type_walk
(
check_tore
,
NULL
,
&
res
);
for
(
s
=
IR_SEGMENT_FIRST
;
s
<=
IR_SEGMENT_LAST
;
++
s
)
{
const
ir_type
*
type
=
get_segment_type
(
s
);
int
e
;
for
(
e
=
0
;
e
<
get_compound_n_members
(
type
);
++
e
)
{
ir_entity
*
entity
=
get_compound_member
(
type
,
e
);
ASSERT_AND_RET
(
get_entity_ld_ident
(
entity
)
!=
NULL
||
get_entity_visibility
(
entity
)
==
ir_visibility_private
,
"segment members must have a name or visibility_private"
,
1
);
}
}
constructors
=
get_segment_type
(
IR_SEGMENT_CONSTRUCTORS
);
for
(
i
=
get_compound_n_members
(
constructors
)
-
1
;
i
>=
0
;
--
i
)
{
const
ir_entity
*
entity
=
get_compound_member
(
constructors
,
i
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment