On Mon, Apr 9, 2012 at 1:23 PM, Julia Lawall <[email protected]> wrote:
> On Mon, 9 Apr 2012, Jim Cromie wrote:
>
>> On Mon, Apr 9, 2012 at 6:43 AM, Julia Lawall <[email protected]> wrote:
>>>
>>> For the whole kernel, I get over 32,000 potential added calls.  Perhaps
>>> there is some way to better constrain the cases where it should be used?
>>>
>>> julia
>>
>>
>> OOH, THANK YOU for that script.
>> Now that I see it, I understand it - at least a little bit.
>> You are a ninja !!
>>
>> 32k is *alot*
>> and I see youve already constrained it to static defs.
>>
>> Devs sometimes add comments about keeping A,B in sync if you change...
>> but the form of comments surely varies, and IIUC, cocci cant look at
>> comments.
>
>
> No, it doesn't look at comments.
>
>
>> I'll try it out, inspect the results, and see if I can find more
>> constraints.
>
>
> Actually, the previous results were all backwards.  All the constraints
> referred to arrays that were declared afterwards.  I've attached two new
> versions.  Tables.cocci collects constraints to all previous arrays of the
> same size.  Last_tables.cocci puts a constraint only for the most recent
> table - if all of the constraints are satisfied it should amount to the same
> thing.  Last_tables generates less code, but the result is more fragile
> because the most recent table is not necessarily the one you want.
>
> julia

I'll start with last-tables, see how it looks.
Do you recall how many patches it created ?
Less is better for now..

What does it do with
table A
fns ...
table B
more fns
table C

?

+ BUILD_BUG_DECL(AC, ...);
+ BUILD_BUG_DECL(BC, ...);

would be close to ideal.
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to