Update c_src. Enable one gcc pass bootstrap.
[nit.git] / c_src / nitc._sep.c
index 032f0a0..764bf6e 100644 (file)
@@ -1,55 +1,70 @@
 /* This C file is generated by NIT to compile module nitc. */
 #include "nitc._sep.h"
 val_t nitc___NitCompiler___opt_output(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 26, LOCATE_nitc___NitCompiler___opt_output};
+  struct trace_t trace = {NULL, NULL, 26, LOCATE_nitc___NitCompiler___opt_output};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_output( self) /*NitCompiler::_opt_output*/;
 }
 val_t nitc___NitCompiler___opt_boost(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 27, LOCATE_nitc___NitCompiler___opt_boost};
+  struct trace_t trace = {NULL, NULL, 27, LOCATE_nitc___NitCompiler___opt_boost};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_boost( self) /*NitCompiler::_opt_boost*/;
 }
 val_t nitc___NitCompiler___opt_no_cc(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 28, LOCATE_nitc___NitCompiler___opt_no_cc};
+  struct trace_t trace = {NULL, NULL, 28, LOCATE_nitc___NitCompiler___opt_no_cc};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_no_cc( self) /*NitCompiler::_opt_no_cc*/;
 }
 val_t nitc___NitCompiler___opt_attr_sim(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 29, LOCATE_nitc___NitCompiler___opt_attr_sim};
+  struct trace_t trace = {NULL, NULL, 29, LOCATE_nitc___NitCompiler___opt_attr_sim};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_attr_sim( self) /*NitCompiler::_opt_attr_sim*/;
 }
 val_t nitc___NitCompiler___opt_global(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 30, LOCATE_nitc___NitCompiler___opt_global};
+  struct trace_t trace = {NULL, NULL, 30, LOCATE_nitc___NitCompiler___opt_global};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_global( self) /*NitCompiler::_opt_global*/;
 }
 val_t nitc___NitCompiler___opt_clibdir(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 31, LOCATE_nitc___NitCompiler___opt_clibdir};
+  struct trace_t trace = {NULL, NULL, 31, LOCATE_nitc___NitCompiler___opt_clibdir};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_clibdir( self) /*NitCompiler::_opt_clibdir*/;
 }
 val_t nitc___NitCompiler___opt_bindir(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 32, LOCATE_nitc___NitCompiler___opt_bindir};
+  struct trace_t trace = {NULL, NULL, 32, LOCATE_nitc___NitCompiler___opt_bindir};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_bindir( self) /*NitCompiler::_opt_bindir*/;
 }
+val_t nitc___NitCompiler___opt_compdir(val_t  self) {
+  struct trace_t trace = {NULL, NULL, 33, LOCATE_nitc___NitCompiler___opt_compdir};
+  trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
+  tracehead = trace.prev;
+  return ATTR_nitc___NitCompiler____opt_compdir( self) /*NitCompiler::_opt_compdir*/;
+}
 val_t nitc___NitCompiler___opt_extension_prefix(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 33, LOCATE_nitc___NitCompiler___opt_extension_prefix};
+  struct trace_t trace = {NULL, NULL, 34, LOCATE_nitc___NitCompiler___opt_extension_prefix};
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   tracehead = trace.prev;
   return ATTR_nitc___NitCompiler____opt_extension_prefix( self) /*NitCompiler::_opt_extension_prefix*/;
 }
 void nitc___NitCompiler___init(val_t  self, int* init_table) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 35, LOCATE_nitc___NitCompiler___init};
+  struct trace_t trace = {NULL, NULL, 36, LOCATE_nitc___NitCompiler___init};
   val_t variable0;
   val_t variable1;
   val_t variable2;
@@ -60,11 +75,13 @@ void nitc___NitCompiler___init(val_t  self, int* init_table) {
   val_t variable7;
   val_t variable8;
   val_t variable9;
+  val_t variable10;
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_NitCompiler].i]) return;
   ((abstracttool___AbstractCompiler___init_t)CALL( self,COLOR_abstracttool___AbstractCompiler___init))( self, init_table /*YYY*/) /*AbstractCompiler::init*/;
   variable0 = ((mmloader___ToolContext___option_context_t)CALL( self,COLOR_mmloader___ToolContext___option_context))( self) /*ToolContext::option_context*/;
