From 21f2d259e0fc563edf8d9b076f156c8c2fcb886f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Thu, 13 Jul 2017 04:40:57 +0200 Subject: [PATCH] Consider StorageDead and StorageLive as gens for liveness analysis --- src/librustc_mir/util/liveness.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_mir/util/liveness.rs b/src/librustc_mir/util/liveness.rs index 79293cfde251..c96e3ec057b4 100644 --- a/src/librustc_mir/util/liveness.rs +++ b/src/librustc_mir/util/liveness.rs @@ -46,7 +46,10 @@ impl<'tcx> Visitor<'tcx> for BlockInfoVisitor { location: Location) { if let Lvalue::Local(local) = *lvalue { match context { - LvalueContext::Store | LvalueContext::Call => { + LvalueContext::Store | + LvalueContext::Call | + LvalueContext::StorageLive | + LvalueContext::StorageDead => { self.defs.add(&local); } LvalueContext::Projection(..) | @@ -59,7 +62,6 @@ impl<'tcx> Visitor<'tcx> for BlockInfoVisitor { self.uses.add(&local); } } - LvalueContext::StorageLive | LvalueContext::StorageDead => (), } }