analysis: refine with_each_live_local_classes in Instantiated Type Analysis since...
authorJean-Sebastien Gelinas <calestar@gmail.com>
Mon, 21 Sep 2009 21:10:43 +0000 (17:10 -0400)
committerJean Privat <jean@pryen.org>
Mon, 11 Jan 2010 21:52:26 +0000 (16:52 -0500)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

src/analysis/instantiated_type_analysis.nit

index f3fb22e..ebf5a9e 100644 (file)
@@ -22,6 +22,15 @@ import program
 redef class Program
        # This attribute is the InstantiatedTypeAnalysis results
        readable writable var _ita: nullable InstantiatedTypeAnalysis = null
+
+       # We know which are really live, use that information !
+       redef fun with_each_live_local_classes
+               !action(m: MMLocalClass)
+       do
+               for c in module.local_classes do
+                       if ita == null or ita.as(not null).is_class_instantiated(c) then action(c)
+               end
+       end
 end
 
 # Subclasses of this class would represent an analysis that produces