[Cocci] Replacement of function calls and corresponding parameters

Julia Lawall julia at diku.dk
Sun Mar 14 17:01:41 CET 2010


On Sun, 14 Mar 2010, SF Markus Elfring wrote:

> > First the first rule is matched agains all functions.  Then any 
> > transformations indicated by that match are performed.
> 
> The semantic patch language makes it easy to replace just a concrete function
> call. I find it harder to specify the replacement also for the passed parameters
> because it depends on variable definitions and assignments earlier in the source
> code.

If there is not a reasonably regular pattern, then Coccinelle is probably 
just not the right tool.  If there does seem to be a regular pattern then 
perhaps you could make a small example that exhibits it, and then it might 
be possible to provide some concrete suggestions.

julia


More information about the Cocci mailing list