add kills to variables declared in the same scope when autodetecting
Commit
0b5e73f (add kills to variables declared in the same scope that
holds the scop, Wed Dec 16 18:35:48 2015 +0100) introduced a mechanism
for killing variables that are declared outside the scop, but it would
only do this for explicitly marked scops. When autodetecting, there is
less need for such a mechanism because the entire function body can
often be extracted as a scop, in which case the variables declared
inside that scop are already killed. However, this is not always
the case. For example, the function may contain a return statement
at the end, which is currently not included in the scop.
Perform a similar killing of variables declared before the scop
and not used after the extracted scop when autodetecting.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>