On Wed, 21 Mar 2012, ron minnich wrote:

I thought I saw a reference or mention that one could mark a function
(or struct member) for deletion and cocci would remove all uses of it
as well, am I misremembering?

No the only thing that happens automatically is the generation of a rule for a function prototype when a rule changes something about a function parameter list.

Also, this idiom is common:

file a.c:

void f(void);

struct ops {
  .someop = f;
};

void f(void)
{
}

a(){
 b(dev)
}

file b.c:

b(dev)
{
 dev->someop();
}

In other words, a is in an indirect fashion calling something it defines.

Have people found a nice way of "hoisting" that call to b() so that it
ends up just being a call to f()? in other words, a.c becomes:

void f(void)
{
}

a()
{
 f();
}

This seems quite special purpose. Do you know about the relationship between a.c and b.c in advance? If so, you can give them both on the command line and they will be treated as one file. If not you can try using iteration. See demos/iteration.cocci.

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

Reply via email to