From: Jean Privat Date: Fri, 24 Jun 2016 02:06:05 +0000 (-0400) Subject: compiler: remove services for deprecated calloc_array X-Git-Url: http://nitlanguage.org compiler: remove services for deprecated calloc_array Signed-off-by: Jean Privat --- diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index 364c6be..1385694 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -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 diff --git a/src/compiler/global_compiler.nit b/src/compiler/global_compiler.nit index 0ac6e66..628e78a 100644 --- a/src/compiler/global_compiler.nit +++ b/src/compiler/global_compiler.nit @@ -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) diff --git a/src/compiler/separate_erasure_compiler.nit b/src/compiler/separate_erasure_compiler.nit index 6f7d1e8..c370461 100644 --- a/src/compiler/separate_erasure_compiler.nit +++ b/src/compiler/separate_erasure_compiler.nit @@ -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