-  variable1 = NEW_array___Array___with_capacity(TAG_Int(8)); /*new Array[E]*/
+  variable1 = NEW_array___Array___with_capacity(TAG_Int(9)); /*new Array[E]*/
   variable2 = ((nitc___NitCompiler___opt_output_t)CALL( self,COLOR_nitc___NitCompiler___opt_output))( self) /*NitCompiler::opt_output*/;
   ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable2) /*AbstractArray::add*/;
   variable3 = ((nitc___NitCompiler___opt_boost_t)CALL( self,COLOR_nitc___NitCompiler___opt_boost))( self) /*NitCompiler::opt_boost*/;
@@ -79,18 +96,21 @@ void nitc___NitCompiler___init(val_t  self, int* init_table) {
   ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable7) /*AbstractArray::add*/;
   variable8 = ((nitc___NitCompiler___opt_bindir_t)CALL( self,COLOR_nitc___NitCompiler___opt_bindir))( self) /*NitCompiler::opt_bindir*/;
   ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable8) /*AbstractArray::add*/;
-  variable9 = ((nitc___NitCompiler___opt_extension_prefix_t)CALL( self,COLOR_nitc___NitCompiler___opt_extension_prefix))( self) /*NitCompiler::opt_extension_prefix*/;
+  variable9 = ((nitc___NitCompiler___opt_compdir_t)CALL( self,COLOR_nitc___NitCompiler___opt_compdir))( self) /*NitCompiler::opt_compdir*/;
   ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable9) /*AbstractArray::add*/;
+  variable10 = ((nitc___NitCompiler___opt_extension_prefix_t)CALL( self,COLOR_nitc___NitCompiler___opt_extension_prefix))( self) /*NitCompiler::opt_extension_prefix*/;
+  ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable10) /*AbstractArray::add*/;
   ((opts___OptionContext___add_option_t)CALL(variable0,COLOR_opts___OptionContext___add_option))(variable0, variable1) /*OptionContext::add_option*/;
   init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_NitCompiler].i] = 1;
   tracehead = trace.prev;
   return;
 }
 void nitc___NitCompiler___process_options(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 41, LOCATE_nitc___NitCompiler___process_options};
+  struct trace_t trace = {NULL, NULL, 42, LOCATE_nitc___NitCompiler___process_options};
   val_t variable0;
     val_t variable1;
     static val_t once_value_variable1_2; static int once_bool_variable1_2;
+    static val_t once_value_variable1_3; static int once_bool_variable1_3;
       val_t variable2;
       val_t variable3;
       val_t variable4;
