> Is it me not understanding cocci grammar again? You are also struggling with expressing your data processing needs by the means of the semantic patch language. You would like to rename three parameters for selected functions. I imagine that an other transformation specification will be more appropriate for the function body. > { > ... > ( > - arg1 > + dev > | > - arg2 > + attr > | > - arg3 > + buf > ) > ... when any > } I suggest to use a SmPL nest construct. https://github.com/coccinelle/coccinelle/blob/730dbb034559b3e549ec0b2973cd0400a3fa072f/docs/manual/cocci_syntax.tex#L789 { <+... ( -arg1 +dev | -arg2 +attr | -arg3 +buf ) ...+> } > identifier d_show =~ "^.*show.*$"; By the way: Would you like to omit the specification “.*$” from the regular expression for this SmPL constraint? Regards, Markus _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
On Sun, 30 Aug 2020, Markus Elfring wrote: > > - T x@p; > > + int len > > <... > > - x > > + len > > ...> > > How do you think about to use the following transformation variant? This is uselessly expensive. It is already known that there is at least one occurrence of x. julia > > -T x@p; > +int len; > <+... > -x > +len > ...+> > > > Regards, > Markus > _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci
On Sun, 30 Aug 2020, Markus Elfring wrote: > >> How do you think about to use the following transformation variant? > > > > This is uselessly expensive. It is already known that there is at least > > one occurrence of x. > > Would we like to care if the affected identifier should be updated more than once > in a selected function implementation? Theer is no way to specify "more than once". We know it will be updated at least once because we know that there is at least one occurrence. julia _______________________________________________ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci