#ifndef _TR_INHERITANCE_H_
#define _TR_INHERITANCE_H_
+#include "firm_types.h"
#include "type.h"
-/*#include "entity.h"*/
#include "ident.h"
-
-/* to resolve recursion between entity.h and irgraph.h */
-#ifndef _IR_GRAPH_TYPEDEF_
-#define _IR_GRAPH_TYPEDEF_
-typedef struct ir_graph ir_graph;
-#endif
-
/* ----------------------------------------------------------------------- */
/* Classify pairs of types/entities in the inheritance relations. */
/* ----------------------------------------------------------------------- */
* a subclass of high. I.e, we search in all subtypes of high for low.
* @@@ this can be implemented more efficient if we know the set of all
* subclasses of high. */
-int is_subclass_of(type *low, type *high);
+int is_SubClass_of(type *low, type *high);
/** Subclass check for pointers to classes.
*
* 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);
+int is_SubClass_ptr_of(type *low, type *high);
/** Returns true if high is superclass of low.
*
* a subclass of high. I.e, we search in all subtypes of high for low.
* @@@ this can be implemented more efficient if we know the set of all
* subclasses of high. */
-int is_superclass_of(type *high, type *low);
+#define is_SuperClass_of(high, low) is_SubClass_of(low, high)
/** Superclass check for pointers to classes.
*
* 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);
+#define is_SuperClass_ptr_of(low, high) is_SubClass_ptr_of(high, low)
/** Returns true if high is (transitive) overwritten by low.
*
* Returns false if high == low. */
int is_overwritten_by(entity *high, entity *low);
-/** Resolve polymorphy in the inheritance relation.
+/** Resolve polymorphism in the inheritance relation.
*
* Returns the dynamically referenced entity if the static entity and the
* dynamic type are given.
/** The state of the transitive closure.
*
- * @TODO: we could manage the state for each relation separately. Invalidating
+ * @todo: we could manage the state for each relation separately. Invalidating
* the entity relations does not mean invalidating the class relation. */
typedef enum {
inh_transitive_closure_none, /**< Closure is not computed, can not be accessed. */
the class hierarchy. @@@ So far this does not happen in Firm. */
ir_class_casts_transitive = 1, /**< Class casts conform to transitive inheritance edges. Default. */
ir_class_casts_normalized = 2, /**< Class casts conform to inheritance edges. */
- ir_class_casts_state_max,
+ ir_class_casts_state_max
} ir_class_cast_state;
char *get_class_cast_state_string(ir_class_cast_state s);