# Note that we do not try to be clever an a small change in a Nit source file may change the content of all the generated .c files
var time0 = get_time
+ ".nit_compile".mkdir
+
var outname = self.toolcontext.opt_output.value
if outname == null then
outname = "{mainmodule.name}.bin"
var file: nullable OFStream = null
var count = 0
- ".nit_compile".mkdir
var i = 0
for vis in compiler.visitors do
count += vis.lines.length
# Generate code that initialize the attributes on a new instance
fun generate_init_attr(v: VISITOR, recv: RuntimeVariable, mtype: MClassType)
do
- for cd in mtype.collect_mclassdefs(self.mainmodule)
- do
+ var cds = mtype.collect_mclassdefs(self.mainmodule).to_a
+ self.mainmodule.linearize_mclassdefs(cds)
+ for cd in cds do
var n = self.modelbuilder.mclassdef2nclassdef[cd]
for npropdef in n.n_propdefs do
if npropdef isa AAttrPropdef then
# Generate code that check if an attribute is correctly initialized
fun generate_check_attr(v: VISITOR, recv: RuntimeVariable, mtype: MClassType)
do
- for cd in mtype.collect_mclassdefs(self.mainmodule)
- do
+ var cds = mtype.collect_mclassdefs(self.mainmodule).to_a
+ self.mainmodule.linearize_mclassdefs(cds)
+ for cd in cds do
var n = self.modelbuilder.mclassdef2nclassdef[cd]
for npropdef in n.n_propdefs do
if npropdef isa AAttrPropdef then
var externname
var nextern = self.n_extern
if nextern == null then
- debug("{mpropdef} need extern name")
+ v.add("printf(\"NOT YET IMPLEMENTED nitni for {mpropdef} at {location.to_s}\\n\");")
+ v.add("exit(1);")
return
end
externname = nextern.text.substring(1, nextern.text.length-2)