adding assertion to prevent recursive compound types
[libfirm] / ir / tr / tr_inheritance.h
index 5585c25..658b62b 100644 (file)
@@ -1,6 +1,5 @@
 /**
- *
- * @file tp_inheritance.h
+ * @file tr_inheritance.h
  *
  * Project:     libFIRM                                                   <br>
  * File name:   ir/tr/tp_inheritance.h                                    <br>
@@ -52,6 +51,14 @@ typedef struct ir_graph ir_graph;
  *  subclasses of high.  */
 int is_subclass_of(type *low, type *high);
 
+/** Subclass check for pointers to classes.
+ *
+ *  Dereferences at both types the same amount of pointer types (as
+ *  many as possible).  If the remaining types are both class types
+ *  and subclasses, returns true, else false.  Can also be called with
+ *  two class types.  */
+int is_subclass_ptr_of(type *low, type *high);
+
 /** Returns true if high is superclass of low.
  *
  *  Low is a subclass of high if low == high or if low is a subclass of
@@ -60,6 +67,14 @@ int is_subclass_of(type *low, type *high);
  *  subclasses of high.  */
 int is_superclass_of(type *high, type *low);
 
+/** Superclass check for pointers to classes.
+ *
+ *  Dereferences at both types the same amount of pointer types (as
+ *  many as possible).  If the remaining types are both class types
+ *  and superclasses, returns true, else false.  Can also be called with
+ *  two class types.  */
+int is_subclass_ptr_of(type *low, type *high);
+
 /** Returns true if high is (transitive) overwritten by low.
  *
  *  Returns false if high == low. */
@@ -121,6 +136,8 @@ void resolve_inheritance(mangle_inherited_name_func *mfunc);
 /*                                                                         */
 /* The transitive edges are held in a set, not in an array as the          */
 /* underlying relation.                                                    */
+/*                                                                         */
+/* Do the sets contain the node itself?  I assume NOT!                     */
 /* ----------------------------------------------------------------------- */
 
 /** The state of the transitive closure.
@@ -201,7 +218,7 @@ entity *get_entity_trans_overwrites_next (entity *ent);
 
 /** Flags for class cast state.
  *
- * The state in irp is allways smaller or equal to the state of any
+ * The state in irp is always smaller or equal to the state of any
  * irg.
  *
  * We rely on the ordering of the enum. */