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
4413181f
Commit
4413181f
authored
Jul 03, 2002
by
Götz Lindenmaier
Browse files
Bugfix: If inherited entities impl was added before existant one
the entity was added twice. Test missing. [r427]
parent
b4e6ce6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ana/cgana.c
View file @
4413181f
...
...
@@ -71,6 +71,7 @@ entity *get_inherited_methods_implementation(entity *inh_meth) {
return
impl_meth
?
impl_meth
:
inh_meth
;
}
/* A recursive descend in the overwritten relation.
Cycle-free, therefore must terminate. */
void
collect_impls
(
entity
*
method
,
eset
*
set
,
int
*
size
,
bool
*
open
)
{
...
...
@@ -81,8 +82,12 @@ void collect_impls(entity *method, eset *set, int *size, bool *open) {
*
open
=
true
;
}
else
{
assert
(
get_entity_irg
(
method
)
!=
NULL
);
eset_insert
(
set
,
method
);
++
(
*
size
);
if
(
!
eset_contains
(
set
,
method
))
{
eset_insert
(
set
,
method
);
++
(
*
size
);
//printf("Adding existent method %d ", *size); DDME(method);
//printf(" with owner "); DDMT(get_entity_owner(method));
}
}
}
if
(
get_entity_peculiarity
(
method
)
==
inherited
)
{
...
...
@@ -96,6 +101,8 @@ void collect_impls(entity *method, eset *set, int *size, bool *open) {
if
(
!
eset_contains
(
set
,
impl_ent
))
{
eset_insert
(
set
,
impl_ent
);
++
(
*
size
);
// printf("Adding inherited method %d ", *size); DDME(impl_ent);
//printf(" with owner "); DDMT(get_entity_owner(impl_ent));
}
}
}
...
...
@@ -115,13 +122,15 @@ void collect_impls(entity *method, eset *set, int *size, bool *open) {
static
entity
**
get_impl_methods
(
entity
*
method
)
{
eset
*
set
=
eset_create
();
int
size
=
0
;
int
i
;
entity
**
arr
;
bool
open
=
false
;
/** Collect all method entities that can be called here **/
collect_impls
(
method
,
set
,
&
size
,
&
open
);
//printf("Size is %d \n\n", size);
/** Gefunden Entitaeten in ein Feld kopieren, ev. Unbekannten
Vorgaenger einfuegen. **/
if
(
size
==
0
&&
!
open
)
{
...
...
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