-int get_class_member_index(type *clss, entity *mem);
-/* 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);
-int get_class_supertype_index(type *clss, type *super_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);
+int get_class_member_index(const ir_type *clss, ir_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. */
+ir_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, ir_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, ir_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, ir_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)