[Mesa-dev] [PATCH 6/9] i965: Add annotation_insert_error() and support for printing errors.
Matt Turner
mattst88 at gmail.com
Fri Nov 6 17:17:46 PST 2015
On Tue, Nov 3, 2015 at 10:44 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Tuesday, November 03, 2015 10:20:26 PM Matt Turner wrote:
>> On Tue, Nov 3, 2015 at 9:47 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> > memmove(cur + 1, cur,
>> > (annotation->ann_count - i + 2) * sizeof(struct annotation));
>> > ann = cur;
>> > ann->error = NULL;
>> > ann->error_length = 0;
>> > ann->block_end = NULL;
>> > ann->offset = insertion_point;
>> > annotation->ann_count++;
>> > break;
>> > }
>> > }
>
> I still think my code is correct and easier to read...
I tried your code -- it's not correct -- it inserts the errors in the
wrong place. The good news is that the misunderstanding in it reminded
me why my code looks strange.
To know whether an offset is in an annotation block, you have to check
if it's before the next.
And, to insert an error for a given instruction, that instruction must
end the annotation block.
I've simplified the code and made the cur/next names make sense in
relation to the iteration variable i.
I'll send v2 in reply.
More information about the mesa-dev
mailing list