> > You can just match the return, and then write a smpl rule or script rule 
> > afterwards, 
> > possibly using depends on if there is no other way to make the connection 
> > between the rules.
> 
> I assume that the patch specification will only affect a single return
> instruction in a source file.
> How can any instructions (advice) be added to a function implementation after
> your parsing process reached the end of the function body?

Coccinelle doesn't do its transformation on the fly.  It first matches and 
then transforms.  If you make a pattern like:

- foo();
+ bar();
  ...
  return 12;

then foo will only be converted to bar if the end of the function actually 
does say return 12;.  During the matching process, it remembers where 
transformation may be needed, but that transformation is only performed if 
the complete match is successful.

If you mean something else, perhaps you can give a concrete example.

thanks,
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to