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