-typedef struct entity {
- firm_kind kind;
- ident *name; /* name of this entity */
- ident *ld_name; /* Unique name of this entity, i.e., the mangled
- name. E.g., for a class `A' with field `a' this
- is the ident for `A_a'. */
- type *type; /* The type of this entity, e.g., a method type, a
- basic type of the language or a class itself */
- type *owner; /* The class this entity belongs to */
- /* for methods *
- ir_graph *irg; * If (type == method_type) this is the corresponding irg.
- The ir_graph constructor automatically sets this field.
- @@@ Does this go here, or should it be in type_mehtod,
- or should Call have an attribute ent?? */
- /* Do we need to remember the initializer of fields? */
- unsigned long visit; /* visited counter for walks of the type information */
-} entity;
+#ifndef _IR_GRAPH_TYPEDEF_
+#define _IR_GRAPH_TYPEDEF_
+/* to resolve recursion between entity.h and irgraph.h */
+typedef struct ir_graph ir_graph;
+#endif
+
+#ifndef _TYPE_TYPEDEF_
+#define _TYPE_TYPEDEF_
+/* to resolve recursion between entity.h and irgraph.h */
+typedef union type type;
+#endif
+
+typedef struct entity entity;