Commit 2e179fbd authored by Matthias Braun's avatar Matthias Braun
Browse files

remove is_Global/get_GlobalEntity

They have been unnecessary aliases for is_SymConst_addr_ent() and
get_SymConst_entity().
parent f8dfdaaf
......@@ -657,12 +657,6 @@ FIRM_API int is_irn_cse_neutral(const ir_node *node);
/** 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
......
......@@ -80,8 +80,8 @@ static ptr_access_kind analyze_arg(ir_node *arg, ptr_access_kind bits)
} 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) {
......
......@@ -465,8 +465,8 @@ static void add_method_address_inititializer(ir_initializer_t *initializer,
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);
......@@ -516,8 +516,8 @@ static void add_method_address(ir_entity *ent, eset *set)
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);
......
......@@ -367,13 +367,13 @@ static ir_alias_relation different_types(const ir_node *adr1, const ir_node *adr
{
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);
......@@ -420,8 +420,8 @@ static int is_malloc_Result(const ir_node *node)
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;
......@@ -435,8 +435,8 @@ ir_storage_class_class_t classify_pointer(const ir_node *irn,
{
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))
......@@ -1086,8 +1086,8 @@ static void check_initializer_nodes(ir_initializer_t *initializer)
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;
......@@ -1129,8 +1129,8 @@ static void check_initializer(ir_entity *ent)
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);
}
}
......@@ -1192,9 +1192,9 @@ static void check_global_address(ir_node *irn, void *data)
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;
......
......@@ -972,7 +972,7 @@ ir_node *ia32_try_create_Immediate(ir_node *node, char immediate_constraint_type
return NULL;
}
symconst_ent = get_Global_entity(symconst);
symconst_ent = get_SymConst_entity(symconst);
}
if (cnst == NULL && symconst == NULL)
return NULL;
......
......@@ -1709,18 +1709,6 @@ dbg_info *(get_irn_dbg_info)(const ir_node *n)
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.
*/
......
......@@ -67,10 +67,10 @@ static void call_mapper(ir_node *node, void *env)
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) {
......@@ -605,8 +605,8 @@ int i_mapper_tanh(ir_node *call, void *ctx)
*/
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 */
......
......@@ -89,8 +89,8 @@ static void collect_const_and_pure_calls(ir_node *node, void *env)
/* 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)
......@@ -262,8 +262,8 @@ static void collect_nothrow_calls(ir_node *node, void *env)
/* 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)
......@@ -725,8 +725,8 @@ static int is_stored(const ir_node *n)
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 */
......@@ -838,9 +838,9 @@ static mtp_additional_properties check_nothrow_or_malloc(ir_graph *irg, int top)
} 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) {
......@@ -894,9 +894,9 @@ static mtp_additional_properties check_nothrow_or_malloc(ir_graph *irg, int top)
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) {
......
......@@ -782,8 +782,8 @@ static unsigned is_Call_pure(ir_node *call)
/* 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);
}
......@@ -1887,7 +1887,7 @@ static void move_loads_out_of_loops(scc *pscc, loop_env *env)
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) {
......
......@@ -198,7 +198,7 @@ FIRM_API int value_not_null(const ir_node *n, ir_node_cnst_ptr *confirm)
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))) {
......
......@@ -661,8 +661,8 @@ static ir_graph *get_call_called_irg(ir_node *call)
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;
......@@ -847,8 +847,8 @@ static void collect_calls2(ir_node *call, void *ctx)
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;
......
......@@ -525,8 +525,8 @@ static unsigned get_Call_memory_properties(ir_node *call)
/* 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);
}
......
......@@ -183,10 +183,10 @@ static void collect_irg_calls(ir_node *call, void *env)
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)
......
......@@ -628,10 +628,10 @@ int opt_tail_rec_irg(ir_graph *irg)
/* 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;
......
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