Commit a9e4920e authored by Michael Beck's avatar Michael Beck
Browse files

renamed some firm enum types to have the ir_ prefix

[r8228]
parent 5768beab
......@@ -345,18 +345,18 @@ void
_set_entity_type(ent, type);
}
ent_allocation
ir_allocation
(get_entity_allocation)(const entity *ent) {
return _get_entity_allocation(ent);
}
void
(set_entity_allocation)(entity *ent, ent_allocation al) {
(set_entity_allocation)(entity *ent, ir_allocation al) {
_set_entity_allocation(ent, al);
}
/* return the name of the visibility */
const char *get_allocation_name(ent_allocation all)
const char *get_allocation_name(ir_allocation all)
{
#define X(a) case a: return #a
switch (all) {
......@@ -370,13 +370,13 @@ const char *get_allocation_name(ent_allocation all)
}
visibility
ir_visibility
(get_entity_visibility)(const entity *ent) {
return _get_entity_visibility(ent);
}
void
set_entity_visibility (entity *ent, visibility vis) {
set_entity_visibility(entity *ent, ir_visibility vis) {
assert(ent && ent->kind == k_entity);
if (vis != visibility_local)
assert((ent->allocation == allocation_static) ||
......@@ -387,7 +387,7 @@ set_entity_visibility (entity *ent, visibility vis) {
}
/* return the name of the visibility */
const char *get_visibility_name(visibility vis)
const char *get_visibility_name(ir_visibility vis)
{
#define X(a) case a: return #a
switch (vis) {
......@@ -399,13 +399,13 @@ const char *get_visibility_name(visibility vis)
#undef X
}
ent_variability
ir_variability
(get_entity_variability)(const entity *ent) {
return _get_entity_variability(ent);
}
void
set_entity_variability (entity *ent, ent_variability var)
set_entity_variability (entity *ent, ir_variability var)
{
assert(ent && ent->kind == k_entity);
if (var == variability_part_constant)
......@@ -433,7 +433,7 @@ set_entity_variability (entity *ent, ent_variability var)
}
/* return the name of the variability */
const char *get_variability_name(ent_variability var)
const char *get_variability_name(ir_variability var)
{
#define X(a) case a: return #a
switch (var) {
......@@ -446,18 +446,18 @@ const char *get_variability_name(ent_variability var)
#undef X
}
ent_volatility
ir_volatility
(get_entity_volatility)(const entity *ent) {
return _get_entity_volatility(ent);
}
void
(set_entity_volatility)(entity *ent, ent_volatility vol) {
(set_entity_volatility)(entity *ent, ir_volatility vol) {
_set_entity_volatility(ent, vol);
}
/* return the name of the volatility */
const char *get_volatility_name(ent_volatility var)
const char *get_volatility_name(ir_volatility var)
{
#define X(a) case a: return #a
switch (var) {
......@@ -468,25 +468,25 @@ const char *get_volatility_name(ent_volatility var)
#undef X
}
peculiarity
ir_peculiarity
(get_entity_peculiarity)(const entity *ent) {
return _get_entity_peculiarity(ent);
}
void
(set_entity_peculiarity)(entity *ent, peculiarity pec) {
(set_entity_peculiarity)(entity *ent, ir_peculiarity pec) {
_set_entity_peculiarity(ent, pec);
}
/* Get the entity's stickyness */
ent_stickyness
ir_stickyness
(get_entity_stickyness)(const entity *ent) {
return _get_entity_stickyness(ent);
}
/* Set the entity's stickyness */
void
(set_entity_stickyness)(entity *ent, ent_stickyness stickyness) {
(set_entity_stickyness)(entity *ent, ir_stickyness stickyness) {
_set_entity_stickyness(ent, stickyness);
}
......
......@@ -214,69 +214,69 @@ void set_entity_type (entity *ent, ir_type *tp);
/** The allocation type. */
typedef enum {
allocation_automatic, /**< The entity is allocated during runtime, implicitly
as component of a compound type. This is the default. */
as component of a compound type. This is the default. */
allocation_parameter, /**< The entity is a parameter. It is also automatic allocated.
We distinguish the allocation of parameters from the allocation
of local variables as their placement depends on the calling
conventions. */
We distinguish the allocation of parameters from the allocation
of local variables as their placement depends on the calling
conventions. */
allocation_dynamic, /**< The entity is allocated during runtime, explicitly
by an Alloc node. */
by an Alloc node. */
allocation_static /**< The entity is allocated statically. We can use a
Const as address of the entity. This is the default for methods. */
} ent_allocation;
} ir_allocation;
/** Returns the allocation type of an entity. */
ent_allocation get_entity_allocation (const entity *ent);
ir_allocation get_entity_allocation(const entity *ent);
/** Sets the allocation type of an entity. */
void set_entity_allocation (entity *ent, ent_allocation al);
void set_entity_allocation(entity *ent, ir_allocation al);
/** Return the name of the allocation type. */
const char *get_allocation_name(ent_allocation vis);
const char *get_allocation_name(ir_allocation vis);
/** Returns the visibility of an entity. */
visibility get_entity_visibility (const entity *ent);
ir_visibility get_entity_visibility(const entity *ent);
/** Sets the visibility of an entity. */
void set_entity_visibility (entity *ent, visibility vis);
void set_entity_visibility(entity *ent, ir_visibility vis);
/** Return the name of the visibility */
const char *get_visibility_name(visibility vis);
const char *get_visibility_name(ir_visibility vis);
/** This enumeration flags the variability of entities. */
typedef enum {
variability_uninitialized, /**< The content of the entity is completely unknown. Default. */
variability_initialized, /**< After allocation the entity is initialized with the
value given somewhere in the entity. */
value given somewhere in the entity. */
variability_part_constant, /**< For entities of compound types.
The members of the entity are mixed constant,
initialized or uninitialized. */
The members of the entity are mixed constant,
initialized or uninitialized. */
variability_constant /**< The entity is constant. */
} ent_variability;
} ir_variability;
/** Returns the variability of an entity. */
ent_variability get_entity_variability (const entity *ent);
ir_variability get_entity_variability(const entity *ent);
/** Sets the variability of an entity. */
void set_entity_variability (entity *ent, ent_variability var);
void set_entity_variability(entity *ent, ir_variability var);
/** Return the name of the variability. */
const char *get_variability_name(ent_variability var);
const char *get_variability_name(ir_variability var);
/** This enumeration flags the volatility of entities. */
typedef enum {
volatility_non_volatile, /**< The entity is not volatile. Default. */
volatility_is_volatile /**< The entity is volatile */
} ent_volatility;
} ir_volatility;
/** Returns the volatility of an entity. */
ent_volatility get_entity_volatility (const entity *ent);
ir_volatility get_entity_volatility(const entity *ent);
/** Sets the volatility of an entity. */
void set_entity_volatility (entity *ent, ent_volatility vol);
void set_entity_volatility(entity *ent, ir_volatility vol);
/** Return the name of the volatility. */
const char *get_volatility_name(ent_volatility var);
const char *get_volatility_name(ir_volatility var);
/** This enumeration flags the stickyness of an entity. */
typedef enum {
......@@ -285,13 +285,13 @@ typedef enum {
by other attributes. Default. */
stickyness_sticky /**< The entity must remain in the
program in any case. */
} ent_stickyness;
} ir_stickyness;
/** Get the entity's stickyness */
ent_stickyness get_entity_stickyness(const entity *ent);
ir_stickyness get_entity_stickyness(const entity *ent);
/** Set the entity's stickyness */
void set_entity_stickyness(entity *ent, ent_stickyness stickyness);
void set_entity_stickyness(entity *ent, ir_stickyness stickyness);
/** Returns the offset of an entity (in a compound) in bytes. Only set if layout = fixed. */
int get_entity_offset_bytes(const entity *ent);
......@@ -306,10 +306,10 @@ void set_entity_offset_bytes(entity *ent, int offset);
void set_entity_offset_bits(entity *ent, int offset);
/** Returns the stored intermediate information. */
void* get_entity_link(const entity *ent);
void *get_entity_link(const entity *ent);
/** Stores new intermediate information. */
void set_entity_link(entity *ent, void *l);
void set_entity_link(entity *ent, void *l);
/* -- Fields of method entities -- */
/** The entity knows the corresponding irg if the entity is a method.
......@@ -326,10 +326,10 @@ unsigned get_entity_vtable_number(entity *ent);
void set_entity_vtable_number(entity *ent, unsigned vtable_number);
/** Return the peculiarity of an entity. */
peculiarity get_entity_peculiarity (const entity *ent);
ir_peculiarity get_entity_peculiarity(const entity *ent);
/** Sets the peculiarity of an entity. */
void set_entity_peculiarity (entity *ent, peculiarity pec);
void set_entity_peculiarity(entity *ent, ir_peculiarity pec);
/* -- Representation of constant values of entities -- */
/** Returns true if the the node is representable as code on
......
......@@ -105,20 +105,20 @@ struct entity {
is the ident for `A_a'. */
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. */
ent_allocation allocation; /**< Distinguishes static and dynamically allocated
ir_type *owner; /**< The compound type (e.g. class type) this entity belongs to. */
ir_allocation allocation:2; /**< Distinguishes static and dynamically allocated
entities and some further cases. */
visibility visibility; /**< Specifies visibility to external program
fragments. */
ent_variability variability; /**< Specifies variability of entities content. */
ent_volatility volatility; /**< Specifies volatility of entities content. */
ent_stickyness stickyness; /**< Specifies whether this entity is sticky. */
int offset; /**< Offset in bits for this entity. Fixed when layout
of owner is determined. */
peculiarity peculiarity; /**< The peculiarity of this entity. */
unsigned long visit; /**< visited counter for walks of the type information. */
struct dbg_info *dbi; /**< A pointer to information for debug support. */
void *link; /**< To store some intermediate information. */
ir_visibility visibility:2; /**< 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
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. */
void *link; /**< To store some intermediate information. */
/* ------------- fields for entities owned by a class type ---------------*/
......@@ -210,43 +210,43 @@ _set_entity_type(entity *ent, ir_type *type) {
ent->type = type;
}
static INLINE ent_allocation
static INLINE ir_allocation
_get_entity_allocation(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->allocation;
}
static INLINE void
_set_entity_allocation(entity *ent, ent_allocation al) {
_set_entity_allocation(entity *ent, ir_allocation al) {
assert(ent && ent->kind == k_entity);
ent->allocation = al;
}
static INLINE visibility
static INLINE ir_visibility
_get_entity_visibility(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->visibility;
}
static INLINE ent_variability
static INLINE ir_variability
_get_entity_variability(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->variability;
}
static INLINE ent_volatility
static INLINE ir_volatility
_get_entity_volatility(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->volatility;
}
static INLINE void
_set_entity_volatility(entity *ent, ent_volatility vol) {
_set_entity_volatility(entity *ent, ir_volatility vol) {
assert(ent && ent->kind == k_entity);
ent->volatility = vol;
}
static INLINE peculiarity
static INLINE ir_peculiarity
_get_entity_peculiarity(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->peculiarity;
......@@ -260,7 +260,7 @@ _get_entity_peculiarity(const entity *ent) {
* I removed the assertion. GL, 28.2.05
*/
static INLINE void
_set_entity_peculiarity(entity *ent, peculiarity pec) {
_set_entity_peculiarity(entity *ent, ir_peculiarity pec) {
assert(ent && ent->kind == k_entity);
/* @@@ why peculiarity only for methods? */
//assert(is_Method_type(ent->type));
......@@ -268,14 +268,14 @@ _set_entity_peculiarity(entity *ent, peculiarity pec) {
ent->peculiarity = pec;
}
static INLINE ent_stickyness
static INLINE ir_stickyness
_get_entity_stickyness(const entity *ent) {
assert(ent && ent->kind == k_entity);
return ent->stickyness;
}
static INLINE void
_set_entity_stickyness(entity *ent, ent_stickyness stickyness)
_set_entity_stickyness(entity *ent, ir_stickyness stickyness)
{
assert(ent && ent->kind == k_entity);
ent->stickyness = stickyness;
......
......@@ -255,7 +255,7 @@ int (get_type_size_bits)(const ir_type *tp) {
}
visibility get_type_visibility (const ir_type *tp) {
ir_visibility get_type_visibility (const ir_type *tp) {
#if 0
visibility res = visibility_local;
if (is_compound_type(tp)) {
......@@ -279,7 +279,7 @@ visibility get_type_visibility (const ir_type *tp) {
return tp->visibility;
}
void set_type_visibility (ir_type *tp, visibility v) {
void set_type_visibility (ir_type *tp, ir_visibility v) {
assert(is_type(tp));
#if 0
/* check for correctness */
......@@ -955,7 +955,7 @@ void set_class_type_info(ir_type *clss, entity *ent) {
clss->attr.ca.type_info = ent;
}
const char *get_peculiarity_name(peculiarity p) {
const char *get_peculiarity_name(ir_peculiarity p) {
#define X(a) case a: return #a
switch (p) {
X(peculiarity_description);
......@@ -966,12 +966,12 @@ const char *get_peculiarity_name(peculiarity p) {
return "invalid peculiarity";
}
peculiarity get_class_peculiarity (const ir_type *clss) {
ir_peculiarity get_class_peculiarity (const ir_type *clss) {
assert(clss && (clss->type_op == type_class));
return clss->attr.ca.peculiarity;
}
void set_class_peculiarity (ir_type *clss, peculiarity pec) {
void set_class_peculiarity (ir_type *clss, ir_peculiarity pec) {
assert(clss && (clss->type_op == type_class));
assert(pec != peculiarity_inherited); /* There is no inheritance of types in libFirm. */
clss->attr.ca.peculiarity = pec;
......
......@@ -156,7 +156,7 @@ typedef enum {
method.
For types: entities of this type are allocated and accessed from
external code. Default for types. */
} visibility;
} ir_visibility;
/** The visibility of a type.
*
......@@ -196,8 +196,8 @@ typedef enum {
* Entities of types are never visibility_external_allocated (right?).
* Else returns visibility_local.
*/
visibility get_type_visibility (const ir_type *tp);
void set_type_visibility (ir_type *tp, visibility v);
ir_visibility get_type_visibility(const ir_type *tp);
void set_type_visibility(ir_type *tp, ir_visibility v);
......@@ -583,7 +583,7 @@ void remove_class_supertype(ir_type *clss, ir_type *supertype);
#define remove_class_base_type(clss, basetype) remove_class_supertype(clss, basetype)
/** This enumeration flags the peculiarity of entities and types. */
typedef enum peculiarity {
typedef enum {
peculiarity_description, /**< Represents only a description. The entity/type is never
allocated, no code/data exists for this entity/type.
@@@ eventually rename to descriptive (adjective as the others!)*/
......@@ -597,15 +597,15 @@ typedef enum peculiarity {
peculiarity_existent /**< The entity/type (can) exist.
@@@ eventually rename to 'real' i.e., 'echt'
This serves better as opposition to description _and_ inherited.*/
} peculiarity;
} ir_peculiarity;
/** Returns a human readable string for a peculiarity. */
const char *get_peculiarity_name(peculiarity p);
const char *get_peculiarity_name(ir_peculiarity p);
/** Returns the peculiarity of the class. */
peculiarity get_class_peculiarity (const ir_type *clss);
ir_peculiarity get_class_peculiarity (const ir_type *clss);
/** Sets the peculiarity of the class. */
void set_class_peculiarity (ir_type *clss, peculiarity pec);
void set_class_peculiarity (ir_type *clss, ir_peculiarity pec);
/** Returns the type info entity of a class. */
entity *get_class_type_info(const ir_type *clss);
......
......@@ -38,14 +38,14 @@ enum class_flags {
/** Class type attributes. */
typedef struct {
entity **members; /**< Array containing the fields and methods of this class. */
ir_type **subtypes; /**< Array containing the direct subtypes. */
ir_type **supertypes; /**< Array containing the direct supertypes */
peculiarity peculiarity; /**< The peculiarity of this class. */
entity *type_info; /**< An entity representing this class, used for type info. */
int dfn; /**< A number that can be used for 'instanceof' operator. */
unsigned vtable_size; /**< The size of the vtable for this class. */
unsigned clss_flags; /**< Additional class flags. */
entity **members; /**< Array containing the fields and methods of this class. */
ir_type **subtypes; /**< Array containing the direct subtypes. */
ir_type **supertypes; /**< Array containing the direct supertypes */
ir_peculiarity peculiarity; /**< The peculiarity of this class. */
entity *type_info; /**< An entity representing this class, used for type info. */
int dfn; /**< A number that can be used for 'instanceof' operator. */
unsigned vtable_size; /**< The size of the vtable for this class. */
unsigned clss_flags; /**< Additional class flags. */
} cls_attr;
/** Struct type attributes. */
......@@ -145,7 +145,7 @@ struct ir_type {
firm_kind kind; /**< the firm kind, must be k_type */
const tp_op *type_op; /**< the type operation of the type */
ident *name; /**< The name of the type */
visibility visibility; /**< Visibility of entities of this type. */
ir_visibility visibility;/**< Visibility of entities of this type. */
unsigned flags; /**< Type flags, a bitmask of enum type_flags. */
int size; /**< Size of an entity of this type. This is determined
when fixing the layout of this class. Size must be
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment