From c5c884ce7a2fe47a219ba9f141487520738447ef Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 23 Jun 2016 22:06:05 -0400 Subject: [PATCH] compiler: remove services for deprecated calloc_array Signed-off-by: Jean Privat --- src/compiler/abstract_compiler.nit | 5 ----- src/compiler/global_compiler.nit | 5 ----- src/compiler/separate_erasure_compiler.nit | 7 ------- 3 files changed, 17 deletions(-) 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 -- 1.7.9.5