- /* Only the call address is not an address taker but
- this is an uninteresting case, so we ignore it here. */
- for (j = get_Call_n_params(succ) - 1; j >= 0; --j) {
- ir_node *param = get_Call_param(succ, j);
- if (param == irn)
- return ir_address_taken;
+ if (irn == get_Call_ptr(succ)) {
+ /* TODO: we could check for reinterpret casts here...
+ * But I doubt anyone is interested in that bit for
+ * function entities and I'm too lazy to write the code now.
+ */
+ res |= ir_usage_read;
+ } else {
+ assert(irn != get_Call_mem(succ));
+ res |= ir_usage_unknown;
+ }
+ break;
+
+ /* skip identities */
+ case iro_Id:
+ res |= determine_entity_usage(succ, entity);
+ break;
+
+ /* skip tuples */
+ case iro_Tuple: {
+ int input_nr;
+ for (input_nr = get_Tuple_n_preds(succ) - 1; input_nr >= 0;
+ --input_nr) {
+ ir_node *pred = get_Tuple_pred(succ, input_nr);
+ if (pred == irn) {
+ int k;
+ /* we found one input */
+ for (k = get_irn_n_outs(succ) - 1; k >= 0; --k) {
+ ir_node *proj = get_irn_out(succ, k);
+
+ if (is_Proj(proj) && get_Proj_proj(proj) == input_nr) {
+ res |= determine_entity_usage(proj, entity);
+ break;
+ }
+ }
+ }