inlinening of functions
[libfirm] / ir / tr / entity.c
index 7cca358..031f9d4 100644 (file)
@@ -82,10 +82,12 @@ new_entity (type *owner, ident *name, type *type)
   res->visibility = visibility_local;
   res->offset = -1;
   if (is_method_type(type)) {
+    symconst_symbol sym;
+    sym.entity_p = res;
     res->variability = variability_constant;
     rem = current_ir_graph;
     current_ir_graph = get_const_code_irg();
-    res->value = new_Const(mode_P_mach, new_tarval_from_entity(res, mode_P_mach));
+    res->value = new_SymConst(sym, symconst_addr_ent);
     current_ir_graph = rem;
   } else {
     res->variability = variability_uninitialized;
@@ -488,7 +490,9 @@ ir_node *copy_const_value(ir_node *n) {
   case iro_Const:
     nn = new_Const(m, get_Const_tarval(n)); break;
   case iro_SymConst:
-    nn = new_SymConst(get_SymConst_type_or_id(n), get_SymConst_kind(n)); break;
+
+    nn = new_SymConst(get_SymConst_type_or_id(n), get_SymConst_kind(n));
+    break;
   case iro_Add:
     nn = new_Add(copy_const_value(get_Add_left(n)),
          copy_const_value(get_Add_right(n)), m); break;
@@ -924,9 +928,11 @@ static entity *resolve_ent_polymorphy2 (type *dynamic_class, entity* static_ent)
   return res;
 }
 
-/* Returns the dynamically referenced entity if the static entity and the
- *  dynamic type are given.
- *  Search downwards in overwritten tree. */
+/** Resolve polymorphy in the inheritance relation.
+ *
+ * Returns the dynamically referenced entity if the static entity and the
+ * dynamic type are given.
+ * Search downwards in overwritten tree. */
 entity *resolve_ent_polymorphy(type *dynamic_class, entity* static_ent) {
   entity *res;
   assert(static_ent && static_ent->kind == k_entity);
@@ -939,7 +945,6 @@ entity *resolve_ent_polymorphy(type *dynamic_class, entity* static_ent) {
     dump_entity(static_ent);
     dump_type(get_entity_owner(static_ent));
     dump_type(dynamic_class);
-
   }
   assert(res);
   return res;