- * @@@ value class???
- * @param The following attributes are private to this type kind.
- * @param member All entities belonging to this class. This are methode entities
- * which have type_method or fields that can have any of the
- * following type kinds: type_class, type_struct, type_union,
- * type_array, type_enumeration, type_pointer, type_primitive.
- *
- * @param subtypes A list of direct subclasses.
- *
- * @param supertypes A list of direct superclasses.
- *
- * @param These are dynamic lists that can be grown with an "add_" function,
- * @param but not shrinked.
- *
- * @param peculiarity The peculiarity of this class. If the class is of peculiarity
- * "description" it only is a description of requirememts to a class,
- * as, e.g., a Java interface. The class will never be allocated.
- * Peculiatity inherited is only possible for entities. An entity
- * is of peculiarity inherited if the compiler generated the entity
- * to explicitly resolve inheritance. An inherited method entity has
- * no value for irg.
- * Values: description, existent, inherited. Default: existent.
- *
- */
-/* create a new class type */
-type *new_type_class (ident *name);
-type *new_d_type_class (ident *name, dbg_info *db);
-
-/** manipulate private fields of class type **/
-/* Adds the entity as member of the class. */
-void add_class_member (type *clss, entity *member);
-/* Returns the number of members of this class. */
-int get_class_n_members (type *clss);
-/* Returns the member at position pos, 0 <= pos < n_member */
-entity *get_class_member (type *clss, int pos);
-/* Overwrites the member at position pos, 0 <= pos < n_member with
- the passed entity. */
-void set_class_member (type *clss, entity *member, int pos);
-/* Replaces complete member list in class type by the list passed. Copies the
- list passed. This function is necessary to reduce the number of members.
- members is an array of entities, num the size of this array. Sets all
- owners of the members passed to clss. */
-void set_class_members (type *clss, entity *members[], int arity);
-/* Finds member in the list of members and removes it.
- Shrinks the member list, so iterate from the end!!!
- Does not deallocate the entity. */
-void remove_class_member(type *clss, entity *member);
-
-
-/* Adds subtype as subtype to clss.
- Checks whether clss is a supertype of subtype. If not
- adds also clss as supertype to subtype. */
-void add_class_subtype (type *clss, type *subtype);
-/* Returns the number of subtypes */
-int get_class_n_subtypes (type *clss);
-/* Gets the subtype at position pos, 0 <= pos < n_subtype. */
-type *get_class_subtype (type *clss, int pos);
-/* Sets the subtype at positioin pos, 0 <= pos < n_subtype. Does not
- set the corresponding supertype relation for subtype: this might
- be a different position! */
-void set_class_subtype (type *clss, type *subtype, int pos);
-/* Finds subtype in the list of subtypes and removes it */
-void remove_class_subtype(type *clss, type *subtype);
-
-
-/* Adds supertype as supertype to class.
- Checks whether clss is a subtype of supertype. If not
- adds also clss as subtype to supertype. */
-void add_class_supertype (type *clss, type *supertype);
-/* Returns the number of supertypes */
-int get_class_n_supertypes (type *clss);
-/* Gets the supertype at position pos, 0 <= pos < n_supertype. */
-type *get_class_supertype (type *clss, int pos);
-/* Sets the supertype at postition pos, 0 <= pos < n_subtype. Does not
- set the corresponding subtype relation for supertype: this might
- be a different position! */
-void set_class_supertype (type *clss, type *supertype, int pos);
-/* Finds supertype in the list of supertypes and removes it */
-void remove_class_supertype(type *clss, type *supertype);
-
-/* This enumeration flags the peculiarity of entities and types. */
+ *
+ * The following attributes are private to this type kind:
+ * - member: All entities belonging to this class. This are method entities
+ * which have type_method or fields that can have any of the
+ * following type kinds: type_class, type_struct, type_union,
+ * type_array, type_enumeration, type_pointer, type_primitive.
+ *
+ * The following two are dynamic lists that can be grown with an "add_" function,
+ * but not shrinked:
+ *
+ * - subtypes: A list of direct subclasses.
+ *
+ * - supertypes: A list of direct superclasses.
+ *
+ * - peculiarity: The peculiarity of this class. If the class is of peculiarity
+ * "description" it only is a description of requirements to a class,
+ * as, e.g., a Java interface. The class will never be allocated.
+ * Peculiarity inherited is only possible for entities. An entity
+ * is of peculiarity inherited if the compiler generated the entity
+ * to explicitly resolve inheritance. An inherited method entity has
+ * no value for irg.
+ * Values: description, existent, inherited. Default: existent.
+ *
+ * - 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
+ *
+ * - final: A final class is always a leaf in the class hierarchy. Final
+ * classes cannot be super classes of other ones. As this information
+ * can only be computed in whole world compilations, we allow to
+ * set this flag. It is used in optimizations if get_opt_closed_world()
+ * is false. Default: false
+ *
+ * - interface: The class represents an interface. This flag can be set to distinguish
+ * between interfaces, abstract classes and other classes that all may
+ * have the peculiarity peculiarity_description. Depending on this flag
+ * the lowering might do different actions. Default: false
+ *
+ * - abstract : The class represents an abstract class. This flag can be set to distinguish
+ * between interfaces, abstract classes and other classes that all may
+ * have the peculiarity peculiarity_description. Depending on this flag
+ * the lowering might do different actions. Default: false
+ */
+
+/** Creates a new class type. */
+ir_type *new_type_class (ident *name);
+
+/** Creates a new class type with debug information. */
+ir_type *new_d_type_class (ident *name, dbg_info *db);
+
+/* --- manipulate private fields of class type --- */
+
+/** Adds the entity as member of the class. */
+void add_class_member (ir_type *clss, entity *member);
+
+/** Returns the number of members of this class. */
+int get_class_n_members (const ir_type *clss);
+
+/** Returns the member at position pos, 0 <= pos < n_member */
+entity *get_class_member (const ir_type *clss, int pos);
+
+/** Returns index of mem in clss, -1 if not contained. */
+int get_class_member_index(const ir_type *clss, entity *mem);
+
+/** Finds the member with name 'name'. If several members with the same
+ * name returns one of them. Returns NULL if no member found. */
+entity *get_class_member_by_name(ir_type *clss, ident *name);
+
+/** Overwrites the member at position pos, 0 <= pos < n_member with
+ * the passed entity. */
+void set_class_member (ir_type *clss, entity *member, int pos);
+
+/** Replaces complete member list in class type by the list passed.
+ *
+ * Copies the list passed. This function is necessary to reduce the number of members.
+ * members is an array of entities, num the size of this array. Sets all
+ * owners of the members passed to clss. */
+void set_class_members (ir_type *clss, entity *members[], int arity);
+
+/** Finds member in the list of members and removes it.
+ *
+ * Shrinks the member list, so iterate from the end!!!
+ * Does not deallocate the entity. */
+void remove_class_member(ir_type *clss, entity *member);
+
+
+/** Adds subtype as subtype to clss.
+ *
+ * Checks whether clss is a supertype of subtype. If not
+ * adds also clss as supertype to subtype. */
+void add_class_subtype (ir_type *clss, ir_type *subtype);
+
+/** Returns the number of subtypes */
+int get_class_n_subtypes (const ir_type *clss);
+
+/** Gets the subtype at position pos, 0 <= pos < n_subtype. */
+ir_type *get_class_subtype (ir_type *clss, int pos);
+
+/** Returns the index to access subclass as subtype of class.
+ *
+ * If subclass is no direct subtype of class returns -1.
+ */
+int get_class_subtype_index(ir_type *clss, const ir_type *subclass);
+
+/** Sets the subtype at position pos, 0 <= pos < n_subtype.
+ *
+ * Does not set the corresponding supertype relation for subtype: this might
+ * be a different position! */
+void set_class_subtype (ir_type *clss, ir_type *subtype, int pos);
+
+/** Finds subtype in the list of subtypes and removes it */
+void remove_class_subtype(ir_type *clss, ir_type *subtype);
+
+/* Convenience macros */
+#define add_class_derived_type(clss, drvtype) add_class_subtype(clss, drvtype)
+#define get_class_n_derived_types(clss) get_class_n_subtypes(clss)
+#define get_class_derived_type(clss, pos) get_class_subtype(clss, pos)
+#define get_class_derived_type_index(clss, drvtype) get_class_subtype_index(clss, drvtype)
+#define set_class_derived_type(clss, drvtype, pos) set_class_subtype(clss, drvtype, pos)
+#define remove_class_derived_type(clss, drvtype) remove_class_subtype(clss, drvtype)
+
+/** Adds supertype as supertype to class.
+ *
+ * Checks whether clss is a subtype of supertype. If not
+ * adds also clss as subtype to supertype. */
+void add_class_supertype (ir_type *clss, ir_type *supertype);
+
+/** Returns the number of supertypes */
+int get_class_n_supertypes (const ir_type *clss);
+
+/** Returns the index to access superclass as supertype of class.
+ *
+ * If superclass is no direct supertype of class returns -1.
+ */
+int get_class_supertype_index(ir_type *clss, ir_type *super_clss);
+
+/** Gets the supertype at position pos, 0 <= pos < n_supertype. */
+ir_type *get_class_supertype (ir_type *clss, int pos);
+
+/** Sets the supertype at position pos, 0 <= pos < n_supertype.
+ *
+ * Does not set the corresponding subtype relation for supertype: this might
+ * be at a different position! */
+void set_class_supertype (ir_type *clss, ir_type *supertype, int pos);
+
+/** Finds supertype in the list of supertypes and removes it */
+void remove_class_supertype(ir_type *clss, ir_type *supertype);
+
+/** Convenience macro */
+#define add_class_base_type(clss, basetype) add_class_supertype(clss, basetype)
+#define get_class_n_base_types(clss) get_class_n_supertypes(clss)
+#define get_class_base_type_index(clss, base_clss) get_class_supertype_index(clss, base_clss)
+#define get_class_base_type(clss, pos) get_class_supertype(clss, pos)
+#define set_class_base_type(clss, basetype, pos) set_class_supertype(clss, basetype, pos)
+#define remove_class_base_type(clss, basetype) remove_class_supertype(clss, basetype)
+
+/** Convenience macro */
+#define add_class_base_type(clss, basetype) add_class_supertype(clss, basetype)
+#define get_class_n_base_types(clss) get_class_n_supertypes(clss)
+#define get_class_base_type_index(clss, base_clss) get_class_supertype_index(clss, base_clss)
+#define get_class_base_type(clss, pos) get_class_supertype(clss, pos)
+#define set_class_base_type(clss, basetype, pos) set_class_supertype(clss, basetype, pos)
+#define remove_class_base_type(clss, basetype) remove_class_supertype(clss, basetype)
+
+/** This enumeration flags the peculiarity of entities and types. */