icode: 'IRoutine::optimize' need a module
authorJean Privat <jean@pryen.org>
Mon, 10 Aug 2009 16:01:40 +0000 (12:01 -0400)
committerJean Privat <jean@pryen.org>
Mon, 17 Aug 2009 18:56:19 +0000 (14:56 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/analysis/analysis.nit
src/analysis/inline_methods.nit
src/compiling/compiling_icode.nit
src/nitc.nit

index 7d9b028..d04ae96 100644 (file)
@@ -24,9 +24,9 @@ import inline_methods
 
 redef class IRoutine
        # Perfom all optimizations
-       fun optimize
+       fun optimize(m: MMModule)
        do
-               inline_methods
+               inline_methods(m)
                allocate_iregister_slots
        end
 end
index 80f0aac..8e174d4 100644 (file)
@@ -58,7 +58,7 @@ redef class ICall
 end
 
 redef class IRoutine
-       fun inline_methods
+       fun inline_methods(m: MMModule)
        do
                var v = new InlineMethodVisitor
                v.visit_iroutine(self)
index d14b322..e7c063a 100644 (file)
@@ -329,7 +329,7 @@ redef class IRoutine
        # cv must be in the correct function
        fun compile_to_c(cv: CompilerVisitor, cname: String, args: Array[String]): nullable String
        do
-               optimize
+               optimize(cv.module)
                var v = new I2CCompilerVisitor(cv, self, cname)
                return compile_inside_to_c(v, args)
        end
index 29a4ab4..faf8d03 100644 (file)
@@ -110,7 +110,7 @@ special AbstractCompiler
                                        var icd = new ICodeDumper
                                        routine.dump(icd)
                                        print "**** OPTIMIZE {p.full_name} ****"
-                                       routine.optimize
+                                       routine.optimize(mod)
                                        icd = new ICodeDumper
                                        routine.dump(icd)
                                end