Signed-off-by: Jean Privat <jean@pryen.org>
redef class IRoutine
# Perfom all optimizations
- fun optimize
+ fun optimize(m: MMModule)
do
- inline_methods
+ inline_methods(m)
allocate_iregister_slots
end
end
end
redef class IRoutine
- fun inline_methods
+ fun inline_methods(m: MMModule)
do
var v = new InlineMethodVisitor
v.visit_iroutine(self)
# 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
var icd = new ICodeDumper
routine.dump(icd)
print "**** OPTIMIZE {p.full_name} ****"
- routine.optimize
+ routine.optimize(mod)
icd = new ICodeDumper
routine.dump(icd)
end