tool: use ccache in gccx, if available
[nit.git] / src / program.nit
index 07c5277..7284fc6 100644 (file)
@@ -49,10 +49,6 @@ class Program
        # Would be null if there is no main method
        readable var _main_class: nullable MMLocalClass = null
 
-       # When we are using global compilation, we generate _glob files instead
-       # of _sep files so that we do not corrupt separate compilation
-       fun get_file_ending: String do return if tc.global then "_glob" else "_sep"
-
        # This method will ensure that all the metamodel is computed before we
        # start using all the classes
        private fun finish_processing_classes do
@@ -64,7 +60,6 @@ class Program
 
                for c in classes do
                        c.compute_ancestors
-                       c.inherit_global_properties
                end
        end
 
@@ -96,6 +91,7 @@ class Program
                                        var icb = new ICodeBuilder(module, iroutine)
 
                                        for g in c.global_properties do
+                                               if not g.intro isa MMAttribute then continue
                                                var p = c[g]
                                                var t = p.signature.return_type
                                                if p isa MMAttribute and t != null then
@@ -116,6 +112,7 @@ class Program
                                        var iroutine = new IRoutine(iselfa, null)
                                        var icb = new ICodeBuilder(module, iroutine)
                                        for g in c.global_properties do
+                                               if not g.intro isa MMAttribute then continue
                                                var p = c[g]
                                                var t = p.signature.return_type
                                                if p isa MMAttribute and t != null and not t.is_nullable then
@@ -127,9 +124,9 @@ class Program
                                end
 
                                for g in c.global_properties do
-                                       var p = c[g]
                                        # FIXME skip invisible constructors
-                                       if not p.global.is_init_for(c) then continue
+                                       if not g.is_init_for(c) then continue
+                                       var p = c[g]
                                        assert p isa MMMethod
 
                                        var iself = new IRegister(c.get_type)
@@ -208,6 +205,16 @@ class Program
                end
        end
 
+       # This function will call the attached block for each live local classes
+       # in this program
+       fun with_each_live_local_classes
+               !action(m: MMLocalClass)
+       do
+               for c in module.local_classes do
+                       action(c)
+               end
+       end
+
        init(m: MMModule, toolcontext: ToolContext) do
                _module = m
                _tc = toolcontext