/* ENTITY */
/*-----------------------------------------------------------------*/
-static INLINE void insert_entity_in_owner (entity *ent) {
+static INLINE void insert_entity_in_owner(entity *ent) {
ir_type *owner = ent->owner;
switch (get_type_tpop_code(owner)) {
case tpo_class: {
* @return the new created entity
*/
static INLINE entity *
-new_rd_entity (dbg_info *db, ir_type *owner, ident *name, ir_type *type)
+new_rd_entity(dbg_info *db, ir_type *owner, ident *name, ir_type *type)
{
entity *res;
ir_graph *rem;
res->kind = k_entity;
res->name = name;
res->ld_name = NULL;
- res->owner = owner;
res->type = type;
+ res->owner = owner;
- res->allocation = allocation_automatic;
- res->visibility = visibility_local;
- res->volatility = volatility_non_volatile;
- res->stickyness = stickyness_unsticky;
- res->offset = -1;
- res->peculiarity = peculiarity_existent;
- res->link = NULL;
+ res->allocation = allocation_automatic;
+ res->visibility = visibility_local;
+ res->volatility = volatility_non_volatile;
+ res->stickyness = stickyness_unsticky;
+ res->peculiarity = peculiarity_existent;
+ res->compiler_gen = 0;
+ res->offset = -1;
+ res->link = NULL;
if (is_Method_type(type)) {
symconst_symbol sym;
_set_entity_peculiarity(ent, pec);
}
+/* Checks if an entity is compiler generated */
+int is_entity_compiler_generated(const entity *ent) {
+ assert(is_entity(ent));
+ return ent->compiler_gen;
+}
+
+/* Sets/resets the compiler generated flag */
+void set_entity_compiler_generated(entity *ent, int flag) {
+ assert(is_entity(ent));
+ ent->compiler_gen = flag ? 1 : 0;
+}
+
/* Get the entity's stickyness */
ir_stickyness
(get_entity_stickyness)(const entity *ent) {
/** Sets the peculiarity of an entity. */
void set_entity_peculiarity(entity *ent, ir_peculiarity pec);
+/** Checks if an entity is compiler generated */
+int is_entity_compiler_generated(const entity *ent);
+
+/** Sets/resets the compiler generated flag */
+void set_entity_compiler_generated(entity *ent, int flag);
+
/* -- Representation of constant values of entities -- */
/** Returns true if the the node is representable as code on
* const_code_irg. */
ir_type *type; /**< The type of this entity, e.g., a method type, a
basic type of the language or a class itself. */
ir_type *owner; /**< The compound type (e.g. class type) this entity belongs to. */
- ir_allocation allocation:2; /**< Distinguishes static and dynamically allocated
+ ir_allocation allocation:3; /**< Distinguishes static and dynamically allocated
entities and some further cases. */
- ir_visibility visibility:2; /**< Specifies visibility to external program
+ ir_visibility visibility:3; /**< Specifies visibility to external program
fragments. */
- ir_variability variability:2; /**< Specifies variability of entities content. */
- ir_volatility volatility:1; /**< Specifies volatility of entities content. */
- ir_stickyness stickyness:1; /**< Specifies whether this entity is sticky. */
- ir_peculiarity peculiarity:2; /**< The peculiarity of this entity. */
- int offset; /**< Offset in bits for this entity. Fixed when layout
+ ir_variability variability:3; /**< Specifies variability of entities content. */
+ ir_volatility volatility:2; /**< Specifies volatility of entities content. */
+ ir_stickyness stickyness:2; /**< Specifies whether this entity is sticky. */
+ ir_peculiarity peculiarity:3; /**< The peculiarity of this entity. */
+ unsigned compiler_gen:1; /**< If set, this entity was compiler generated. */
+ int offset; /**< Offset in bits for this entity. Fixed when layout
of owner is determined. */
unsigned long visit; /**< visited counter for walks of the type information. */
struct dbg_info *dbi; /**< A pointer to information for debug support. */
set_entity_offset_bytes(area, offset);
set_type_size_bytes(frame_type, frame_size);
+ /* mark this entity as compiler generated */
+ set_entity_compiler_generated(area, 1);
return area;
}