1 /*10 2002/03/19 13:08:33
2 * Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
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.
37 firm_kind kind; /**< dynamic type tag for entity. */
38 ident *name; /**< name of this entity */
39 ident *ld_name; /**< Unique name of this entity, i.e., the mangled
40 name. If the field is read before written a default
41 magling is applies. The name of the owner is prepended
42 to the name of the entity, separated by a underscore.
43 E.g., for a class `A' with field `a' this
44 is the ident for `A_a'. */
45 type *type; /**< The type of this entity, e.g., a method type, a
46 basic type of the language or a class itself */
47 type *owner; /**< The compound type (e.g. class type) this entity belongs to. */
48 ent_allocation allocation; /**< Distinguishes static and dynamically allocated
49 entities and some further cases. */
50 ent_visibility visibility; /**< Specifies visibility to external program
52 ent_variability variability; /**< Specifies variability of entities content */
53 ent_volatility volatility; /**< Specifies volatility of entities content */
54 int offset; /**< Offset in byte for this entity. Fixed when layout
55 of owner is determined. */
56 void *link; /**< To store some intermediate information */
57 unsigned long visit; /**< visited counter for walks of the type information */
58 struct dbg_info* dbi; /**< A pointer to information for debug support. */
60 /* ------------- fields for atomic entities ---------------*/
61 ir_node *value; /**< value if entity is not of variability uninitialized.
62 Only for atomic entities. */
64 /* ------------- fields for compound entities ---------------*/
65 ir_node **values; /**< constant values of compound entities. Only available if
66 variablility not uninitialized. Must be set for variability constant
68 entity **val_ents; /**< entities corresponding to constant values. Only available if
69 variablility not uninitialized. Must be set for variability constant */
71 /* ------------- fields for entities owned by a class type ---------------*/
72 entity **overwrites; /**< A list of entities this entity overwrites. */
73 entity **overwrittenby; /**< A list of entities that overwrite this entity. */
75 /* ------------- fields for methods ---------------*/
76 enum peculiarity peculiarity;
77 ir_graph *irg; /**< If (type == method_type) this is the corresponding irg.
78 The ir_graph constructor automatically sets this field.
79 Yes, it must be here. */
83 # endif /* _ENTITY_T_H_ */