Sign in
qemu
/
qemu
/
10ac00f7b28fb6d8f7a6288752c18f56a4d4d61d
/
.
/
scripts
/
coccinelle
/
return_directly.cocci
blob: 4cf50e75ea035963ba0bfae7ea547121cc7f3c17 [
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
=
+
return
E
;
-
return
VAR
;
...
when
!=
VAR
}