- /* -- As an add on we get an optimization that removes polymorphic calls.
- This optimization is more powerful than that in transform_node_Sel(). -- */
- arr = get_entity_link(ent);
- if (arr == NULL) {
- /*
- * The Sel node never returns a pointer to a usable method.
- * We could not call it, but it may be description:
- * We call a method in a dead part of the program.
- */
- assert(get_entity_peculiarity(ent) == peculiarity_description);
- }
- else if (get_opt_closed_world() && get_opt_dyn_meth_dispatch() &&
- (ARR_LEN(arr) == 1 && arr[0] != NULL)) {
- ir_node *new_node;
-
- /*
- * The Sel node returns only one possible method.
- * So we could replace the Sel node by a SymConst.
- * This method must exists.
- */
- set_irg_current_block(current_ir_graph, get_nodes_block(node));
- assert(get_entity_peculiarity(get_SymConst_entity(get_atomic_ent_value(arr[0]))) ==
- peculiarity_existent);
- new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(arr[0]));
- DBG_OPT_POLY(node, new_node);
- exchange(node, new_node);
- }
+ /* -- As an add on we get an optimization that removes polymorphic calls.
+ This optimization is more powerful than that in transform_node_Sel(). -- */
+ arr = get_entity_link(ent);
+ if (arr == NULL) {
+ /*
+ * The Sel node never returns a pointer to a usable method.
+ * We could not call it, but it may be description:
+ * We call a method in a dead part of the program.
+ */
+ assert(get_entity_irg(ent) == NULL);
+ }
+ else if (get_opt_closed_world() && get_opt_dyn_meth_dispatch() &&
+ (ARR_LEN(arr) == 1 && arr[0] != NULL)) {
+ ir_node *new_node;
+
+ /*
+ * The Sel node returns only one possible method.
+ * So we could replace the Sel node by a SymConst.
+ * This method must exists.
+ */
+ set_irg_current_block(current_ir_graph, get_nodes_block(node));
+ assert(get_entity_irg(arr[0]) != NULL);
+ new_node = copy_const_value(get_irn_dbg_info(node), get_atomic_ent_value(arr[0]));
+ DBG_OPT_POLY(node, new_node);
+ exchange(node, new_node);
+ }