#include "array.h"
#include "pmap.h"
+#include "hashptr.h"
#include "irgwalk.h"
/* --------------------- Compute the callgraph ------------------------ */
-/* Hash an address */
-#define HASH_ADDRESS(adr) (((unsigned)(adr)) >> 3)
-
/**
* Walker called by compute_callgraph()
*/
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);
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;