X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fproc_cloning.c;h=c4da9ad83a1ca7e55297e32080876fff6a80f2ec;hb=0a7d7324b9baa076d1322e82b92f8fc2c8f1892e;hp=06d7a9c8482175c250f607f6f7e93b7c162f13e8;hpb=4db6c5b3708319ba7eff5489e1fe1c7a01fdd866;p=libfirm diff --git a/ir/opt/proc_cloning.c b/ir/opt/proc_cloning.c index 06d7a9c84..c4da9ad83 100644 --- a/ir/opt/proc_cloning.c +++ b/ir/opt/proc_cloning.c @@ -21,7 +21,6 @@ * @file * @brief Procedure cloning. * @author Beyhan Veliev, Michael Beck - * @version $Id$ * @brief * * The purpose is first to find and analyze functions, that are called @@ -97,7 +96,7 @@ static int entry_cmp(const void *elt, const void *key) */ static unsigned hash_entry(const entry_t *entry) { - return HASH_PTR(entry->q.ent) ^ HASH_PTR(entry->q.tv) ^ (unsigned)(entry->q.pos * 9); + return hash_ptr(entry->q.ent) ^ hash_ptr(entry->q.tv) ^ (unsigned)(entry->q.pos * 9); } /** @@ -183,10 +182,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) @@ -586,7 +585,7 @@ restart: */ void proc_cloning(float threshold) { - entry_t *entry = NULL, *p; + entry_t *p; size_t i, n; q_set hmap; @@ -613,7 +612,7 @@ void proc_cloning(float threshold) /* We iterate the set and arrange the element of the set in a list. The elements are arranged dependent of their value descending.*/ if (hmap.map) { - foreach_pset(hmap.map, entry_t*, entry) { + foreach_pset(hmap.map, entry_t, entry) { entry->weight = calculate_weight(entry); /* @@ -652,14 +651,14 @@ void proc_cloning(float threshold) #ifdef DEBUG_libfirm /* Print some information about the list. */ DB((dbg, LEVEL_2, "-----------------\n")); - for (entry = hmap.heavy_uses; entry; entry = entry->next) { + for (entry_t *entry = hmap.heavy_uses; entry; entry = entry->next) { DB((dbg, LEVEL_2, "\nweight: is %f\n", entry->weight)); DB((dbg, LEVEL_2, "Call for Method %E\n", entry->q.ent)); DB((dbg, LEVEL_2, "Position %zu\n", entry->q.pos)); DB((dbg, LEVEL_2, "Value %T\n", entry->q.tv)); } #endif - entry = hmap.heavy_uses; + entry_t *const entry = hmap.heavy_uses; if (entry) { quadruple_t *qp = &entry->q;