nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename `NativeString` to `CString`
[nit.git]
/
src
/
compiler
/
separate_erasure_compiler.nit
diff --git
a/src/compiler/separate_erasure_compiler.nit
b/src/compiler/separate_erasure_compiler.nit
index
6f7d1e8
..
244a9ed
100644
(file)
--- a/
src/compiler/separate_erasure_compiler.nit
+++ b/
src/compiler/separate_erasure_compiler.nit
@@
-322,7
+322,7
@@
class SeparateErasureCompiler
v.add("return (val*){res};")
v.add("\}")
return
v.add("return (val*){res};")
v.add("\}")
return
- else if mtype.mclass.kind == extern_kind and mtype.mclass.name != "NativeString" then
+ else if mtype.mclass.kind == extern_kind and mtype.mclass.name != "CString" then
var pointer_type = mainmodule.pointer_type
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}();")
var pointer_type = mainmodule.pointer_type
self.provide_declaration("NEW_{c_name}", "{mtype.ctype} NEW_{c_name}();")
@@
-603,7
+603,7
@@
class SeparateErasureCompilerVisitor
redef fun unbox_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
redef fun unbox_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
- mtype.mclass.name != "NativeString" then
+ mtype.mclass.name != "CString" then
var pointer_type = compiler.mainmodule.pointer_type
var res = self.new_var_extern(mtype)
self.add "{res} = ((struct instance_{pointer_type.c_name}*){value})->value; /* unboxing {value.mtype} */"
var pointer_type = compiler.mainmodule.pointer_type
var res = self.new_var_extern(mtype)
self.add "{res} = ((struct instance_{pointer_type.c_name}*){value})->value; /* unboxing {value.mtype} */"
@@
-616,7
+616,7
@@
class SeparateErasureCompilerVisitor
redef fun box_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
redef fun box_extern(value, mtype)
do
if mtype isa MClassType and mtype.mclass.kind == extern_kind and
- mtype.mclass.name != "NativeString" then
+ mtype.mclass.name != "CString" then
var valtype = compiler.mainmodule.pointer_type
var res = self.new_var(mtype)
if compiler.runtime_type_analysis != null and not compiler.runtime_type_analysis.live_types.has(value.mtype.as(MClassType)) then
var valtype = compiler.mainmodule.pointer_type
var res = self.new_var(mtype)
if compiler.runtime_type_analysis != null and not compiler.runtime_type_analysis.live_types.has(value.mtype.as(MClassType)) then
@@
-657,11
+657,4
@@
class SeparateErasureCompilerVisitor
self.add("{res} = NEW_{nclass.c_name}({length});")
return res
end
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
end