tr: Remove the unused type_info from class types.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 12 Dec 2012 10:05:23 +0000 (11:05 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 12 Dec 2012 12:17:26 +0000 (13:17 +0100)
Accordingly remove repr_class from entities.

include/libfirm/typerep.h
ir/ir/irio.c
ir/tr/entity.c
ir/tr/entity_t.h
ir/tr/type.c
ir/tr/type_t.h

index 786b271..1097a67 100644 (file)
@@ -657,10 +657,6 @@ FIRM_API void set_entity_additional_properties(ir_entity *ent,
 FIRM_API void add_entity_additional_properties(ir_entity *ent,
                                                mtp_additional_properties flag);
 
-/** Returns the class type that this type info entity represents or NULL
-    if ent is no type info entity. */
-FIRM_API ir_type *get_entity_repr_class(const ir_entity *ent);
-
 /**
  * @page unknown_entity  The Unknown entity
  *
@@ -1266,12 +1262,6 @@ FIRM_API int smaller_type(ir_type *st, ir_type *lt);
  *
  *  - supertypes:  A list of direct superclasses.
  *
- *  - type_info:   An entity representing the type information of this class.
- *                 This entity can be of arbitrari type, Firm did not use it yet.
- *                 It allows to express the coupling of a type with an entity
- *                 representing this type.  This information is useful for lowering
- *                 of InstOf and TypeChk nodes.  Default: NULL
- *
  *  - vtable_size: The size of this class virtual function table.
  *                 Default:  0
  *
@@ -1378,12 +1368,6 @@ FIRM_API void set_class_supertype(ir_type *clss, ir_type *supertype, size_t pos)
 /** Finds supertype in the list of supertypes and removes it */
 FIRM_API void remove_class_supertype(ir_type *clss, ir_type *supertype);
 
-/** Returns the type info entity of a class. */
-FIRM_API ir_entity *get_class_type_info(const ir_type *clss);
-
-/** Sets a type info entity for the class. */
-FIRM_API void set_class_type_info(ir_type *clss, ir_entity *ent);
-
 /** Returns the size of the virtual function table. */
 FIRM_API unsigned get_class_vtable_size(const ir_type *clss);
 
index 0db0f0a..471b06b 100644 (file)
@@ -606,8 +606,7 @@ static void write_type_compound(write_env_t *env, ir_type *tp)
        size_t i;
 
        if (is_Class_type(tp)) {
-               if (get_class_n_subtypes(tp) > 0 || get_class_n_supertypes(tp) > 0
-                   || get_class_type_info(tp) != NULL || get_class_vtable_size(tp) > 0) {
+               if (get_class_n_subtypes(tp) > 0 || get_class_n_supertypes(tp) > 0 || get_class_vtable_size(tp) > 0) {
                        /* sub/superclass export not implemented yet, it's unclear whether
                         * class types will stay in libfirm anyway */
                        panic("can't export class types yet");
index 4564908..c1e3c09 100644 (file)
@@ -78,7 +78,6 @@ static ir_entity *intern_new_entity(ir_type *owner, ir_entity_kind kind,
        res->offset_bit_remainder = 0;
        res->alignment            = 0;
        res->link                 = NULL;
-       res->repr_class           = NULL;
 #ifdef DEBUG_libfirm
        res->nr = get_irp_new_node_nr();
 #endif
@@ -992,11 +991,6 @@ void add_entity_additional_properties(ir_entity *ent, mtp_additional_properties
        ent->attr.mtd_attr.properties |= properties;
 }
 
-ir_type *(get_entity_repr_class)(const ir_entity *ent)
-{
-       return _get_entity_repr_class(ent);
-}
-
 dbg_info *(get_entity_dbg_info)(const ir_entity *ent)
 {
        return _get_entity_dbg_info(ent);
index ea87cee..7a0dc5e 100644 (file)
@@ -66,7 +66,6 @@
 #define mark_entity_visited(ent)                 _mark_entity_visited(ent)
 #define entity_visited(ent)                      _entity_visited(ent)
 #define entity_not_visited(ent)                  _entity_not_visited(ent)
-#define get_entity_repr_class(ent)               _get_entity_repr_class(ent)
 #define get_entity_dbg_info(ent)                 _get_entity_dbg_info(ent)
 #define set_entity_dbg_info(ent, db)             _set_entity_dbg_info(ent, db)
 
@@ -182,8 +181,6 @@ struct ir_entity {
                                      information. */
        struct dbg_info *dbi;    /**< A pointer to information for debug support. */
        void *link;              /**< To store some intermediate information. */
-       ir_type *repr_class;     /**< If this entity represents a class info, the
-                                     associated class. */
 
        ir_entity **overwrites;  /**< A list of entities this entity overwrites. */
        ir_entity **overwrittenby; /**< A list of entities that overwrite this
@@ -430,12 +427,6 @@ static inline size_t _get_entity_parameter_number(const ir_entity *entity)
        return entity->attr.parameter.number;
 }
 
-static inline ir_type *_get_entity_repr_class(const ir_entity *ent)
-{
-       assert(ent->kind == k_entity);
-       return ent->repr_class;
-}
-
 static inline dbg_info *_get_entity_dbg_info(const ir_entity *ent)
 {
        return ent->dbi;
index ea37248..10193cb 100644 (file)
@@ -713,7 +713,6 @@ ir_type *new_d_type_class(ident *name, type_dbg_info *db)
        res->attr.ca.subtypes    = NEW_ARR_F (ir_type *, 0);
        res->attr.ca.supertypes  = NEW_ARR_F (ir_type *, 0);
        res->attr.ca.peculiarity = peculiarity_existent;
-       res->attr.ca.type_info   = NULL;
        res->attr.ca.vtable_size = 0;
        res->attr.ca.clss_flags  = cf_none;
        res->attr.ca.dfn         = 0;
@@ -733,7 +732,6 @@ void free_class_entities(ir_type *clss)
        /* we must iterate backward here */
        for (i = get_class_n_members(clss); i > 0;)
                free_entity(get_class_member(clss, --i));
-       /* do NOT free the type info here. It belongs to another class */
 }
 
 void free_class_attrs(ir_type *clss)
@@ -930,18 +928,6 @@ void remove_class_supertype(ir_type *clss, ir_type *supertype)
        }
 }
 
-ir_entity *get_class_type_info(const ir_type *clss)
-{
-       return clss->attr.ca.type_info;
-}
-
-void set_class_type_info(ir_type *clss, ir_entity *ent)
-{
-       clss->attr.ca.type_info = ent;
-       if (ent)
-               ent->repr_class = clss;
-}
-
 ir_peculiarity get_class_peculiarity(const ir_type *clss)
 {
        assert(clss && (clss->type_op == type_class));
index b151408..1baae87 100644 (file)
@@ -94,7 +94,6 @@ typedef struct {
        ir_type **subtypes;          /**< Array containing the direct subtypes. */
        ir_type **supertypes;        /**< Array containing the direct supertypes */
        ir_peculiarity peculiarity;  /**< The peculiarity of this class. */
-       ir_entity *type_info;        /**< An ir_entity representing this class, used for type info. */
        int      dfn;                /**< A number that can be used for 'instanceof' operator. */
        unsigned vtable_size;        /**< The size of the vtable for this class. */
        unsigned clss_flags;         /**< Additional class flags. */