Commit 4790b5e3 authored by Michael Beck's avatar Michael Beck
Browse files

renames all is_x*_type() functions to is_X*_type() to prevent name clash with EDG fronten

renames the inline fucntions from __x to _x (__ is reserved to the compiler and shouldn't be used)

[r4817]
parent 5940b775
......@@ -115,7 +115,7 @@ new_rd_entity (dbg_info *db, type *owner, ident *name, type *type)
res->visibility = visibility_local;
res->offset = -1;
if (is_method_type(type)) {
if (is_Method_type(type)) {
symconst_symbol sym;
sym.entity_p = res;
res->variability = variability_constant;
......@@ -133,7 +133,7 @@ new_rd_entity (dbg_info *db, type *owner, ident *name, type *type)
res->volatility = volatility_non_volatile;
res->stickyness = stickyness_unsticky;
res->ld_name = NULL;
if (is_class_type(owner)) {
if (is_Class_type(owner)) {
res->overwrites = NEW_ARR_F(entity *, 0);
res->overwrittenby = NEW_ARR_F(entity *, 0);
} else {
......@@ -206,7 +206,7 @@ copy_entity_own (entity *old, type *new_owner) {
newe = xmalloc(sizeof(*newe));
memcpy (newe, old, sizeof(*newe));
newe->owner = new_owner;
if (is_class_type(new_owner)) {
if (is_Class_type(new_owner)) {
newe->overwrites = NEW_ARR_F(entity *, 0);
newe->overwrittenby = NEW_ARR_F(entity *, 0);
}
......@@ -229,7 +229,7 @@ copy_entity_name (entity *old, ident *new_name) {
memcpy(newe, old, sizeof(*newe));
newe->name = new_name;
newe->ld_name = NULL;
if (is_class_type(newe->owner)) {
if (is_Class_type(newe->owner)) {
newe->overwrites = DUP_ARR_F(entity *, old->overwrites);
newe->overwrittenby = DUP_ARR_F(entity *, old->overwrittenby);
}
......@@ -387,7 +387,7 @@ set_entity_variability (entity *ent, ent_variability var)
{
assert(ent && ent->kind == k_entity);
if (var == variability_part_constant)
assert(is_class_type(ent->type) || is_struct_type(ent->type));
assert(is_Class_type(ent->type) || is_Struct_type(ent->type));
if ((is_compound_type(ent->type)) &&
(ent->variability == variability_uninitialized) && (var != variability_uninitialized)) {
......@@ -395,7 +395,7 @@ set_entity_variability (entity *ent, ent_variability var)
ent->values = NEW_ARR_F(ir_node *, 0);
ent->val_paths = NEW_ARR_F(compound_graph_path *, 0);
}
if ((is_atomic_type(ent->type)) &&
if ((is_Atomic_type(ent->type)) &&
(ent->variability == variability_uninitialized) && (var != variability_uninitialized)) {
/* Set default constant value. */
ent->value = new_rd_Unknown(get_const_code_irg(), get_type_mode(ent->type));
......@@ -493,7 +493,7 @@ get_atomic_ent_value(entity *ent)
void
set_atomic_ent_value(entity *ent, ir_node *val) {
assert(is_atomic_entity(ent) && (ent->variability != variability_uninitialized));
if (is_method_type(ent->type) && (ent->peculiarity == peculiarity_existent))
if (is_Method_type(ent->type) && (ent->peculiarity == peculiarity_existent))
return;
ent->value = val;
}
......@@ -619,7 +619,7 @@ int is_proper_compound_graph_path(compound_graph_path *gr, int pos) {
owner = get_entity_type(node);
}
if (pos == get_compound_graph_path_length(gr))
if (!is_atomic_type(owner)) return false;
if (!is_Atomic_type(owner)) return false;
return true;
}
......@@ -718,7 +718,7 @@ add_compound_ent_value(entity *ent, ir_node *val, entity *member) {
assert(is_compound_entity(ent) && (ent->variability != variability_uninitialized));
path = new_compound_graph_path(owner_tp, 1);
path->nodes[0] = member;
if (is_array_type(owner_tp)) {
if (is_Array_type(owner_tp)) {
int max;
int i;
......@@ -783,7 +783,7 @@ set_array_entity_values(entity *ent, tarval **values, int num_vals) {
ir_node *val;
type *elttp = get_array_element_type(arrtp);
assert(is_array_type(arrtp));
assert(is_Array_type(arrtp));
assert(get_array_n_dimensions(arrtp) == 1);
/* One bound is sufficient, the number of constant fields makes the
size. */
......@@ -813,7 +813,7 @@ int get_compound_ent_value_offset_bits(entity *ent, int pos) {
entity *node = get_compound_graph_path_node(path, i);
type *node_tp = get_entity_type(node);
type *owner_tp = get_entity_owner(node);
if (is_array_type(owner_tp)) {
if (is_Array_type(owner_tp)) {
int size = get_type_size_bits(node_tp);
int align = get_type_alignment_bits(node_tp);
if (size < align)
......@@ -903,7 +903,7 @@ void compute_compound_ent_array_indicees(entity *ent) {
/* We can not compute the indexes if there is more than one array
with an unknown bound. For this remember the first entity that
represents such an array. It could be ent. */
if (is_array_type(tp)) {
if (is_Array_type(tp)) {
int dim = 0;
assert(get_array_n_dimensions(tp) == 1 && "other not implemented");
......@@ -920,7 +920,7 @@ void compute_compound_ent_array_indicees(entity *ent) {
entity *node = get_compound_graph_path_node(path, j);
type *elem_tp = get_entity_type(node);
if (is_array_type(elem_tp)) {
if (is_Array_type(elem_tp)) {
int dim = 0;
assert(get_array_n_dimensions(elem_tp) == 1 && "other not implemented");
if (!has_array_lower_bound(elem_tp, dim) || !has_array_upper_bound(elem_tp, dim)) {
......@@ -940,7 +940,7 @@ void compute_compound_ent_array_indicees(entity *ent) {
for (j = 0; j < path_len; ++j) {
entity *node = get_compound_graph_path_node(path, j);
type *owner_tp = get_entity_owner(node);
if (is_array_type(owner_tp))
if (is_Array_type(owner_tp))
set_compound_graph_path_array_index (path, j, get_next_index(node));
}
}
......@@ -1048,21 +1048,21 @@ void
void
add_entity_overwrites(entity *ent, entity *overwritten) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
ARR_APP1(entity *, ent->overwrites, overwritten);
ARR_APP1(entity *, overwritten->overwrittenby, ent);
}
int
get_entity_n_overwrites(entity *ent) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
return (ARR_LEN(ent->overwrites));
}
int
get_entity_overwrites_index(entity *ent, entity *overwritten) {
int i;
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
for (i = 0; i < get_entity_n_overwrites(ent); i++)
if (get_entity_overwrites(ent, i) == overwritten)
return i;
......@@ -1071,14 +1071,14 @@ get_entity_overwrites_index(entity *ent, entity *overwritten) {
entity *
get_entity_overwrites (entity *ent, int pos) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
assert(pos < get_entity_n_overwrites(ent));
return ent->overwrites[pos];
}
void
set_entity_overwrites (entity *ent, int pos, entity *overwritten) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
assert(pos < get_entity_n_overwrites(ent));
ent->overwrites[pos] = overwritten;
}
......@@ -1086,7 +1086,7 @@ set_entity_overwrites (entity *ent, int pos, entity *overwritten) {
void
remove_entity_overwrites(entity *ent, entity *overwritten) {
int i;
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
for (i = 0; i < (ARR_LEN (ent->overwrites)); i++)
if (ent->overwrites[i] == overwritten) {
for(; i < (ARR_LEN (ent->overwrites))-1; i++)
......@@ -1098,20 +1098,20 @@ remove_entity_overwrites(entity *ent, entity *overwritten) {
void
add_entity_overwrittenby (entity *ent, entity *overwrites) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
add_entity_overwrites(overwrites, ent);
}
int
get_entity_n_overwrittenby (entity *ent) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
return (ARR_LEN (ent->overwrittenby));
}
int
get_entity_overwrittenby_index(entity *ent, entity *overwrites) {
int i;
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
for (i = 0; i < get_entity_n_overwrittenby(ent); i++)
if (get_entity_overwrittenby(ent, i) == overwrites)
return i;
......@@ -1120,21 +1120,21 @@ get_entity_overwrittenby_index(entity *ent, entity *overwrites) {
entity *
get_entity_overwrittenby (entity *ent, int pos) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
assert(pos < get_entity_n_overwrittenby(ent));
return ent->overwrittenby[pos];
}
void
set_entity_overwrittenby (entity *ent, int pos, entity *overwrites) {
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
assert(pos < get_entity_n_overwrittenby(ent));
ent->overwrittenby[pos] = overwrites;
}
void remove_entity_overwrittenby(entity *ent, entity *overwrites) {
int i;
assert(ent && is_class_type(get_entity_owner(ent)));
assert(ent && is_Class_type(get_entity_owner(ent)));
for (i = 0; i < (ARR_LEN (ent->overwrittenby)); i++)
if (ent->overwrittenby[i] == overwrites) {
for(; i < (ARR_LEN (ent->overwrittenby))-1; i++)
......@@ -1162,7 +1162,7 @@ ir_graph *
void
set_entity_irg(entity *ent, ir_graph *irg) {
assert(ent && is_method_type(get_entity_type(ent)));
assert(ent && is_Method_type(get_entity_type(ent)));
/* Wie kann man die Referenz auf einen IRG lschen, z.B. wenn die
* Methode selbst nicht mehr aufgerufen werden kann, die Entitt
* aber erhalten bleiben soll? Wandle die Entitaet in description oder
......@@ -1184,15 +1184,15 @@ int
int is_atomic_entity(entity *ent) {
type* t = get_entity_type(ent);
assert(ent && ent->kind == k_entity);
return (is_primitive_type(t) || is_pointer_type(t) ||
is_enumeration_type(t) || is_method_type(t));
return (is_Primitive_type(t) || is_Pointer_type(t) ||
is_Enumeration_type(t) || is_Method_type(t));
}
int is_compound_entity(entity *ent) {
type* t = get_entity_type(ent);
assert(ent && ent->kind == k_entity);
return (is_class_type(t) || is_struct_type(t) ||
is_array_type(t) || is_union_type(t));
return (is_Class_type(t) || is_Struct_type(t) ||
is_Array_type(t) || is_Union_type(t));
}
/**
......
......@@ -225,7 +225,7 @@ static INLINE void
__set_entity_peculiarity(entity *ent, peculiarity pec) {
assert(ent && ent->kind == k_entity);
/* @@@ why peculiarity only for methods? */
assert(is_method_type(ent->type));
assert(is_Method_type(ent->type));
ent->peculiarity = pec;
}
......@@ -283,7 +283,7 @@ __set_entity_link(entity *ent, void *l) {
static INLINE ir_graph *
__get_entity_irg(const entity *ent) {
assert(ent && ent->kind == k_entity);
assert(ent == unknown_entity || is_method_type(ent->type));
assert(ent == unknown_entity || is_Method_type(ent->type));
if (!get_visit_pseudo_irgs() && ent->irg && is_pseudo_ir_graph(ent->irg))
return NULL;
return ent->irg;
......
......@@ -152,7 +152,7 @@ static int constants_on_wrong_irg(entity *ent) {
if (get_atomic_ent_value(ent))
return constant_on_wrong_irg(get_atomic_ent_value(ent));
else if (get_entity_visibility(ent) != visibility_external_allocated)
assert((is_class_type(get_entity_owner(ent)) &&
assert((is_Class_type(get_entity_owner(ent)) &&
get_class_peculiarity(get_entity_owner(ent)) == peculiarity_description) &&
"Value in constant atomic entity not set.");
}
......@@ -180,7 +180,7 @@ static int check_entity(entity *ent) {
set_visit_pseudo_irgs(1);
if ((get_entity_peculiarity(ent) == peculiarity_existent) &&
(get_entity_visibility(ent) != visibility_external_allocated) &&
(is_method_type(get_entity_type(ent))) &&
(is_Method_type(get_entity_type(ent))) &&
(!get_entity_irg(ent) || !(is_ir_graph(get_entity_irg(ent))))) {
assert(0 && "Method ents with pec_exist must have an irg");
return error_existent_entity_without_irg;
......
......@@ -98,9 +98,9 @@ void init_type(void) {
unsigned long type_visited;
void (set_master_type_visited)(unsigned long val) { __set_master_type_visited(val); }
unsigned long (get_master_type_visited)(void) { return __get_master_type_visited(); }
void (inc_master_type_visited)(void) { __inc_master_type_visited(); }
void (set_master_type_visited)(unsigned long val) { _set_master_type_visited(val); }
unsigned long (get_master_type_visited)(void) { return _get_master_type_visited(); }
void (inc_master_type_visited)(void) { _inc_master_type_visited(); }
type *
......@@ -140,7 +140,7 @@ void free_type(type *tp) {
/* Free the attributes of the type. */
free_type_attrs(tp);
/* Free entities automatically allocated with the type */
if (is_array_type(tp))
if (is_Array_type(tp))
free_entity(get_array_element_entity(tp));
/* And now the type itself... */
tp->kind = k_BAD;
......@@ -178,20 +178,20 @@ void free_type_attrs(type *tp) {
/* set/get the link field */
void *(get_type_link)(const type *tp)
{
return __get_type_link(tp);
return _get_type_link(tp);
}
void (set_type_link)(type *tp, void *l)
{
__set_type_link(tp, l);
_set_type_link(tp, l);
}
const tp_op *(get_type_tpop)(const type *tp) {
return __get_type_tpop(tp);
return _get_type_tpop(tp);
}
ident *(get_type_tpop_nameid)(const type *tp) {
return __get_type_tpop_nameid(tp);
return _get_type_tpop_nameid(tp);
}
const char* get_type_tpop_name(const type *tp) {
......@@ -200,11 +200,11 @@ const char* get_type_tpop_name(const type *tp) {
}
tp_opcode (get_type_tpop_code)(const type *tp) {
return __get_type_tpop_code(tp);
return _get_type_tpop_code(tp);
}
ir_mode *(get_type_mode)(const type *tp) {
return __get_type_mode(tp);
return _get_type_mode(tp);
}
void set_type_mode(type *tp, ir_mode* m) {
......@@ -244,11 +244,11 @@ void set_type_mode(type *tp, ir_mode* m) {
}
ident *(get_type_ident)(const type *tp) {
return __get_type_ident(tp);
return _get_type_ident(tp);
}
void (set_type_ident)(type *tp, ident* id) {
__set_type_ident(tp, id);
_set_type_ident(tp, id);
}
/* Outputs a unique number for this node */
......@@ -267,11 +267,11 @@ const char* get_type_name(const type *tp) {
}
int (get_type_size_bytes)(const type *tp) {
return __get_type_size_bytes(tp);
return _get_type_size_bytes(tp);
}
int (get_type_size_bits)(const type *tp) {
return __get_type_size_bits(tp);
return _get_type_size_bits(tp);
}
void
......@@ -311,7 +311,7 @@ int get_type_alignment_bits(type *tp) {
/* alignment NOT set calculate it "on demand" */
if (tp->mode)
align = get_mode_size_bits(tp->mode);
else if (is_array_type(tp))
else if (is_Array_type(tp))
align = get_type_alignment_bits(get_array_element_type(tp));
else if (is_compound_type(tp)) {
int i, n = get_compound_n_members(tp);
......@@ -325,7 +325,7 @@ int get_type_alignment_bits(type *tp) {
align = a;
}
}
else if (is_method_type(tp))
else if (is_Method_type(tp))
align = 0;
/* write back */
......@@ -349,7 +349,7 @@ set_type_alignment_bytes(type *tp, int align) {
}
type_state (get_type_state)(const type *tp) {
return __get_type_state(tp);
return _get_type_state(tp);
}
void
......@@ -374,7 +374,7 @@ set_type_state(type *tp, type_state state) {
{ DDMT(tp); DDME(get_class_member(tp, i)); }
assert(get_entity_offset_bits(get_class_member(tp, i)) > -1);
/* TR ??
assert(is_method_type(get_entity_type(get_class_member(tp, i))) ||
assert(is_Method_type(get_entity_type(get_class_member(tp, i))) ||
(get_entity_allocation(get_class_member(tp, i)) == allocation_automatic));
*/
}
......@@ -409,29 +409,29 @@ set_type_state(type *tp, type_state state) {
}
unsigned long (get_type_visited)(const type *tp) {
return __get_type_visited(tp);
return _get_type_visited(tp);
}
void (set_type_visited)(type *tp, unsigned long num) {
__set_type_visited(tp, num);
_set_type_visited(tp, num);
}
/* Sets visited field in type to type_visited. */
void (mark_type_visited)(type *tp) {
__mark_type_visited(tp);
_mark_type_visited(tp);
}
/* @@@ name clash with master flag
int (type_visited)(const type *tp) {
return __type_visited(tp);
return _type_visited(tp);
}*/
int (type_not_visited)(const type *tp) {
return __type_not_visited(tp);
return _type_not_visited(tp);
}
int (is_type)(const void *thing) {
return __is_type(thing);
return _is_type(thing);
}
/* Checks whether two types are structural equal.*/
......@@ -740,7 +740,7 @@ void add_class_member (type *clss, entity *member) {
}
int (get_class_n_members) (const type *clss) {
return __get_class_n_members(clss);
return _get_class_n_members(clss);
}
int get_class_member_index(type *clss, entity *mem) {
......@@ -753,7 +753,7 @@ int get_class_member_index(type *clss, entity *mem) {
}
entity *(get_class_member) (const type *clss, int pos) {
return __get_class_member(clss, pos);
return _get_class_member(clss, pos);
}
entity *get_class_member_by_name(type *clss, ident *name) {
......@@ -910,14 +910,14 @@ int get_class_dfn (const type *clss)
}
/* typecheck */
int (is_class_type)(const type *clss) {
return __is_class_type(clss);
int (is_Class_type)(const type *clss) {
return _is_class_type(clss);
}
/* Returns true if low is subclass of high. */
int is_subclass_of(type *low, type *high) {
int i;
assert(is_class_type(low) && is_class_type(high));
assert(is_Class_type(low) && is_Class_type(high));
if (low == high) return 1;
/* depth first search from high downwards. */
for (i = 0; i < get_class_n_subtypes(high); i++) {
......@@ -1003,8 +1003,8 @@ void remove_struct_member(type *strct, entity *member) {
}
/* typecheck */
int (is_struct_type)(const type *strct) {
return __is_struct_type(strct);
int (is_Struct_type)(const type *strct) {
return _is_struct_type(strct);
}
/*******************************************************************/
......@@ -1236,8 +1236,8 @@ void set_method_first_variadic_param_index(type *method, int index)
}
/* typecheck */
int (is_method_type)(const type *method) {
return __is_method_type(method);
int (is_Method_type)(const type *method) {
return _is_method_type(method);
}
/*-----------------------------------------------------------------*/
......@@ -1331,8 +1331,8 @@ void remove_union_member(type *uni, entity *member) {
}
/* typecheck */
int (is_union_type)(const type *uni) {
return __is_union_type(uni);
int (is_Union_type)(const type *uni) {
return _is_union_type(uni);
}
/*-----------------------------------------------------------------*/
......@@ -1346,7 +1346,7 @@ type *new_type_array (ident *name, int n_dimensions,
type *res;
int i;
ir_graph *rem = current_ir_graph;
assert(!is_method_type(element_type));
assert(!is_Method_type(element_type));
res = new_type(type_array, NULL, name);
res->attr.aa.n_dimensions = n_dimensions;
......@@ -1479,7 +1479,7 @@ int get_array_order (const type *array, int dimension) {
void set_array_element_type (type *array, type *tp) {
assert(array && (array->type_op == type_array));
assert(!is_method_type(tp));
assert(!is_Method_type(tp));
array->attr.aa.element_type = tp;
}
type *get_array_element_type (type *array) {
......@@ -1499,8 +1499,8 @@ entity *get_array_element_entity (const type *array) {
}
/* typecheck */
int (is_array_type)(const type *array) {
return __is_array_type(array);
int (is_Array_type)(const type *array) {
return _is_array_type(array);
}
/*-----------------------------------------------------------------*/
......@@ -1563,8 +1563,8 @@ const char *get_enumeration_name(const type *enumeration, int pos) {
}
/* typecheck */
int (is_enumeration_type)(const type *enumeration) {
return __is_enumeration_type(enumeration);
int (is_Enumeration_type)(const type *enumeration) {
return _is_enumeration_type(enumeration);
}
/*-----------------------------------------------------------------*/
......@@ -1604,8 +1604,8 @@ type *get_pointer_points_to_type (type *pointer) {
}
/* typecheck */
int (is_pointer_type)(const type *pointer) {
return __is_pointer_type(pointer);
int (is_Pointer_type)(const type *pointer) {
return _is_pointer_type(pointer);
}
/* Returns the first pointer type that has as points_to tp.
......@@ -1615,7 +1615,7 @@ type *find_pointer_type_to_type (type *tp) {
int i;
for (i = 0; i < get_irp_n_types(); ++i) {
type *found = get_irp_type(i);
if (is_pointer_type(found) && get_pointer_points_to_type(found) == tp)
if (is_Pointer_type(found) && get_pointer_points_to_type(found) == tp)
return (found);
}
return firm_unknown_type;
......@@ -1649,8 +1649,8 @@ void free_primitive_attrs (type *primitive) {
}
/* typecheck */
int (is_primitive_type)(const type *primitive) {
return __is_primitive_type(primitive);
int (is_Primitive_type)(const type *primitive) {
return _is_primitive_type(primitive);
}
/*-----------------------------------------------------------------*/
......@@ -1658,8 +1658,8 @@ int (is_primitive_type)(const type *primitive) {
/*-----------------------------------------------------------------*/
int (is_atomic_type)(const type *tp) {
return __is_atomic_type(tp);
int (is_Atomic_type)(const type *tp) {
return _is_atomic_type(tp);
}
/*
......@@ -1669,11 +1669,11 @@ int get_compound_n_members(const type *tp)
{
int res = 0;
if (is_struct_type(tp))
if (is_Struct_type(tp))
res = get_struct_n_members(tp);
else if (is_class_type(tp))
else if (is_Class_type(tp))
res = get_class_n_members(tp);
else if (is_union_type(tp))
else if (is_Union_type(tp))
res = get_union_n_members(tp);
else
assert(0 && "need struct, union or class for member count");
......@@ -1688,11 +1688,11 @@ entity *get_compound_member(const type *tp, int pos)
{
entity *res;
if (is_struct_type(tp))
if (is_Struct_type(tp))
res = get_struct_member(tp, pos);
else if (is_class_type(tp))
else if (is_Class_type(tp))
res = get_class_member(tp, pos);
else if (is_union_type(tp))
else if (is_Union_type(tp))
res = get_union_member(tp, pos);
else
{
......
......@@ -481,7 +481,7 @@ void set_class_dfn (type *clss, int dfn);
int get_class_dfn (const type *clss);
/** Returns true if a type is a class type. */
int is_class_type(const type *clss);
int is_Class_type(const type *clss);
/** Returns true if low is subclass of high. */
int is_subclass_of(type *low, type *high);
......@@ -528,7 +528,7 @@ void set_struct_member (type *strct, int pos, entity *member);
void remove_struct_member (type *strct, entity *member);
/** Returns true if a type is a struct type. */
int is_struct_type(const type *strct);
int is_Struct_type(const type *strct);