Hi Nick, On 2017-01-26 14:28, Nick Fitzgerald wrote:
How are the passes / reducers structured right now? If we can generate all of a pass's potential reductions up front, then they can be inserted into the queue in a random order to reduce the likelihood of conflicts. If the passes don't separate generating a potential reduction from testing it, then we may need to refactor more.
All of the passes residing in clang_delta are able to dump the number of potential reduction candidates before actually performing reduction. Then, we can tell clang_delta to take actions on individual candidate by passing a counter option. For example,
$ cat test.cc
int foo() {
unsigned x = 1;
unsigned y = 2;
}
$ ../clang_delta --query-instances=local-to-global test.cc
Available transformation instances: 2
$ ../clang_delta --transformation=local-to-global --counter=1 test.cc
unsigned int foo_x = 1;
int foo() {
unsigned y = 2;
}
$ ../clang_delta --transformation=local-to-global --counter=2 test.cc
unsigned int foo_y = 2;
int foo() {
unsigned x = 1;
}
However, there are a lot of other passes in the creduce sub-directory,
which don't provide the same facility at the moment.
- Yang