X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fcgana.c;h=e70ece616459637104a35e28d14479a393a7fe2a;hb=6ccff2965d94c272f71df2a1655336af47bb7753;hp=a88227fc6067bf1c6e0d6f7869d2a2a86872ab95;hpb=8d1f4d16aa8809ae3051f6767d97c7701144cc93;p=libfirm diff --git a/ir/ana/cgana.c b/ir/ana/cgana.c index a88227fc6..e70ece616 100644 --- a/ir/ana/cgana.c +++ b/ir/ana/cgana.c @@ -22,7 +22,6 @@ * @brief Intraprozedural analyses to estimate the call graph. * @author Hubert Schmid * @date 09.06.2002 - * @version $Id$ * @brief * Interprocedural analysis to estimate the calling relation. * @@ -36,7 +35,6 @@ #include #include "cgana.h" -#include "rta.h" #include "xmalloc.h" #include "irnode_t.h" @@ -350,8 +348,6 @@ static void free_mark_proj(ir_node * node, long n, eset * set) */ static void free_mark(ir_node *node, eset * set) { - size_t i, n; - if (get_irn_link(node) == MARK) return; /* already visited */ @@ -361,6 +357,7 @@ static void free_mark(ir_node *node, eset * set) case iro_Sel: { ir_entity *ent = get_Sel_entity(node); if (is_method_entity(ent)) { + size_t i, n; for (i = 0, n = get_Sel_n_methods(node); i < n; ++i) { eset_insert(set, get_Sel_method(node, i)); } @@ -399,7 +396,6 @@ static void free_mark(ir_node *node, eset * set) static void free_ana_walker(ir_node *node, void *env) { eset *set = (eset*) env; - int i; if (get_irn_link(node) == MARK) { /* already visited */ @@ -430,7 +426,8 @@ static void free_ana_walker(ir_node *node, void *env) } break; } - default: + default: { + int i; /* other nodes: Alle anderen Knoten nehmen wir als Verr�ter an, bis * jemand das Gegenteil implementiert. */ set_irn_link(node, MARK); @@ -442,13 +439,14 @@ static void free_ana_walker(ir_node *node, void *env) } break; } + } } /** * Add all method addresses in global new style initializers to the set. * * @note - * We do NOT check the type here, just it it's an entity address. + * We do NOT check the type here, just if it's an entity address. * The reason for this is code like: * * void *p = function; @@ -466,8 +464,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); @@ -491,7 +489,7 @@ static void add_method_address_inititializer(ir_initializer_t *initializer, * Add all method addresses in global initializers to the set. * * @note - * We do NOT check the type here, just it it's an entity address. + * We do NOT check the type here, just if it's an entity address. * The reason for this is code like: * * void *p = function; @@ -502,7 +500,7 @@ static void add_method_address(ir_entity *ent, eset *set) { ir_type *tp; - /* ignore methods: these of course reference it's address + /* ignore methods: these of course reference their addresses * TODO: remove this later once this incorrect self-initialisation is gone */ tp = get_entity_type(ent); @@ -517,11 +515,11 @@ 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 *ent = get_Global_entity(irn); + if (is_SymConst_addr_ent(irn)) { + ir_entity *ent2 = get_SymConst_entity(irn); - if (is_Method_type(get_entity_type(ent))) - eset_insert(set, ent); + if (is_Method_type(get_entity_type(ent2))) + eset_insert(set, ent2); } } }