On 10/28/12 11:32 AM, Konstantin Tokarev wrote:
28.10.2012, 21:02, "John Regehr"<reg...@cs.utah.edu>:
Yes, definitely. The way we do this is using the param-to-local and
param-to-global passes which try to turn arguments into local/global
variables respectively. Then we rely on subsequent passes to clean up
the resulting debris when possible. If these passes are missing cases
please let us know.
I've got the next function in the output of creduce:
int A::create (const int&p1, const int&p2)
{
A ();
}
It's possible to remove p1 and p2 without loss of interestingness, however
creduce leaves them.
When applying param-to-global I get the next code:
const int& create_p1;
int A::create ( const int&p2)
{
A ();
}
It cannot be compiled because of non-initialized reference. What is the proper
way to fix it: get rid of references in separate pass, or add special case for
references in param-to-global and param-to-local?
Either is fine for me. If we only want to handle the above case,
probably the latter is better, since we could avoid some redundant
iterations.
- Yang