/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
{
ir_entity *ent1 = NULL, *ent2 = NULL;
- if (is_SymConst(adr1) && get_SymConst_kind(adr1) == symconst_addr_ent)
+ if (is_SymConst_addr_ent(adr1))
ent1 = get_SymConst_entity(adr1);
else if (is_Sel(adr1))
ent1 = get_Sel_entity(adr1);
- if (is_SymConst(adr2) && get_SymConst_kind(adr2) == symconst_addr_ent)
+ if (is_SymConst_addr_ent(adr2))
ent2 = get_SymConst_entity(adr2);
else if (is_Sel(adr2))
ent2 = get_Sel_entity(adr2);
/**
* Returns true if an address represents a global variable.
+ *
+ * @param irn the node representing the address
*/
static INLINE int is_global_var(ir_node *irn) {
- return is_SymConst(irn) && get_SymConst_kind(irn) == symconst_addr_ent;
+ return is_SymConst_addr_ent(irn);
} /* is_global_var */
/**
if (is_atomic_entity(ent)) {
/* let's check if it's an address */
n = get_atomic_ent_value(ent);
- if (is_SymConst(n) && get_SymConst_kind(n) == symconst_addr_ent) {
+ if (is_SymConst_addr_ent(n)) {
ir_entity *ent = get_SymConst_entity(n);
set_entity_address_taken(ent, ir_address_taken);
}
n = get_compound_ent_value(ent, i);
/* let's check if it's an address */
- if (is_SymConst(n) && get_SymConst_kind(n) == symconst_addr_ent) {
+ if (is_SymConst_addr_ent(n)) {
ir_entity *ent = get_SymConst_entity(n);
set_entity_address_taken(ent, ir_address_taken);
}
ir_entity *ent;
ir_address_taken_state state;
- if (is_SymConst(irn) && get_SymConst_kind(irn) == symconst_addr_ent) {
+ if (is_SymConst_addr_ent(irn)) {
/* A global. */
ent = get_SymConst_entity(irn);
} else if (is_Sel(irn) && get_Sel_ptr(irn) == tls) {
res = clone_type_method(tp, prefix);
pmap_insert(mtp_map, tp, res);
+ DB((dbgcall, LEVEL_2, "cloned type %+F into %+F\n", tp, res));
return res;
} /* clone_type_and_cache */
if (is_SymConst(ptr)) {
ir_entity *ent = get_SymConst_entity(ptr);
- ir_type *mtp = get_entity_type(ent);
ir_type *ctp = get_Call_type(call);
- if ((get_method_additional_properties(ctp) & mtp_property_private) == 0) {
- ctp = clone_type_and_cache(ctp);
- set_method_additional_property(ctp, mtp_property_private);
- set_Call_type(call, ctp);
- DB((dbgcall, LEVEL_1, "changed call to private method %+F\n", ent));
+ if (get_entity_additional_properties(ent) & mtp_property_private) {
+ if ((get_method_additional_properties(ctp) & mtp_property_private) == 0) {
+ ctp = clone_type_and_cache(ctp);
+ set_method_additional_property(ctp, mtp_property_private);
+ set_Call_type(call, ctp);
+ DB((dbgcall, LEVEL_1, "changed call to private method %+F\n", ent));
+ }
}
}
}
ir_type *mtp = get_entity_type(ent);
set_entity_additional_property(ent, mtp_property_private);
+ DB((dbgcall, LEVEL_1, "found private method %+F\n", ent));
if ((get_method_additional_properties(mtp) & mtp_property_private) == 0) {
/* need a new type */
mtp = clone_type_and_cache(mtp);
set_method_additional_property(mtp, mtp_property_private);
changed = 1;
}
- DB((dbgcall, LEVEL_1, "found private method %+F\n", ent));
}
}