/** Gets the string representation of the jump prediction. */
FIRM_API const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred);
-/** Checks whether a node represents a global address. */
-FIRM_API int is_Global(const ir_node *node);
-
-/** Returns the entity of a global address. */
-FIRM_API ir_entity *get_Global_entity(const ir_node *node);
-
/**
* Access custom node data.
* The data must have been registered with
} else {
ir_entity *meth_ent;
- if (is_Global(ptr)) {
- meth_ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ meth_ent = get_SymConst_entity(ptr);
for (p = get_Call_n_params(succ) - 1; p >= 0; --p) {
if (get_Call_param(succ, p) == arg) {
n = initializer->consti.value;
/* let's check if it's the address of a function */
- if (is_Global(n)) {
- ir_entity *ent = get_Global_entity(n);
+ if (is_SymConst_addr_ent(n)) {
+ ir_entity *ent = get_SymConst_entity(n);
if (is_Method_type(get_entity_type(ent)))
eset_insert(set, ent);
ir_node *irn = get_compound_ent_value(ent, i);
/* let's check if it's the address of a function */
- if (is_Global(irn)) {
- ir_entity *ent2 = get_Global_entity(irn);
+ if (is_SymConst_addr_ent(irn)) {
+ ir_entity *ent2 = get_SymConst_entity(irn);
if (is_Method_type(get_entity_type(ent2)))
eset_insert(set, ent2);
{
ir_entity *ent1 = NULL, *ent2 = NULL;
- if (is_Global(adr1))
- ent1 = get_Global_entity(adr1);
+ if (is_SymConst_addr_ent(adr1))
+ ent1 = get_SymConst_entity(adr1);
else if (is_Sel(adr1))
ent1 = get_Sel_entity(adr1);
- if (is_Global(adr2))
- ent2 = get_Global_entity(adr2);
+ if (is_SymConst_addr_ent(adr2))
+ ent2 = get_SymConst_entity(adr2);
else if (is_Sel(adr2))
ent2 = get_Sel_entity(adr2);
if (! is_Call(node))
return 0;
node = get_Call_ptr(node);
- if (is_Global(node)) {
- ir_entity *ent = get_Global_entity(node);
+ if (is_SymConst_addr_ent(node)) {
+ ir_entity *ent = get_SymConst_entity(node);
if (get_entity_additional_properties(ent) & mtp_property_malloc)
return 1;
{
ir_graph *irg = get_irn_irg(irn);
ir_storage_class_class_t res = ir_sc_pointer;
- if (is_Global(irn)) {
- ir_entity *entity = get_Global_entity(irn);
+ if (is_SymConst_addr_ent(irn)) {
+ ir_entity *entity = get_SymConst_entity(irn);
ir_type *owner = get_entity_owner(entity);
res = owner == get_tls_type() ? ir_sc_tls : ir_sc_globalvar;
if (! (get_entity_usage(entity) & ir_usage_address_taken))
case IR_INITIALIZER_CONST:
/* let's check if it's an address */
n = initializer->consti.value;
- if (is_Global(n)) {
- ir_entity *ent = get_Global_entity(n);
+ if (is_SymConst_addr_ent(n)) {
+ ir_entity *ent = get_SymConst_entity(n);
set_entity_usage(ent, ir_usage_unknown);
}
return;
ir_node *irn = get_compound_ent_value(ent, i);
/* let's check if it's an address */
- if (is_Global(irn)) {
- ir_entity *symconst_ent = get_Global_entity(irn);
+ if (is_SymConst_addr_ent(irn)) {
+ ir_entity *symconst_ent = get_SymConst_entity(irn);
set_entity_usage(symconst_ent, ir_usage_unknown);
}
}
unsigned flags;
(void) data;
- if (is_Global(irn)) {
+ if (is_SymConst_addr_ent(irn)) {
/* A global. */
- ent = get_Global_entity(irn);
+ ent = get_SymConst_entity(irn);
} else
return;
return NULL;
}
- symconst_ent = get_Global_entity(symconst);
+ symconst_ent = get_SymConst_entity(symconst);
}
if (cnst == NULL && symconst == NULL)
return NULL;
return _get_irn_dbg_info(n);
}
-/* checks whether a node represents a global address */
-int is_Global(const ir_node *node)
-{
- return is_SymConst_addr_ent(node);
-}
-
-/* returns the entity of a global address */
-ir_entity *get_Global_entity(const ir_node *node)
-{
- return get_SymConst_entity(node);
-}
-
/*
* Calculate a hash value of a node.
*/
ir_entity *ent;
symconst = get_Call_ptr(node);
- if (! is_Global(symconst))
+ if (! is_SymConst_addr_ent(symconst))
return;
- ent = get_Global_entity(symconst);
+ ent = get_SymConst_entity(symconst);
p = pmap_find(wenv->c_map, ent);
if (p) {
*/
static ir_entity *get_const_entity(ir_node *ptr)
{
- if (is_Global(ptr)) {
- ir_entity *ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ir_entity *ent = get_SymConst_entity(ptr);
if (get_entity_linkage(ent) & IR_LINKAGE_CONSTANT) {
/* a constant entity */
/* set the link to NULL for all non-const/pure calls */
set_irn_link(call, NULL);
ptr = get_Call_ptr(call);
- if (is_Global(ptr)) {
- ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ent = get_SymConst_entity(ptr);
prop = get_entity_additional_properties(ent);
if ((prop & (mtp_property_const|mtp_property_pure)) == 0)
/* set the link to NULL for all non-const/pure calls */
set_irn_link(call, NULL);
ptr = get_Call_ptr(call);
- if (is_Global(ptr)) {
- ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ent = get_SymConst_entity(ptr);
prop = get_entity_additional_properties(ent);
if ((prop & mtp_property_nothrow) == 0)
break;
case iro_Call:
ptr = get_Call_ptr(succ);
- if (is_Global(ptr)) {
- ir_entity *ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ir_entity *ent = get_SymConst_entity(ptr);
size_t i;
/* we know the called entity */
} else if (is_Call(res)) {
ir_node *ptr = get_Call_ptr(res);
- if (is_Global(ptr)) {
+ if (is_SymConst_addr_ent(ptr)) {
/* a direct call */
- ir_entity *ent = get_Global_entity(ptr);
+ ir_entity *ent = get_SymConst_entity(ptr);
ir_graph *callee = get_entity_irg(ent);
if (callee == irg) {
if (is_Call(pred)) {
ir_node *ptr = get_Call_ptr(pred);
- if (is_Global(ptr)) {
+ if (is_SymConst_addr_ent(ptr)) {
/* a direct call */
- ir_entity *ent = get_Global_entity(ptr);
+ ir_entity *ent = get_SymConst_entity(ptr);
ir_graph *callee = get_entity_irg(ent);
if (callee == irg) {
/* try the called entity */
ir_node *ptr = get_Call_ptr(call);
- if (is_Global(ptr)) {
- ir_entity *ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ir_entity *ent = get_SymConst_entity(ptr);
prop = get_entity_additional_properties(ent);
}
continue;
/* for now, we can only move Load(Global) */
- if (! is_Global(ptr))
+ if (! is_SymConst_addr_ent(ptr))
continue;
load_mode = get_Load_mode(load);
for (other = pscc->head; other != NULL; other = next_other) {
break;
}
- if (is_Global(n)) {
+ if (is_SymConst_addr_ent(n)) {
/* global references are never NULL */
return 1;
} else if (n == get_irg_frame(get_irn_irg(n))) {
ir_node *addr;
addr = get_Call_ptr(call);
- if (is_Global(addr)) {
- ir_entity *ent = get_Global_entity(addr);
+ if (is_SymConst_addr_ent(addr)) {
+ ir_entity *ent = get_SymConst_entity(addr);
/* we don't know which function gets finally bound to a weak symbol */
if (get_entity_linkage(ent) & IR_LINKAGE_WEAK)
return NULL;
if (env->ignore_runtime) {
ir_node *symc = get_Call_ptr(call);
- if (is_Global(symc)) {
- ir_entity *ent = get_Global_entity(symc);
+ if (is_SymConst_addr_ent(symc)) {
+ ir_entity *ent = get_SymConst_entity(symc);
if (get_entity_additional_properties(ent) & mtp_property_runtime)
return;
/* try the called entity */
ir_node *ptr = get_Call_ptr(call);
- if (is_Global(ptr)) {
- ir_entity *ent = get_Global_entity(ptr);
+ if (is_SymConst_addr_ent(ptr)) {
+ ir_entity *ent = get_SymConst_entity(ptr);
prop = get_entity_additional_properties(ent);
}
if (is_Call(call)) {
call_ptr = get_Call_ptr(call);
- if (! is_Global(call_ptr))
+ if (! is_SymConst_addr_ent(call_ptr))
return;
- callee = get_Global_entity(call_ptr);
+ callee = get_SymConst_entity(call_ptr);
/* we don't know which function gets finally bound to a weak symbol */
if (get_entity_linkage(callee) & IR_LINKAGE_WEAK)
/* check if it's a recursive call */
call_ptr = get_Call_ptr(call);
- if (! is_Global(call_ptr))
+ if (! is_SymConst_addr_ent(call_ptr))
continue;
- ent = get_Global_entity(call_ptr);
+ ent = get_SymConst_entity(call_ptr);
if (!ent || get_entity_irg(ent) != irg)
continue;