-
-/**
- * Walker: Walks over all graphs and evaluates calls with
- * constant arguments.
- * Currently used only for non-virtual calls.
- */
-static void eval_calls(ir_node *call, void *env)
-{
- ir_node *ptr, *param;
- entity *ent;
- ir_graph *irg;
- int i;
-
- if (get_irn_op(call) != op_Call)
- return;
-
- ptr = get_Call_ptr(call);
-
- if (get_irn_op(ptr) != op_SymConst)
- return;
-
- if (get_SymConst_kind(ptr) != symconst_addr_ent)
- return;
-
- ent = get_SymConst_entity(ptr);
- irg = get_entity_irg(ent);
-
- if (! irg)
- return;
-
- /* ok, we found the called graph here, check for const args */
- for (i = get_Call_n_params(call) - 1; i >= 0; --i) {
- param = get_Call_param(call, i);
-
- if (is_irn_constlike(param)) {
- /* Found one: add to statistics */
-
- ir_printf("%+F called with const %+F at position %d\n", ent, param, i);
- }
- }
-}