On Wed, 2 Feb 2011, SF Markus Elfring wrote:

> > It already has this knowledge if you put the function structure as in my 
> > example and it already optimizes based on this information.
> 
> I would like to point out the next detail for further considerations.
> 
> If I am not directly interested in the concrete name of a function with other
> calls where the error detection and exception handling is incomplete, I would
> have to specify a pattern like the following.
> 
> 
> @@
> identifier xyz;
> @@
> 
> xyz(...)
> {
> ...
> /* Filter expression to find incomplete instructions */
> ...
> }
> 
> 
> I assume that the specified meta-variable allocates a few internal resources 
> and
> I am not sure if I will really need it for the desired source code 
> transformation.

I'm completely missing the point, then.  Are you worried about their being 
calls to eg malloc that are not in function bodies?  I don't think that is 
a big concern...


> > You can use glimpse or id-utils to create an index in advance.  Creating 
> > an index every time one runs Coccinelle would be too slow.  If there is no 
> > index information, then Coccinelle uses grep before parsing a file.
> 
> Thanks for this bit of clarification.
> 
> Does your source code analysis operate on an application programming interface
> that works with an abstract semantic graph?

Coccinelle first constructs an AST, and then constructs a control-flow 
graph.  The control-flow graph contains bits of the AST.  I'm not sure 
that tehre is anything that one would recognize as an API.

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

Reply via email to