rta: add RapidTypeAnalysis::live_classes
authorJean Privat <jean@pryen.org>
Sat, 3 Aug 2013 01:43:23 +0000 (21:43 -0400)
committerJean Privat <jean@pryen.org>
Sat, 3 Aug 2013 01:43:23 +0000 (21:43 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/rapid_type_analysis.nit

index e383656..40b1be3 100644 (file)
@@ -88,6 +88,9 @@ class RapidTypeAnalysis
        # live_send_sites to determine new customized_methoddefs to visit
        var live_types: HashSet[MClassType] = new HashSet[MClassType]
 
+       # Live (instantiated) classes.
+       var live_classes: HashSet[MClass] = new HashSet[MClass]
+
        # The pool of types used to perform type checks (isa and as).
        var live_cast_types: HashSet[MClassType] = new HashSet[MClassType]
 
@@ -134,6 +137,8 @@ class RapidTypeAnalysis
                self.live_types.add(mtype)
                self.check_depth(mtype)
 
+               self.live_classes.add(mtype.mclass)
+
                # Collect default attributes
                for cd in mtype.collect_mclassdefs(self.mainmodule)
                do