+ compiler.do_compilation
+ compiler.display_stats
+
+ var time1 = get_time
+ self.toolcontext.info("*** END GENERATING C: {time1-time0} ***", 2)
+ write_and_make(compiler)
+ end
+end
+
+# Compiler that use global compilation and perform hard optimisations like:
+# * customization
+# * switch dispatch
+# * inlining
+class GlobalCompiler
+ super AbstractCompiler
+
+ redef type VISITOR: GlobalCompilerVisitor
+
+ # The result of the RTA (used to know live types and methods)
+ var runtime_type_analysis: RapidTypeAnalysis
+
+ init
+ do
+ var file = new_file("{mainmodule.c_name}.nitgg")
+ self.header = new CodeWriter(file)
+ self.live_primitive_types = new Array[MClassType]
+ for t in runtime_type_analysis.live_types do
+ if t.is_c_primitive or t.mclass.name == "Pointer" then
+ self.live_primitive_types.add(t)
+ end
+ end
+ end
+
+ redef fun do_compilation
+ do
+ var compiler = self
+