X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fentity.h;h=c2ac20a905db1a3adeacf64304ee171b247b9d93;hb=98ca7e71bc79bb2a3b2ccb039df78000fc48e70a;hp=e0786146cd9cea3e635c0b9a285bbbdf73932810;hpb=53c52b90fdec73541fbd6703442d0353a0dbaa94;p=libfirm diff --git a/ir/tr/entity.h b/ir/tr/entity.h index e0786146c..c2ac20a90 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -49,13 +49,11 @@ * - int offset: Offset in bits for this entity. Fixed when layout * of owner is determined. * - ir_graph *irg: If (type == method_type) this is the corresponding irg. -* The ir_graph constructor automatically sets this field. +* The ir_graph constructor automatically sets this field. * If (type != method_type) access of this field will cause * an assertion. */ -/* $Id$ */ - # ifndef _ENTITY_H_ # define _ENTITY_H_ @@ -63,6 +61,8 @@ # include "type.h" # include "dbginfo.h" +# include "tr_inheritance.h" + /*-----------------------------------------------------------------*/ /* general */ /*-----------------------------------------------------------------*/ @@ -154,6 +154,11 @@ entity *new_d_entity (type *owner, ident *name, type *tp, dbg_info *db); * * Automatically inserts the new entity as a member of owner. * Resets the overwrites/overwritten_by fields. + * Keeps the old atomic value. + * @@@ Maybe we should change this. If peculiarity of a method + * is existent, we should add a new SymConst that points to + * itself and not to the origin. Right now we have to change + * the peculiarity and then set a new atomic value by hand. */ entity *copy_entity_own (entity *old, type *new_owner); @@ -163,6 +168,7 @@ entity *copy_entity_own (entity *old, type *new_owner); * * Automatically inserts the new entity as a member of owner. * The mangled name ld_name is set to NULL. + * Overwrites relation is copied from old. */ entity *copy_entity_name (entity *old, ident *new_name); @@ -233,29 +239,14 @@ void set_entity_allocation (entity *ent, ent_allocation al); /** Return the name of the allocation type. */ const char *get_allocation_name(ent_allocation vis); -/** - * This enumeration flags the visibility of entities. This is necessary - * for partial compilation. - */ -typedef enum { - visibility_local, /**< The entity is only visible locally. This is the default. */ - visibility_external_visible, /**< The entity is visible to other external program parts, but - it is defined here. It may not be optimized away. The entity must - be static_allocated. */ - visibility_external_allocated /**< The entity is defined and allocated externally. This compilation - must not allocate memory for this entity. The entity must - be static_allocated. This can also be an external defined - method. */ -} ent_visibility; - /** Returns the visibility of an entity. */ -ent_visibility get_entity_visibility (const entity *ent); +visibility get_entity_visibility (const entity *ent); /** Sets the visibility of an entity. */ -void set_entity_visibility (entity *ent, ent_visibility vis); +void set_entity_visibility (entity *ent, visibility vis); /** Return the name of the visibility */ -const char *get_visibility_name(ent_visibility vis); +const char *get_visibility_name(visibility vis); /** This enumeration flags the variability of entities. */ typedef enum { @@ -376,7 +367,7 @@ void set_compound_graph_path_node(compound_graph_path *gr, int pos, entity *n int get_compound_graph_path_array_index(compound_graph_path *gr, int pos); void set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index); -/** Checks wether the path up to pos is correct. If the path contains a NULL, +/** Checks whether the path up to pos is correct. If the path contains a NULL, * assumes the path is not complete and returns 'true'. */ int is_proper_compound_graph_path(compound_graph_path *gr, int pos); @@ -389,8 +380,16 @@ void set_compound_ent_value_w_path(entity *ent, ir_node *val, compound_graph * Asserts if the entity has variability_uninitialized. * */ int get_compound_ent_n_values(entity *ent); +/** Returns a constant value given the position. */ ir_node *get_compound_ent_value(entity *ent, int pos); +/** Returns the access path for value at position pos. */ compound_graph_path *get_compound_ent_value_path(entity *ent, int pos); +/** Returns the position of a value with the given path. + * The path must contain array indicees for all array element entities. */ +int get_compound_ent_pos_by_path(entity *ent, compound_graph_path *path); +/** Returns a constant value given the access path. + * The path must contain array indicees for all array element entities. */ +ir_node *get_compound_ent_value_by_path(entity *ent, compound_graph_path *path); /** Removes all constant entries where the path ends at value_ent. Does not free the memory of the paths. (The same path might be used for several @@ -509,7 +508,6 @@ int is_compound_entity(entity *ent); */ bool equal_entity(entity *ent1, entity *ent2); - /** Outputs a unique number for this entity if libfirm is compiled for debugging, (configure with --enable-debug) else returns 0. */ long get_entity_nr(entity *ent); @@ -529,10 +527,6 @@ bool entity_visited(entity *ent); /** Returns true if this entity was not visited. */ bool entity_not_visited(entity *ent); -/** Returns the dynamically referenced entity if the static entity and the - * dynamic type are given. */ -entity *resolve_ent_polymorphy(type *dynamic_class, entity* static_ent); - /** * @page unknown_entity *