On 05/25/2011 08:33 PM, Richard Sandiford wrote:
> +         subpos2_ptr = &pos->xvecexp0s;
>           for (j = 0; j < XVECLEN (pattern, i); j++)
>             {
> +             subpos2 = next_position (subpos2_ptr, pos, POS_XVECEXP0, j);
>               sub = add_to_sequence (XVECEXP (pattern, i, j),
> -                                    &sub->success, subpos, insn_type, 0);
> +                                    &sub->success, subpos2, insn_type, 0);
> +             subpos2_ptr = &subpos2->next;

Let me see if I understand this correctly. If *subpos2_ptr is NULL,
we'll create a new structure, otherwise we'll return the one that's
already there. Hence, we can go through this loop multiple times and
never create new position structures that aren't unique.

If that's how it's supposed to work, it's quite clever but also a bit
nonobvious. I think the patch is OK with one or two more comments.

> Is it OK to remove the static forward declarations too?

Preapproved for anyone, any file, for any unnecessary forward declarations.


Bernd

Reply via email to