- }
- }
- }
-
- else if (get_irn_op(node) == op_Sel &&
- is_method_type(get_entity_type(get_Sel_entity(node)))) {
- entity * ent = get_Sel_entity(node);
-
- /* Sel from Alloc: replace by constant */
- if (get_opt_optimize() && get_opt_dyn_meth_dispatch() &&
- (get_irn_op(skip_Proj(get_Sel_ptr(node))) == op_Alloc)) {
- ir_node *new_node;
- entity *called_ent;
- /* We know which method will be called, no dispatch necessary. */
- called_ent = resolve_ent_polymorphy(get_Alloc_type(skip_Proj(get_Sel_ptr(node))), ent);
- set_irg_current_block(current_ir_graph, get_nodes_block(node));
- /* called_ent may not be description: has no Address/Const to Call! */
- assert(get_entity_peculiarity(called_ent) != peculiarity_description);
- new_node = copy_const_value(get_atomic_ent_value(called_ent)); DBG_OPT_POLY_ALLOC;
- exchange (node, new_node);
- }
-
- else {
- assert(get_entity_peculiarity(ent) != peculiarity_inherited);
- if (!eset_contains(entities, ent)) {
- /* Entity noch nicht behandelt. Alle (intern oder extern)
- * implementierten Methoden suchen, die diese Entity
- * überschreiben. Die Menge an entity.link speichern. */
- set_entity_link(ent, get_impl_methods(ent));
- eset_insert(entities, ent);
- }
- if (get_entity_link(ent) == NULL) {
- /* Die Sel-Operation kann nie einen Zeiger auf eine aufrufbare
- * Methode zurückgeben. Damit ist sie insbesondere nicht
- * ausführbar und nicht erreichbar. */
- /* Gib eine Warnung aus wenn die Entitaet eine Beschreibung ist
- fuer die es keine Implementierung gibt. */
- if (get_entity_peculiarity(ent) == peculiarity_description) {
- /* This is possible: We call a method in a dead part of the program. */
- } else {
- DDMN(node);
- assert(0); /* Why should this happen ??? */
- //exchange(node, new_Bad());
- }
- } else {
- entity ** arr = get_entity_link(ent);
-
-#if 0
- int i;
- printf("\nCall site "); DDMN(node);
- printf(" in "); DDME(get_irg_entity(current_ir_graph));
- printf(" can call:\n");
- for (i = 0; i < ARR_LEN(arr); i++) {
- printf(" - "); DDME(arr[i]);
- printf(" with owner "); DDMT(get_entity_owner(arr[i]));
- }
- printf("\n");
-#endif