2 ** Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
3 ** All rights reserved.
5 ** Authors: Martin Trapp, Christian Schaefer,
8 ** entity.h: entities represent all program known objects.
10 ** An entity is the representation of program known objects in Firm.
11 ** The primary concept of entities is to represent members of complex
12 ** types, i.e., fields and methods of classes. As not all programming
13 ** language model all variables and methods as members of some class,
14 ** the concept of entities is extended to cover also local and global
15 ** variables, and arbitrary procedures.
17 ** An entity always specifies the type of the object it represents and
18 ** the type of the object it is a part of, the owner of the entity.
19 ** Originally this is the type of the class of which the entity is a
21 ** The owner of local variables is the procedure they are defined in.
22 ** The owner of global variables and procedures visible in the whole
23 ** program is a universally defined class type "GlobalType". The owner
24 ** of procedures defined in the scope of an other procedure is the
25 ** enclosing procedure.
35 #ifndef _IR_GRAPH_TYPEDEF_
36 #define _IR_GRAPH_TYPEDEF_
37 /* to resolve recursion between entity.h and irgraph.h */
38 typedef struct ir_graph ir_graph;
43 ident *name; /* name of this entity */
44 ident *ld_name; /* Unique name of this entity, i.e., the mangled
45 name. E.g., for a class `A' with field `a' this
46 is the ident for `A_a'. */
47 type *type; /* The type of this entity, e.g., a method type, a
48 basic type of the language or a class itself */
49 type *owner; /* The class this entity belongs to. In case of local variables
50 the method they are defined in. */
52 ir_graph *irg; /* If (type == method_type) this is the corresponding irg.
53 The ir_graph constructor automatically sets this field.
54 @@@ Does this go here, or should it be in type_method,
55 or should Call have an attribute ent?? */
56 /* Do we need to remember the initializer of fields? */
57 unsigned long visit; /* visited counter for walks of the type information */
61 # endif /* _ENTITY_T_H_ */