]> git.lizzy.rs Git - rust.git/commitdiff
Consider StorageDead and StorageLive as gens for liveness analysis
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Thu, 13 Jul 2017 02:40:57 +0000 (04:40 +0200)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Fri, 28 Jul 2017 13:46:24 +0000 (15:46 +0200)
src/librustc_mir/util/liveness.rs

index 79293cfde251fdf1f995be16226d0260945950aa..c96e3ec057b48f873c93dd639135b5242047047a 100644 (file)
@@ -46,7 +46,10 @@ fn visit_lvalue(&mut self,
                     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 @@ fn visit_lvalue(&mut self,
                         self.uses.add(&local);
                     }
                 }
-                LvalueContext::StorageLive | LvalueContext::StorageDead => (),
             }
         }