On 6/30/2013 3:43 AM, Дмитрий Дьяченко wrote:
Hi!
I use creduce-git-latest
After "creduce --sanitize --sanity-checks --sllooww x.sh x.ii" I have
$ cat x.ii
typedef struct
{
volatile struct
{
} x0;
}
x1;
int
x2 ()
{
x1 x3 = x3;
return 0;
}
Looks like there are possible simplifications : definitely 1 / may be 2
1) remove 'return 0;' and change return type for x2() from 'int' to 'void'
Hmm, we have a similar pass to do this, for example:
$ clang_delta --transformation=return-void --counter=1 x.ii
typedef struct
{
volatile struct
{
} x0;
}
x1;
void
x2 ()
{
x1 x3 = x3;
0;
}
It does almost what you said except keeping 0. The reason I chose to
leave '0' is that
* in general we could have something like "return foo()", where foo()
could have side-effect and may be relevant to the bug;
* if foo() is not relevant to the bug, then later pass such as
pass-line can nuke it.
- Yang