1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer,
7 ** entity.h: declarations for entity
16 /*******************************************************************/
18 /*******************************************************************/
20 /* initalize entity module */
21 void init_entity (void);
23 /*******************************************************************/
25 /*******************************************************************/
27 typedef struct entity {
29 ident *name; /* name of this entity */
30 ident *ld_name; /* Unique name of this entity, i.e., the mangled
31 name. E.g., for a class `A' with field `a' this
32 is the ident for `A_a'. */
33 type *type; /* The type of this entity, e.g., a method type, a
34 basic type of the language or a class itself */
35 type *owner; /* The class this entity belongs to */
37 ir_graph *irg; * If (type == method_type) this is the corresponding irg.
38 The ir_graph constructor automatically sets this field.
39 @@@ Does this go here, or should it be in type_mehtod,
40 or should Call have an attribute ent?? */
41 /* Do we need to remember the initializer of fields? */
42 unsigned long visit; /* visited counter for walks of the type information */
45 /* create a new entity */
46 entity *new_entity (type *owner, ident *name, type *type);
48 /* manipulate fields of entity */
49 char *get_entity_name (entity *);
50 ident *get_entity_ident (entity *);
53 char *get_entity_ld_name (entity *);
54 char *get_entity_ld_ident (entity *);
55 void set_entity_ld_name (entity *, char *ld_name);
56 void set_entity_ld_ident (entity *, ident *ld_ident);
59 type *get_entity_owner (entity *);
60 void set_entity_owner (entity *, type *);
61 inline void assert_legal_owner_of_ent(type *);
63 type *get_entity_type (entity *);
64 void set_entity_type (entity *, type *);
66 /* The entity knows the corresponding irg if the entity is a method.
67 This allows to get from a Call to the called irg. *
68 ir_graph *get_entity_irg(entity *ent);
69 void set_entity_irg(entity *ent, ir_graph *irg);
72 # endif /* _ENTITY_H_ */