used HASHPTR() now
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 1 Sep 2005 09:17:25 +0000 (09:17 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 1 Sep 2005 09:17:25 +0000 (09:17 +0000)
[r6555]

ir/ana/callgraph.c

index 13b6f44..8e14c5a 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "array.h"
 #include "pmap.h"
+#include "hashptr.h"
 
 #include "irgwalk.h"
 
@@ -174,9 +175,6 @@ double get_irg_caller_method_execution_frequency(ir_graph *irg, int pos) {
 
 /* --------------------- Compute the callgraph ------------------------ */
 
-/* Hash an address */
-#define HASH_ADDRESS(adr)       (((unsigned)(adr)) >> 3)
-
 /**
  * Walker called by compute_callgraph()
  */
@@ -197,8 +195,8 @@ static void ana_Call(ir_node *n, void *env) {
       ana_entry *found;
       int depth;
 
-      pset_insert((pset *)callee->callers, irg, (unsigned)irg >> 3);
-      found = pset_find((pset *)irg->callees, &buf, HASH_ADDRESS(callee));
+      pset_insert((pset *)callee->callers, irg, HASH_PTR(irg));
+      found = pset_find((pset *)irg->callees, &buf, HASH_PTR(callee));
       if (found) {  /* add Call node to list, compute new nesting. */
        ir_node **arr = found->call_list;
        ARR_APP1(ir_node *, arr, n);
@@ -209,7 +207,7 @@ static void ana_Call(ir_node *n, void *env) {
        found->call_list = NEW_ARR_F(ir_node *, 1);
        found->call_list[0] = n;
        found->max_depth = 0;
-       pset_insert((pset *)irg->callees, found, HASH_ADDRESS(callee));
+       pset_insert((pset *)irg->callees, found, HASH_PTR(callee));
       }
       depth = get_loop_depth(get_irn_loop(get_nodes_block(n)));
       found->max_depth = (depth > found->max_depth) ? depth : found->max_depth;