Sign in
qemu
/
qemu
/
d70fb7cf34d9de439b2b1ee9d43edb3c784db536
/
.
/
scripts
/
coccinelle
/
return_directly.cocci
blob: 6cb1b3c99a77a5cf5a1bd4fd97e6273a46da83a8 [
file
] [
log
] [
blame
]
// replace 'R = X; return R;' with 'return X;'
@@
identifier VAR
;
expression E
;
type T
;
identifier F
;
@@
T F
(...)
{
...
-
T VAR
;
...
when
!=
VAR
-
VAR
=
(
E
);
-
return
VAR
;
+
return
E
;
...
when
!=
VAR
}