@@ -98,8 +118,9 @@ void nitc___NitCompiler___process_options(val_t  self) {
       val_t variable6;
       val_t variable7;
       val_t variable8;
-    static val_t once_value_variable1_3; static int once_bool_variable1_3;
+    static val_t once_value_variable1_4; static int once_bool_variable1_4;
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   ((nitc___NitCompiler___process_options_t)CALL( self,COLOR_SUPER_nitc___NitCompiler___process_options))( self) /*super NitCompiler::process_options*/;
   variable0 = ((nitc___NitCompiler___opt_output_t)CALL( self,COLOR_nitc___NitCompiler___opt_output))( self) /*NitCompiler::opt_output*/;
   variable0 = ((opts___Option___value_t)CALL(variable0,COLOR_opts___Option___value))(variable0) /*Option::value*/;
@@ -125,21 +146,48 @@ void nitc___NitCompiler___process_options(val_t  self) {
   variable0 = ((nitc___NitCompiler___opt_global_t)CALL( self,COLOR_nitc___NitCompiler___opt_global))( self) /*NitCompiler::opt_global*/;
   variable0 = ((opts___Option___value_t)CALL(variable0,COLOR_opts___Option___value))(variable0) /*Option::value*/;
   ((compiling_base___ToolContext___global__eq_t)CALL( self,COLOR_compiling_base___ToolContext___global__eq))( self, variable0) /*ToolContext::global=*/;
-  variable0 = NEW_string___String___with_native(BOX_NativeString(".nit_compile"), TAG_Int(12)); /*new String*/
-  ((compiling_base___ToolContext___base_dir__eq_t)CALL( self,COLOR_compiling_base___ToolContext___base_dir__eq))( self, variable0) /*ToolContext::base_dir=*/;
+  variable0 = ((nitc___NitCompiler___opt_compdir_t)CALL( self,COLOR_nitc___NitCompiler___opt_compdir))( self) /*NitCompiler::opt_compdir*/;
+  variable0 = ((opts___Option___value_t)CALL(variable0,COLOR_opts___Option___value))(variable0) /*Option::value*/;
+  ((compiling_base___ToolContext___compdir__eq_t)CALL( self,COLOR_compiling_base___ToolContext___compdir__eq))( self, variable0) /*ToolContext::compdir=*/;
+  variable0 = ((compiling_base___ToolContext___compdir_t)CALL( self,COLOR_compiling_base___ToolContext___compdir))( self) /*ToolContext::compdir*/;
+  variable0 = TAG_Bool((variable0 ==  NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0,  NIT_NULL /*null*/) /*String::==*/)));
+  if (UNTAG_Bool(variable0)) { /*if*/
+    if (once_bool_variable1_2) variable1 = once_value_variable1_2;
+    else {
+      variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_COMPDIR"), TAG_Int(11)); /*new String*/
+      variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/;
+      variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/;
+      once_value_variable1_2 = variable1;
+      once_bool_variable1_2 = true;
+    }
+    variable0 = variable1;
+    variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*dir*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*dir*/) /*AbstractArray::is_empty*/;
+    if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1)))) { /*if*/
+      ((compiling_base___ToolContext___compdir__eq_t)CALL( self,COLOR_compiling_base___ToolContext___compdir__eq))( self,  variable0 /*dir*/) /*ToolContext::compdir=*/;
+    }
+    variable1 = ((compiling_base___ToolContext___compdir_t)CALL( self,COLOR_compiling_base___ToolContext___compdir))( self) /*ToolContext::compdir*/;
+    variable1 = TAG_Bool((variable1 ==  NIT_NULL /*null*/) || ((variable1 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1,  NIT_NULL /*null*/) /*String::==*/)));
+    if (UNTAG_Bool(variable1)) { /*if*/
+      variable1 = NEW_string___String___with_native(BOX_NativeString(".nit_compile"), TAG_Int(12)); /*new String*/
+      ((compiling_base___ToolContext___compdir__eq_t)CALL( self,COLOR_compiling_base___ToolContext___compdir__eq))( self, variable1) /*ToolContext::compdir=*/;
+    }
+  }
+  variable0 = ((compiling_base___ToolContext___compdir_t)CALL( self,COLOR_compiling_base___ToolContext___compdir))( self) /*ToolContext::compdir*/;
+  variable1 = ((compiling_base___ToolContext___ext_prefix_t)CALL( self,COLOR_compiling_base___ToolContext___ext_prefix))( self) /*ToolContext::ext_prefix*/;
+  ((string___String___append_t)CALL(variable0,COLOR_abstract_collection___IndexedCollection___append))(variable0, variable1) /*String::append*/;
   variable0 = ((nitc___NitCompiler___opt_clibdir_t)CALL( self,COLOR_nitc___NitCompiler___opt_clibdir))( self) /*NitCompiler::opt_clibdir*/;
   variable0 = ((opts___Option___value_t)CALL(variable0,COLOR_opts___Option___value))(variable0) /*Option::value*/;
   ((compiling_base___ToolContext___clibdir__eq_t)CALL( self,COLOR_compiling_base___ToolContext___clibdir__eq))( self, variable0) /*ToolContext::clibdir=*/;
   variable0 = ((compiling_base___ToolContext___clibdir_t)CALL( self,COLOR_compiling_base___ToolContext___clibdir))( self) /*ToolContext::clibdir*/;
   variable0 = TAG_Bool((variable0 ==  NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0,  NIT_NULL /*null*/) /*String::==*/)));
   if (UNTAG_Bool(variable0)) { /*if*/
-    if (once_bool_variable1_2) variable1 = once_value_variable1_2;
+    if (once_bool_variable1_3) variable1 = once_value_variable1_3;
     else {
       variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
       variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/;
       variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/;
-      once_value_variable1_2 = variable1;
-      once_bool_variable1_2 = true;
+      once_value_variable1_3 = variable1;
+      once_bool_variable1_3 = true;
     }
     variable0 = variable1;
     variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*dir*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*dir*/) /*AbstractArray::is_empty*/;
