import abstract_compiler
import layout_builders
import rapid_type_analysis
+import collect_super_sends
+import compiler_ffi
# Add separate compiler specific options
redef class ToolContext
end
# lookup super calls and add it to the list of mmethods to build layout with
- var super_calls = runtime_type_analysis.live_super_sends
+ var super_calls
+ if runtime_type_analysis != null then
+ super_calls = runtime_type_analysis.live_super_sends
+ else
+ super_calls = modelbuilder.collect_super_sends
+ end
for mmethoddef in super_calls do
var mclass = mmethoddef.mclassdef.mclass
mmethods[mclass].add(mmethoddef)
end
print "\t{total}\t{holes}"
end
+
+ redef fun compile_nitni_structs
+ do
+ self.header.add_decl("struct nitni_instance \{struct instance *value;\};")
+ end
+
+ redef fun finalize_ffi_for_module(nmodule)
+ do
+ self.mainmodule = nmodule.mmodule.as(not null)
+ super
+ end
end
# A visitor on the AST of property definition that generate the C code of a separate compilation process.
end
self.add("{res} = BOX_{valtype.c_name}({value}); /* autobox from {value.mtype} to {mtype} */")
return res
+ else if value.mtype.cname_blind == "void*" and mtype.cname_blind == "void*" then
+ return value
else
# Bad things will appen!
var res = self.new_var(mtype)