if f.compiles_to_o_file then ofiles.add(o)
if f.add_to_jar then java_files.add(f)
end
-
+
if not java_files.is_empty then
var jar_file = "{outpath}.jar"
end
# Generate the main C function.
+ #
# This function:
- # * allocate the Sys object if it exists
- # * call init if is exists
- # * call main if it exists
+ #
+ # * allocate the Sys object if it exists
+ # * call init if is exists
+ # * call main if it exists
fun compile_main_function
do
var v = self.new_visitor
end
# Display stats about compilation process
+ #
# Metrics used:
- # * type tests against resolved types (`x isa Collection[Animal]`)
- # * type tests against unresolved types (`x isa Collection[E]`)
- # * type tests skipped
- # * type tests total
- # *
+ #
+ # * type tests against resolved types (`x isa Collection[Animal]`)
+ # * type tests against unresolved types (`x isa Collection[E]`)
+ # * type tests skipped
+ # * type tests total
fun display_stats
do
if self.modelbuilder.toolcontext.opt_typing_test_metrics.value then
private var escapemark_names = new HashMap[EscapeMark, String]
# Return a "const char*" variable associated to the classname of the dynamic type of an object
- # NOTE: we do not return a `RuntimeVariable` "NativeString" as the class may not exist in the module/program
+ # NOTE: we do not return a `RuntimeVariable` "NativeString" as the class may not exist in the module/program
fun class_name_string(value: RuntimeVariable): String is abstract
# Variables handling
var mtype = recv.mtype
var finalizable_type = compiler.mainmodule.finalizable_type
if finalizable_type != null and not mtype.need_anchor and
- mtype.is_subtype(compiler.mainmodule, null, finalizable_type) then
+ mtype.is_subtype(compiler.mainmodule, null, finalizable_type) then
add "gc_register_finalizer({recv});"
end
end
end
toolcontext.run_global_phases(ms)
end
-
var base_cname = "null_{mtype.mangled_cname}"
var full_cname = "NIT_NULL___{base_cname}"
- # In nitni files, declare internal function as extern
+ # In nitni files, declare internal function as extern
var full_friendly_csignature = "{cname_blind} {full_cname}()"
ccu.header_decl.add("extern {full_friendly_csignature};\n")
var mproperty = mproperty
assert mproperty isa MMethod
- # In nitni files, declare internal function as extern
+ # In nitni files, declare internal function as extern
var full_friendly_csignature = mproperty.build_csignature(recv_mtype, v.compiler.mainmodule, null, long_signature, internal_call_context)
ccu.header_decl.add("extern {full_friendly_csignature};\n")
## check type
#
- # In nitni files, declare internal function as extern
+ # In nitni files, declare internal function as extern
var full_friendly_csignature = "int {v.compiler.mainmodule.name }___{from.mangled_cname}_is_a_{to.mangled_cname}({from.cname_blind})"
ccu.header_decl.add("extern {full_friendly_csignature};\n")