-static void collect_impls(entity *method, eset *set, int *size, bool *open) {
- int i;
-#if 0
- if (get_entity_peculiarity(method) == peculiarity_existent) {
- if ((get_entity_visibility(method) == visibility_external_allocated)
- && (NULL == get_entity_irg(method))) {
- /* We could also add these entities to the callees, but right now we
- subsume them by unknown_entity. */
- *open = true;
- } else {
- assert(get_entity_irg(method) != NULL);
- if (!eset_contains(set, method)) {
- eset_insert(set, method);
- ++(*size);
- }
- }
- }
-
- if (get_entity_peculiarity(method) == peculiarity_inherited) {
- entity *impl_ent = get_inherited_methods_implementation(method);
- if (get_entity_visibility(impl_ent) == visibility_external_allocated) {
- assert(get_entity_irg(impl_ent) == NULL);
- *open = true;
- } else {
- assert(get_entity_irg(impl_ent) != NULL);
- if (!eset_contains(set, impl_ent)) {
- eset_insert(set, impl_ent);
- ++(*size);
- }
- }
- }
-#endif
- /* Only the assertions: */
- if (get_entity_peculiarity(method) == peculiarity_existent) {
- if ((get_entity_visibility(method) == visibility_external_allocated)
- && (NULL == get_entity_irg(method))) {
- } else {
- assert(get_entity_irg(method) != NULL);
- }
- }
- if (get_entity_peculiarity(method) == peculiarity_inherited) {
- entity *impl_ent = get_inherited_methods_implementation(method);
- if (get_entity_visibility(impl_ent) == visibility_external_allocated) {
- assert(get_entity_irg(impl_ent) == NULL);
- } else {
- assert(get_entity_irg(impl_ent) != NULL);
- }
- }
-
- /* Add the implementation to the set if it contains an irg, else
- remember that there are more methods called. */
- /* @@@ We could also add unknown_entity, or the entities with the
- unknown irgs. The first case would result in the exact same
- behaviour: all unknown irgs are represented by the one and only
- unknown entity. If we add all entities, we known the number of
- entities possibly called, and whether there are real unknown
- entities, i.e, such not represented in the type description.
- This would be better for an analyses: it could rule out more
- cases. */
- entity *impl = method;
- if (get_entity_peculiarity(method) == peculiarity_inherited)
- impl = get_inherited_methods_implementation(method);
-
- if (get_entity_peculiarity(method) != peculiarity_description) {
- //if (get_entity_irg(impl)) {
- eset_insert(set, impl);
- ++(*size);
- //} else {
- /* GL: better: eset_insert(set, unknown_entity); */
- //*open = true;
- //}
- }
-
- /*- recursive descent -*/
- for (i = get_entity_n_overwrittenby(method) - 1; i >= 0; --i)
- collect_impls(get_entity_overwrittenby(method, i), set, size, open);
-}
+static void collect_impls(ir_entity *method, eset *set, int *size, int *open) {
+ int i;
+ ir_entity *impl;
+
+ /* Add the implementation to the set if it contains an irg, else
+ remember that there are more methods called. */
+ impl = method;
+ if (get_entity_peculiarity(method) == peculiarity_inherited)
+ impl = get_inherited_methods_implementation(method);
+
+ if (get_entity_peculiarity(method) != peculiarity_description) {
+ eset_insert(set, impl);
+ ++(*size);
+ }