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
6cbc6739
Commit
6cbc6739
authored
May 03, 2012
by
Matthias Braun
Browse files
fix entity_has_definition
parent
7ac777bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/tr/entity.c
View file @
6cbc6739
...
...
@@ -433,18 +433,9 @@ ir_label_t get_entity_label(const ir_entity *ent)
return
ent
->
attr
.
code_attr
.
label
;
}
static
void
verify_visibility
(
const
ir_entity
*
entity
)
{
if
(
get_entity_visibility
(
entity
)
==
ir_visibility_external
&&
!
is_method_entity
(
entity
))
{
assert
(
!
entity_has_definition
(
entity
));
}
}
void
set_entity_visibility
(
ir_entity
*
entity
,
ir_visibility
visibility
)
{
entity
->
visibility
=
visibility
;
verify_visibility
(
entity
);
}
ir_visibility
get_entity_visibility
(
const
ir_entity
*
entity
)
...
...
@@ -1071,9 +1062,12 @@ int entity_is_externally_visible(const ir_entity *entity)
int
entity_has_definition
(
const
ir_entity
*
entity
)
{
return
entity
->
initializer
!=
NULL
||
get_entity_irg
(
entity
)
!=
NULL
||
entity_has_compound_ent_values
(
entity
);
if
(
is_method_entity
(
entity
))
{
return
get_entity_irg
(
entity
)
!=
NULL
;
}
else
{
return
entity
->
initializer
!=
NULL
||
entity_has_compound_ent_values
(
entity
);
}
}
void
ir_init_entity
(
ir_prog
*
irp
)
...
...
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