@@ -191,13 +239,13 @@ void nitc___NitCompiler___process_options(val_t  self) {
   variable0 = ((compiling_base___ToolContext___bindir_t)CALL( self,COLOR_compiling_base___ToolContext___bindir))( self) /*ToolContext::bindir*/;
   variable0 = TAG_Bool((variable0 ==  NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0,  NIT_NULL /*null*/) /*String::==*/)));
   if (UNTAG_Bool(variable0)) { /*if*/
-    if (once_bool_variable1_3) variable1 = once_value_variable1_3;
+    if (once_bool_variable1_4) variable1 = once_value_variable1_4;
     else {
       variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
       variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/;
       variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/;
-      once_value_variable1_3 = variable1;
-      once_bool_variable1_3 = true;
+      once_value_variable1_4 = variable1;
+      once_bool_variable1_4 = true;
     }
     variable0 = variable1;
     variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*dir*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*dir*/) /*AbstractArray::is_empty*/;
@@ -247,12 +295,13 @@ void nitc___NitCompiler___process_options(val_t  self) {
   return;
 }
 void nitc___NitCompiler___perform_work(val_t  self, val_t  param0) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 84, LOCATE_nitc___NitCompiler___perform_work};
+  struct trace_t trace = {NULL, NULL, 97, LOCATE_nitc___NitCompiler___perform_work};
   val_t variable0;
   val_t variable1;
     val_t variable2;
     val_t variable3;
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   variable0 =  param0;
   variable1 = ((array___AbstractArray___iterator_t)CALL( variable0 /*mods*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*mods*/) /*AbstractArray::iterator*/;
   while (true) { /*for*/
@@ -260,20 +309,21 @@ void nitc___NitCompiler___perform_work(val_t  self, val_t  param0) {
     if (!UNTAG_Bool(variable2)) break; /*for*/
     variable2 = ((array___ArrayIterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*ArrayIterator::item*/;
     variable3 = TAG_Bool(( variable2 /*mod*/==NIT_NULL) || VAL_ISA( variable2 /*mod*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/;
-    if (!UNTAG_Bool(variable3)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_nitc___NitCompiler___perform_work, LOCATE_nitc, 87); nit_exit(1);}
+    if (!UNTAG_Bool(variable3)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_nitc___NitCompiler___perform_work, LOCATE_nitc, 100); nit_exit(1);}
     ((compiling___MMSrcModule___compile_prog_to_c_t)CALL( variable2 /*mod*/,COLOR_compiling___MMSrcModule___compile_prog_to_c))( variable2 /*mod*/,  self) /*MMSrcModule::compile_prog_to_c*/;
-    continue_5: while(0);
+    continue_6: while(0);
     ((array___ArrayIterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*ArrayIterator::next*/;
   }
-  break_5: while(0);
+  break_6: while(0);
   tracehead = trace.prev;
   return;
 }
 void nitc___Sys___main(val_t  self) {
-  struct trace_t trace = {NULL, LOCATE_nitc, 94, LOCATE_nitc___Sys___main};
+  struct trace_t trace = {NULL, NULL, 107, LOCATE_nitc___Sys___main};
   val_t variable0;
   val_t variable1;
   trace.prev = tracehead; tracehead = &trace;
+  trace.file = LOCATE_nitc;
   variable1 = NEW_nitc___NitCompiler___init(); /*new NitCompiler*/
   variable0 = variable1;
   ((abstracttool___AbstractCompiler___exec_cmd_line_t)CALL( variable0 /*c*/,COLOR_abstracttool___AbstractCompiler___exec_cmd_line))( variable0 /*c*/) /*AbstractCompiler::exec_cmd_line*/;