compiler: remove services for deprecated calloc_array
authorJean Privat <jean@pryen.org>
Fri, 24 Jun 2016 02:06:05 +0000 (22:06 -0400)
committerJean Privat <jean@pryen.org>
Fri, 24 Jun 2016 02:06:05 +0000 (22:06 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit
src/compiler/global_compiler.nit
src/compiler/separate_erasure_compiler.nit

index 364c6be..1385694 100644 (file)
@@ -1208,8 +1208,6 @@ abstract class AbstractCompilerVisitor
 
        fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable is abstract
 
-       fun calloc_array(ret_type: MType, arguments: Array[RuntimeVariable]) is abstract
-
        fun native_array_def(pname: String, ret_type: nullable MType, arguments: Array[RuntimeVariable]): Bool do return false
 
        # Return an element of a native array.
@@ -3004,9 +3002,6 @@ redef class AMethPropdef
                else if pname == "sys" then
                        v.ret(v.new_expr("glob_sys", ret.as(not null)))
                        return true
-               else if pname == "calloc_array" then
-                       v.calloc_array(ret.as(not null), arguments)
-                       return true
                else if pname == "object_id" then
                        v.ret(v.new_expr("(long){arguments.first}", ret.as(not null)))
                        return true
index 0ac6e66..628e78a 100644 (file)
@@ -426,11 +426,6 @@ class GlobalCompilerVisitor
                self.add("{recv}[{i}]={val};")
        end
 
-       redef fun calloc_array(ret_type, arguments)
-       do
-               self.ret(self.new_expr("NEW_{ret_type.c_name}({arguments[1]})", ret_type))
-       end
-
        redef fun send(m, args)
        do
                var types = self.collect_types(args.first)
index 6f7d1e8..c370461 100644 (file)
@@ -657,11 +657,4 @@ class SeparateErasureCompilerVisitor
                self.add("{res} = NEW_{nclass.c_name}({length});")
                return res
        end
-
-       redef fun calloc_array(ret_type, arguments)
-       do
-               var ret = ret_type.as(MClassType)
-               self.require_declaration("NEW_{ret.mclass.c_name}")
-               self.ret(self.new_expr("NEW_{ret.mclass.c_name}({arguments[1]})", ret_type))
-       end
 end