X-Git-Url: http://nitlanguage.org diff --git a/c_src/compiling._sep.c b/c_src/compiling._sep.c index 34edd9c..cd93126 100644 --- a/c_src/compiling._sep.c +++ b/c_src/compiling._sep.c @@ -1,585 +1,1009 @@ /* This C file is generated by NIT to compile module compiling. */ #include "compiling._sep.h" -void compiling___MMSrcModule___compile_prog_to_c(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 26, LOCATE_compiling___MMSrcModule___compile_prog_to_c}; - val_t variable[23]; - void **closurevariable = NULL; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable[0] = self; - variable[1] = param0; - variable[3] = variable[0]; - variable[3] = CALL_abstractmetamodel___MMModule___mhe(variable[3])(variable[3]) /*MMModule::mhe*/; - variable[3] = CALL_partial_order___PartialOrderElement___greaters_and_self(variable[3])(variable[3]) /*PartialOrderElement::greaters_and_self*/; - variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*Collection::iterator*/; - while (true) { /*for*/ - variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable[4])) break; /*for*/ - variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*Iterator::item*/; - variable[5] = variable[4]; - variable[6] = TAG_Bool(( variable[5] /*m*/==NIT_NULL) || VAL_ISA( variable[5] /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/; - if (!UNTAG_Bool(variable[6])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c, LOCATE_compiling, 32); nit_exit(1);} - CALL_compiling_global___MMSrcModule___local_analysis( variable[5] /*m*/)( variable[5] /*m*/, variable[1] /*tc*/) /*MMSrcModule::local_analysis*/; - continue_1: while(0); - CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*Iterator::next*/; +val_t compiling___Program___output_format(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 27; + fra.me.meth = LOCATE_compiling___Program___output_format; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:27 */ + REGB0 = TAG_Bool(ATTR_compiling___Program____output_format(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_output_format", LOCATE_compiling, 27); } - break_1: while(0); - variable[4] = variable[0]; - variable[4] = CALL_compiling_global___MMSrcModule___global_analysis(variable[4])(variable[4], variable[1] /*tc*/) /*MMSrcModule::global_analysis*/; - variable[3] = variable[4]; - variable[4] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - CALL_file___String___mkdir(variable[4])(variable[4]) /*String::mkdir*/; - variable[5] = NEW_Array_array___Array___init(); /*new Array[String]*/ - variable[4] = variable[5]; - variable[6] = NEW_ArraySet_array___ArraySet___init(); /*new ArraySet[String]*/ - variable[5] = variable[6]; - variable[6] = NEW_String_string___String___with_native(BOX_NativeString("$CLIBDIR/nit_main.c"), TAG_Int(19)); /*new String*/ - CALL_abstract_collection___SimpleCollection___add( variable[4] /*files*/)( variable[4] /*files*/, variable[6]) /*AbstractArray::add*/; - variable[6] = variable[0]; - variable[6] = CALL_abstractmetamodel___MMModule___mhe(variable[6])(variable[6]) /*MMModule::mhe*/; - variable[6] = CALL_partial_order___PartialOrderElement___greaters_and_self(variable[6])(variable[6]) /*PartialOrderElement::greaters_and_self*/; - variable[6] = CALL_abstract_collection___Collection___iterator(variable[6])(variable[6]) /*Collection::iterator*/; - while (true) { /*for*/ - variable[7] = CALL_abstract_collection___Iterator___is_ok(variable[6])(variable[6]) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable[7])) break; /*for*/ - variable[7] = CALL_abstract_collection___Iterator___item(variable[6])(variable[6]) /*Iterator::item*/; - variable[8] = variable[7]; - variable[9] = TAG_Bool(( variable[8] /*m*/==NIT_NULL) || VAL_ISA( variable[8] /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/; - if (!UNTAG_Bool(variable[9])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c, LOCATE_compiling, 44); nit_exit(1);} - variable[9] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[10] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[11] = variable[10]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[11]) /*AbstractArray::add*/; - variable[12] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[13]) /*AbstractArray::add*/; - variable[14] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[15] = variable[14]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[15]) /*AbstractArray::add*/; - variable[16] = CALL_abstractmetamodel___MMModule___name( variable[8] /*m*/)( variable[8] /*m*/) /*MMModule::name*/; - variable[17] = variable[16]; - variable[17] = CALL_string___Object___to_s(variable[17])(variable[17]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[17]) /*AbstractArray::add*/; - variable[18] = NEW_String_string___String___with_native(BOX_NativeString("._sep.c"), TAG_Int(7)); /*new String*/ - variable[19] = variable[18]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[19]) /*AbstractArray::add*/; - variable[9] = CALL_string___Object___to_s(variable[9])(variable[9]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add( variable[4] /*files*/)( variable[4] /*files*/, variable[9]) /*AbstractArray::add*/; - CALL_compiling___MMSrcModule___compile_separate_module( variable[8] /*m*/)( variable[8] /*m*/, variable[1] /*tc*/, variable[3] /*ga*/) /*MMSrcModule::compile_separate_module*/; - variable[10] = CALL_mmloader___MMModule___filename( variable[8] /*m*/)( variable[8] /*m*/) /*MMModule::filename*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/ - variable[10] = CALL_file___String___strip_extension(variable[10])(variable[10], variable[11]) /*String::strip_extension*/; - variable[9] = variable[10]; - variable[10] = NEW_String_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/ - variable[10] = CALL_string___String_____plus( variable[9] /*native_name*/)( variable[9] /*native_name*/, variable[10]) /*String::+*/; - variable[10] = CALL_file___String___file_exists(variable[10])(variable[10]) /*String::file_exists*/; - if (UNTAG_Bool(variable[10])) { /*if*/ - variable[10] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[11] = NEW_String_string___String___with_native(BOX_NativeString("-I "), TAG_Int(3)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[12]) /*AbstractArray::add*/; - variable[13] = CALL_file___String___dirname( variable[9] /*native_name*/)( variable[9] /*native_name*/) /*String::dirname*/; - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[14]) /*AbstractArray::add*/; - variable[15] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[16]) /*AbstractArray::add*/; - variable[10] = CALL_string___Object___to_s(variable[10])(variable[10]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add( variable[5] /*includes*/)( variable[5] /*includes*/, variable[10]) /*ArraySet::add*/; + fra.me.REG[0] = ATTR_compiling___Program____output_format(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +void compiling___Program___output_format__eq(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 27; + fra.me.meth = LOCATE_compiling___Program___output_format__eq; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:27 */ + ATTR_compiling___Program____output_format(fra.me.REG[0]) = fra.me.REG[1]; + stack_frame_head = fra.me.prev; + return; +} +void compiling___Program___compile_prog(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 30; + fra.me.meth = LOCATE_compiling___Program___compile_prog; + fra.me.has_broke = 0; + fra.me.REG_size = 3; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:33 */ + fra.me.REG[1] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_1) { + fra.me.REG[2] = BOX_NativeString("none"); + REGB0 = TAG_Int(4); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_1 = fra.me.REG[2]; + register_static_object(&once_value_1); + } else fra.me.REG[2] = once_value_1; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],fra.me.REG[2])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + } else { + CALL_program___Program___with_each_iroutines(fra.me.REG[0])(fra.me.REG[0], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_prog_2)); + /* ./compiling//compiling.nit:39 */ + fra.me.REG[2] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_3) { + fra.me.REG[1] = BOX_NativeString("C"); + REGB0 = TAG_Int(1); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_3 = fra.me.REG[1]; + register_static_object(&once_value_3); + } else fra.me.REG[1] = once_value_3; + fra.me.REG[1] = fra.me.REG[1]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[2],fra.me.REG[1])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + REGB0 = REGB1; } - variable[10] = NEW_String_string___String___with_native(BOX_NativeString("_nit.c"), TAG_Int(6)); /*new String*/ - CALL_abstract_collection___IndexedCollection___append( variable[9] /*native_name*/)( variable[9] /*native_name*/, variable[10]) /*String::append*/; - variable[10] = CALL_file___String___file_exists( variable[9] /*native_name*/)( variable[9] /*native_name*/) /*String::file_exists*/; - if (UNTAG_Bool(variable[10])) { /*if*/ - CALL_abstract_collection___SimpleCollection___add( variable[4] /*files*/)( variable[4] /*files*/, variable[9] /*native_name*/) /*AbstractArray::add*/; + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:40 */ + CALL_compiling___Program___compile_prog_to_c(fra.me.REG[0])(fra.me.REG[0]); + } else { + /* ./compiling//compiling.nit:41 */ + fra.me.REG[1] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[2] = BOX_NativeString("icode"); + REGB0 = TAG_Int(5); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_4 = fra.me.REG[2]; + register_static_object(&once_value_4); + } else fra.me.REG[2] = once_value_4; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],fra.me.REG[2])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:42 */ + CALL_icode_generator___Program___generate_icode_files(fra.me.REG[0])(fra.me.REG[0]); + } } - continue_2: while(0); - CALL_abstract_collection___Iterator___next(variable[6])(variable[6]) /*Iterator::next*/; } - break_2: while(0); - variable[6] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[8] = variable[7]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[8]) /*AbstractArray::add*/; - variable[9] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[10]) /*AbstractArray::add*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[12]) /*AbstractArray::add*/; - variable[13] = variable[0]; - variable[13] = CALL_abstractmetamodel___MMModule___name(variable[13])(variable[13]) /*MMModule::name*/; - variable[14] = variable[13]; - variable[14] = CALL_string___Object___to_s(variable[14])(variable[14]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[14]) /*AbstractArray::add*/; - variable[15] = NEW_String_string___String___with_native(BOX_NativeString("._tables.c"), TAG_Int(10)); /*new String*/ - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[16]) /*AbstractArray::add*/; - variable[6] = CALL_string___Object___to_s(variable[6])(variable[6]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add( variable[4] /*files*/)( variable[4] /*files*/, variable[6]) /*AbstractArray::add*/; - variable[6] = variable[0]; - CALL_compiling___MMSrcModule___compile_main(variable[6])(variable[6], variable[1] /*tc*/, variable[3] /*ga*/) /*MMSrcModule::compile_main*/; - variable[7] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[9] = variable[8]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[9]) /*AbstractArray::add*/; - variable[10] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[11] = variable[10]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[11]) /*AbstractArray::add*/; - variable[12] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[13]) /*AbstractArray::add*/; - variable[14] = variable[0]; - variable[14] = CALL_abstractmetamodel___MMModule___name(variable[14])(variable[14]) /*MMModule::name*/; - variable[15] = variable[14]; - variable[15] = CALL_string___Object___to_s(variable[15])(variable[15]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[15]) /*AbstractArray::add*/; - variable[16] = NEW_String_string___String___with_native(BOX_NativeString("._build.sh"), TAG_Int(10)); /*new String*/ - variable[17] = variable[16]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[17]) /*AbstractArray::add*/; - variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/; - variable[6] = variable[7]; - variable[8] = NEW_OFStream_file___OFStream___open( variable[6] /*fn*/); /*new OFStream*/ - variable[7] = variable[8]; - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("#!/bin/sh\n"), TAG_Int(10)); /*new String*/ - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString("# This shell script is generated by NIT to compile the program "), TAG_Int(63)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = variable[0]; - variable[11] = CALL_abstractmetamodel___MMModule___name(variable[11])(variable[11]) /*MMModule::name*/; - variable[12] = variable[11]; - variable[12] = CALL_string___Object___to_s(variable[12])(variable[12]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString(".\n"), TAG_Int(2)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString("CLIBDIR=\""), TAG_Int(9)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = CALL_compiling_base___ToolContext___clibdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::clibdir*/; - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("\"\n"), TAG_Int(2)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(7)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = CALL_compiling_base___ToolContext___bindir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::bindir*/; - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("/gccx -d "), TAG_Int(9)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[15] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[16]) /*AbstractArray::add*/; - variable[17] = NEW_String_string___String___with_native(BOX_NativeString(" -I $CLIBDIR "), TAG_Int(13)); /*new String*/ - variable[18] = variable[17]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[18]) /*AbstractArray::add*/; - variable[19] = NEW_String_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)); /*new String*/ - variable[19] = CALL_string___Collection___join( variable[5] /*includes*/)( variable[5] /*includes*/, variable[19]) /*Collection::join*/; - variable[20] = variable[19]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[20]) /*AbstractArray::add*/; - variable[21] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[22] = variable[21]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[22]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = CALL_compiling_base___ToolContext___output_file( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::output_file*/; - variable[8] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[8] == NIT_NULL /*null*/) || ((variable[8] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[8])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[8], NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[8])(variable[8], NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable[8])) { /*if*/ - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = CALL_compiling_base___ToolContext___output_file( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::output_file*/; - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - } else { /*if*/ - variable[8] = CALL_compiling_base___ToolContext___ext_prefix( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::ext_prefix*/; - variable[8] = CALL_abstract_collection___Collection___is_empty(variable[8])(variable[8]) /*AbstractArray::is_empty*/; - if (UNTAG_Bool(variable[8])) { /*if*/ - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = variable[0]; - variable[11] = CALL_abstractmetamodel___MMModule___name(variable[11])(variable[11]) /*MMModule::name*/; - variable[12] = variable[11]; - variable[12] = CALL_string___Object___to_s(variable[12])(variable[12]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - } else { /*if*/ - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = variable[0]; - variable[11] = CALL_abstractmetamodel___MMModule___name(variable[11])(variable[11]) /*MMModule::name*/; - variable[12] = variable[11]; - variable[12] = CALL_string___Object___to_s(variable[12])(variable[12]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[15] = CALL_compiling_base___ToolContext___ext_prefix( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::ext_prefix*/; - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[16]) /*AbstractArray::add*/; - variable[17] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[18] = variable[17]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[18]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; + stack_frame_head = fra.me.prev; + return; +} + void OC_compiling___Program___compile_prog_2(struct stack_frame_t *closctx, val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t tmp; + /* ./compiling//compiling.nit:37 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 37; + fra.me.meth = LOCATE_compiling___Program___compile_prog; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + CALL_analysis___IRoutine___optimize(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + stack_frame_head = fra.me.prev; + return; } +void compiling___Program___compile_prog_to_c(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_6; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 47; + fra.me.meth = LOCATE_compiling___Program___compile_prog_to_c; + fra.me.has_broke = 0; + fra.me.REG_size = 4; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:52 */ + fra.me.REG[1] = NEW_CProgram_compiling_base___CProgram___init(fra.me.REG[0]); + /* ./compiling//compiling.nit:54 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_file___String___mkdir(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:56 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString("$CLIBDIR/nit_main.c"); + REGB0 = TAG_Int(19); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_1 = fra.me.REG[3]; + register_static_object(&once_value_1); + } else fra.me.REG[3] = once_value_1; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:57 */ + fra.me.REG[3] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_2) { + fra.me.REG[2] = BOX_NativeString("$CLIBDIR/gc.c"); + REGB0 = TAG_Int(13); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_2 = fra.me.REG[2]; + register_static_object(&once_value_2); + } else fra.me.REG[2] = once_value_2; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./compiling//compiling.nit:58 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_3) { + fra.me.REG[3] = BOX_NativeString("$CLIBDIR/gc_static_objects_list.c"); + REGB0 = TAG_Int(33); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_3 = fra.me.REG[3]; + register_static_object(&once_value_3); + } else fra.me.REG[3] = once_value_3; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:60 */ + fra.me.REG[3] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[2] = BOX_NativeString("Generating C code"); + REGB0 = TAG_Int(17); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_4 = fra.me.REG[2]; + register_static_object(&once_value_4); + } else fra.me.REG[2] = once_value_4; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Int(1); + CALL_mmloader___ToolContext___info(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2], REGB0); + /* ./compiling//compiling.nit:61 */ + fra.me.REG[2] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[2])(fra.me.REG[2]); + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 61); } - variable[8] = CALL_compiling_base___ToolContext___boost( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::boost*/; - if (UNTAG_Bool(variable[8])) { /*if*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString(" -O"), TAG_Int(3)); /*new String*/ - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - } - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(" \"$@\" \\\n "), TAG_Int(10)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString("\\\n "), TAG_Int(4)); /*new String*/ - variable[11] = CALL_string___Collection___join( variable[4] /*files*/)( variable[4] /*files*/, variable[11]) /*Collection::join*/; - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - CALL_stream___IOS___close( variable[7] /*f*/)( variable[7] /*f*/) /*OFStream::close*/; - variable[8] = CALL_compiling_base___ToolContext___no_cc( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::no_cc*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[8])))) { /*if*/ - variable[8] = variable[0]; - variable[8] = (G_sys); - variable[9] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[10] = NEW_String_string___String___with_native(BOX_NativeString("sh "), TAG_Int(3)); /*new String*/ - variable[11] = variable[10]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[11]) /*AbstractArray::add*/; - variable[12] = variable[6] /*fn*/; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[14]) /*AbstractArray::add*/; - variable[9] = CALL_string___Object___to_s(variable[9])(variable[9]) /*Object::to_s*/; - CALL_exec___Sys___system(variable[8])(variable[8], variable[9]) /*Sys::system*/; + fra.me.REG[2] = CALL_partial_order___PartialOrderElement___greaters_and_self(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___Collection___iterate(fra.me.REG[2])(fra.me.REG[2], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_prog_to_c_5)); + /* ./compiling//compiling.nit:63 */ + fra.me.REG[2] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_6) { + fra.me.REG[3] = BOX_NativeString("Generating main, tables and makefile ..."); + REGB0 = TAG_Int(40); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_6 = fra.me.REG[3]; + register_static_object(&once_value_6); + } else fra.me.REG[3] = once_value_6; + fra.me.REG[3] = fra.me.REG[3]; + REGB0 = TAG_Int(1); + CALL_mmloader___ToolContext___info(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3], REGB0); + /* ./compiling//compiling.nit:64 */ + CALL_compiling___Program___compile_main(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + /* ./compiling//compiling.nit:66 */ + CALL_compiling_base___CProgram___generate_build_file(fra.me.REG[1])(fra.me.REG[1]); + /* ./compiling//compiling.nit:68 */ + fra.me.REG[0] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = CALL_compiling_base___ToolContext___no_cc(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + CALL_compiling_base___CProgram___run_c_compiler(fra.me.REG[1])(fra.me.REG[1]); } - return_label0: while(false); - tracehead = trace.prev; + stack_frame_head = fra.me.prev; return; } -void compiling___MMSrcModule___compile_main(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 80, LOCATE_compiling___MMSrcModule___compile_main}; - val_t variable[17]; - void **closurevariable = NULL; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable[0] = self; - variable[1] = param0; - variable[2] = param1; - variable[5] = variable[0]; - variable[6] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(variable[5]); /*new CompilerVisitor*/ - variable[5] = variable[6]; - variable[4] = variable[5]; - CALL_compiling_base___CompilerVisitor___tc__eq( variable[4] /*v*/)( variable[4] /*v*/, variable[1] /*tc*/) /*CompilerVisitor::tc=*/; - CALL_compiling_global___CompilerVisitor___global_analysis__eq( variable[4] /*v*/)( variable[4] /*v*/, variable[2] /*ga*/) /*CompilerVisitor::global_analysis=*/; - variable[5] = NEW_String_string___String___with_native(BOX_NativeString("#include "), TAG_Int(23)); /*new String*/ - CALL_compiling_base___CompilerVisitor___add_decl( variable[4] /*v*/)( variable[4] /*v*/, variable[5]) /*CompilerVisitor::add_decl*/; - variable[5] = variable[0]; - CALL_compiling_global___MMSrcModule___compile_tables_to_c(variable[5])(variable[5], variable[4] /*v*/) /*MMSrcModule::compile_tables_to_c*/; - variable[5] = variable[0]; - CALL_compiling_global___MMSrcModule___compile_main_part(variable[5])(variable[5], variable[4] /*v*/) /*MMSrcModule::compile_main_part*/; - variable[6] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[8] = variable[7]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[8]) /*AbstractArray::add*/; - variable[9] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[10]) /*AbstractArray::add*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[12]) /*AbstractArray::add*/; - variable[13] = variable[0]; - variable[13] = CALL_abstractmetamodel___MMModule___name(variable[13])(variable[13]) /*MMModule::name*/; - variable[14] = variable[13]; - variable[14] = CALL_string___Object___to_s(variable[14])(variable[14]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[14]) /*AbstractArray::add*/; - variable[15] = NEW_String_string___String___with_native(BOX_NativeString("._tables.c"), TAG_Int(10)); /*new String*/ - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[16]) /*AbstractArray::add*/; - variable[6] = CALL_string___Object___to_s(variable[6])(variable[6]) /*Object::to_s*/; - variable[7] = NEW_OFStream_file___OFStream___open(variable[6]); /*new OFStream*/ - variable[6] = variable[7]; - variable[5] = variable[6]; - variable[6] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[7] = NEW_String_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile program "), TAG_Int(54)); /*new String*/ - variable[8] = variable[7]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[8]) /*AbstractArray::add*/; - variable[9] = variable[0]; - variable[9] = CALL_abstractmetamodel___MMModule___name(variable[9])(variable[9]) /*MMModule::name*/; - variable[10] = variable[9]; - variable[10] = CALL_string___Object___to_s(variable[10])(variable[10]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[10]) /*AbstractArray::add*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[12]) /*AbstractArray::add*/; - variable[6] = CALL_string___Object___to_s(variable[6])(variable[6]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[5] /*f*/)( variable[5] /*f*/, variable[6]) /*OFStream::write*/; - variable[6] = variable[0]; - variable[6] = CALL_abstractmetamodel___MMModule___mhe(variable[6])(variable[6]) /*MMModule::mhe*/; - variable[6] = CALL_partial_order___PartialOrderElement___greaters_and_self(variable[6])(variable[6]) /*PartialOrderElement::greaters_and_self*/; - variable[6] = CALL_abstract_collection___Collection___iterator(variable[6])(variable[6]) /*Collection::iterator*/; - while (true) { /*for*/ - variable[7] = CALL_abstract_collection___Iterator___is_ok(variable[6])(variable[6]) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable[7])) break; /*for*/ - variable[7] = CALL_abstract_collection___Iterator___item(variable[6])(variable[6]) /*Iterator::item*/; - variable[8] = variable[7]; - variable[9] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[10] = NEW_String_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable[11] = variable[10]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[11]) /*AbstractArray::add*/; - variable[12] = CALL_abstractmetamodel___MMModule___name( variable[8] /*m*/)( variable[8] /*m*/) /*MMModule::name*/; - variable[13] = variable[12]; - variable[13] = CALL_string___Object___to_s(variable[13])(variable[13]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[13]) /*AbstractArray::add*/; - variable[14] = NEW_String_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable[15] = variable[14]; - CALL_abstract_collection___SimpleCollection___add(variable[9])(variable[9], variable[15]) /*AbstractArray::add*/; - variable[9] = CALL_string___Object___to_s(variable[9])(variable[9]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[5] /*f*/)( variable[5] /*f*/, variable[9]) /*OFStream::write*/; - continue_4: while(0); - CALL_abstract_collection___Iterator___next(variable[6])(variable[6]) /*Iterator::next*/; + void OC_compiling___Program___compile_prog_to_c_5(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){ + struct {struct stack_frame_t me;} fra; + fun_t CREG[1]; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 0; + fra.me.meth = LOCATE_compiling___Program___compile_prog_to_c; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.closure_ctx = closctx_param; + fra.me.closure_funs = CREG; + fra.me.REG[0] = p0; + CREG[0] = clos_fun0; + CALL_compiling___MMModule___compile_separate_module(fra.me.REG[0])(fra.me.REG[0], closctx->REG[1]); + stack_frame_head = fra.me.prev; + return; } - break_4: while(0); - variable[6] = CALL_string___Object___to_s( variable[4] /*v*/)( variable[4] /*v*/) /*CompilerVisitor::to_s*/; - CALL_stream___OStream___write( variable[5] /*f*/)( variable[5] /*f*/, variable[6]) /*OFStream::write*/; - CALL_stream___IOS___close( variable[5] /*f*/)( variable[5] /*f*/) /*OFStream::close*/; - return_label3: while(false); - tracehead = trace.prev; +void compiling___Program___compile_main(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[5];} fra; + val_t REGB0; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + static val_t once_value_6; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 71; + fra.me.meth = LOCATE_compiling___Program___compile_main; + fra.me.has_broke = 0; + fra.me.REG_size = 6; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[4] = NIT_NULL; + fra.me.REG[5] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:74 */ + fra.me.REG[2] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(fra.me.REG[2], fra.me.REG[1]); + /* ./compiling//compiling.nit:75 */ + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString("#include "); + REGB0 = TAG_Int(23); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_1 = fra.me.REG[3]; + register_static_object(&once_value_1); + } else fra.me.REG[3] = once_value_1; + fra.me.REG[3] = fra.me.REG[3]; + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:76 */ + CALL_compiling_global___Program___compile_tables_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + /* ./compiling//compiling.nit:77 */ + CALL_compiling_global___Program___compile_main_part(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + /* ./compiling//compiling.nit:78 */ + REGB0 = TAG_Int(5); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_2) { + fra.me.REG[4] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_2 = fra.me.REG[4]; + register_static_object(&once_value_2); + } else fra.me.REG[4] = once_value_2; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_3) { + fra.me.REG[4] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_3 = fra.me.REG[4]; + register_static_object(&once_value_3); + } else fra.me.REG[4] = once_value_3; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[4] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[4])(fra.me.REG[4]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_4) { + fra.me.REG[4] = BOX_NativeString("._tables.c"); + REGB0 = TAG_Int(10); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_4 = fra.me.REG[4]; + register_static_object(&once_value_4); + } else fra.me.REG[4] = once_value_4; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + /* ./compiling//compiling.nit:79 */ + fra.me.REG[4] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[3]); + /* ./compiling//compiling.nit:80 */ + fra.me.REG[3] = NEW_OFStream_file___OFStream___open(fra.me.REG[3]); + /* ./compiling//compiling.nit:81 */ + REGB0 = TAG_Int(3); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_5) { + fra.me.REG[5] = BOX_NativeString("/* This C file is generated by NIT to compile program "); + REGB0 = TAG_Int(54); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_5 = fra.me.REG[5]; + register_static_object(&once_value_5); + } else fra.me.REG[5] = once_value_5; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[5] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[5])(fra.me.REG[5]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_6) { + fra.me.REG[5] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_6 = fra.me.REG[5]; + register_static_object(&once_value_6); + } else fra.me.REG[5] = once_value_6; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_stream___OStream___write(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + /* ./compiling//compiling.nit:82 */ + fra.me.REG[0] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[0] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(fra.me.REG[0]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 82); + } + fra.me.REG[0] = CALL_partial_order___PartialOrderElement___greaters_and_self(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___Collection___iterate(fra.me.REG[0])(fra.me.REG[0], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_main_7)); + /* ./compiling//compiling.nit:85 */ + fra.me.REG[1] = CALL_compiling_base___CompilerVisitor___header_writer(fra.me.REG[2])(fra.me.REG[2]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]); + /* ./compiling//compiling.nit:86 */ + fra.me.REG[2] = CALL_compiling_base___CompilerVisitor___writer(fra.me.REG[2])(fra.me.REG[2]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:87 */ + CALL_stream___IOS___close(fra.me.REG[3])(fra.me.REG[3]); + stack_frame_head = fra.me.prev; return; } -void compiling___MMSrcModule___compile_separate_module(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 98, LOCATE_compiling___MMSrcModule___compile_separate_module}; - val_t variable[19]; - void **closurevariable = NULL; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable[0] = self; - variable[1] = param0; - variable[2] = param1; - variable[5] = variable[0]; - variable[6] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(variable[5]); /*new CompilerVisitor*/ - variable[5] = variable[6]; - variable[4] = variable[5]; - CALL_compiling_base___CompilerVisitor___tc__eq( variable[4] /*v*/)( variable[4] /*v*/, variable[1] /*tc*/) /*CompilerVisitor::tc=*/; - CALL_compiling_global___CompilerVisitor___global_analysis__eq( variable[4] /*v*/)( variable[4] /*v*/, variable[2] /*ga*/) /*CompilerVisitor::global_analysis=*/; - variable[5] = NEW_String_string___String___with_native(BOX_NativeString("#include "), TAG_Int(23)); /*new String*/ - CALL_compiling_base___CompilerVisitor___add_decl( variable[4] /*v*/)( variable[4] /*v*/, variable[5]) /*CompilerVisitor::add_decl*/; - variable[6] = variable[0]; - variable[6] = CALL_mmloader___MMModule___filename(variable[6])(variable[6]) /*MMModule::filename*/; - variable[7] = NEW_String_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/ - variable[6] = CALL_file___String___strip_extension(variable[6])(variable[6], variable[7]) /*String::strip_extension*/; - variable[5] = variable[6]; - variable[6] = NEW_String_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/ - CALL_abstract_collection___IndexedCollection___append( variable[5] /*native_name*/)( variable[5] /*native_name*/, variable[6]) /*String::append*/; - variable[6] = CALL_file___String___file_exists( variable[5] /*native_name*/)( variable[5] /*native_name*/) /*String::file_exists*/; - if (UNTAG_Bool(variable[6])) { /*if*/ - variable[6] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[7] = NEW_String_string___String___with_native(BOX_NativeString("#include <"), TAG_Int(10)); /*new String*/ - variable[8] = variable[7]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[8]) /*AbstractArray::add*/; - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[9] = CALL_file___String___basename( variable[5] /*native_name*/)( variable[5] /*native_name*/, variable[9]) /*String::basename*/; - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[10]) /*AbstractArray::add*/; - variable[11] = NEW_String_string___String___with_native(BOX_NativeString(">"), TAG_Int(1)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[6])(variable[6], variable[12]) /*AbstractArray::add*/; - variable[6] = CALL_string___Object___to_s(variable[6])(variable[6]) /*Object::to_s*/; - CALL_compiling_base___CompilerVisitor___add_decl( variable[4] /*v*/)( variable[4] /*v*/, variable[6]) /*CompilerVisitor::add_decl*/; + void OC_compiling___Program___compile_main_7(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t REGB0; + fun_t CREG[1]; + val_t tmp; + static val_t once_value_8; /* Once value */ + static val_t once_value_9; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 0; + fra.me.meth = LOCATE_compiling___Program___compile_main; + fra.me.has_broke = 0; + fra.me.REG_size = 3; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.closure_ctx = closctx_param; + fra.me.closure_funs = CREG; + fra.me.REG[0] = p0; + CREG[0] = clos_fun0; + /* ./compiling//compiling.nit:83 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_8) { + fra.me.REG[2] = BOX_NativeString("#include \""); + REGB0 = TAG_Int(10); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_8 = fra.me.REG[2]; + register_static_object(&once_value_8); + } else fra.me.REG[2] = once_value_8; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[0] = CALL_compiling_base___CProgram___module_header_name(closctx->REG[1])(closctx->REG[1], fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + if (!once_value_9) { + fra.me.REG[0] = BOX_NativeString("\"\n"); + REGB0 = TAG_Int(2); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_9 = fra.me.REG[0]; + register_static_object(&once_value_9); + } else fra.me.REG[0] = once_value_9; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(closctx->REG[3])(closctx->REG[3], fra.me.REG[1]); + stack_frame_head = fra.me.prev; + return; + } +void compiling___MMModule___compile_separate_module(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[9];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + static val_t once_value_6; /* Once value */ + static val_t once_value_7; /* Once value */ + static val_t once_value_8; /* Once value */ + static val_t once_value_9; /* Once value */ + static val_t once_value_10; /* Once value */ + static val_t once_value_11; /* Once value */ + static val_t once_value_12; /* Once value */ + static val_t once_value_13; /* Once value */ + static val_t once_value_14; /* Once value */ + static val_t once_value_15; /* Once value */ + static val_t once_value_16; /* Once value */ + static val_t once_value_17; /* Once value */ + static val_t once_value_18; /* Once value */ + static val_t once_value_19; /* Once value */ + static val_t once_value_20; /* Once value */ + static val_t once_value_21; /* Once value */ + static val_t once_value_22; /* Once value */ + static val_t once_value_23; /* Once value */ + static val_t once_value_24; /* Once value */ + static val_t once_value_26; /* Once value */ + static val_t once_value_27; /* Once value */ + static val_t once_value_28; /* Once value */ + static val_t once_value_29; /* Once value */ + static val_t once_value_30; /* Once value */ + static val_t once_value_31; /* Once value */ + static val_t once_value_32; /* Once value */ + static val_t once_value_33; /* Once value */ + static val_t once_value_34; /* Once value */ + static val_t once_value_35; /* Once value */ + static val_t once_value_36; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 92; + fra.me.meth = LOCATE_compiling___MMModule___compile_separate_module; + fra.me.has_broke = 0; + fra.me.REG_size = 10; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[4] = NIT_NULL; + fra.me.REG[5] = NIT_NULL; + fra.me.REG[6] = NIT_NULL; + fra.me.REG[7] = NIT_NULL; + fra.me.REG[8] = NIT_NULL; + fra.me.REG[9] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:95 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___program(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[2] = CALL_program___Program___tc(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:96 */ + REGB0 = TAG_Int(3); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + fra.me.REG[4] = BOX_NativeString("Generating C code for module: "); + REGB0 = TAG_Int(30); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_1 = fra.me.REG[4]; + register_static_object(&once_value_1); + } else fra.me.REG[4] = once_value_1; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_2) { + fra.me.REG[4] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_2 = fra.me.REG[4]; + register_static_object(&once_value_2); + } else fra.me.REG[4] = once_value_2; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Int(2); + CALL_mmloader___ToolContext___info(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3], REGB0); + /* ./compiling//compiling.nit:97 */ + fra.me.REG[3] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(fra.me.REG[0], fra.me.REG[1]); + /* ./compiling//compiling.nit:98 */ + if (!once_value_3) { + fra.me.REG[2] = BOX_NativeString("#include "); + REGB0 = TAG_Int(23); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_3 = fra.me.REG[2]; + register_static_object(&once_value_3); + } else fra.me.REG[2] = once_value_3; + fra.me.REG[2] = fra.me.REG[2]; + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./compiling//compiling.nit:100 */ + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___location(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_location___Location___file(fra.me.REG[2])(fra.me.REG[2]); + if (!once_value_4) { + fra.me.REG[4] = BOX_NativeString(".nit"); + REGB0 = TAG_Int(4); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_4 = fra.me.REG[4]; + register_static_object(&once_value_4); + } else fra.me.REG[4] = once_value_4; + fra.me.REG[4] = fra.me.REG[4]; + fra.me.REG[4] = CALL_file___String___strip_extension(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[4]); + /* ./compiling//compiling.nit:101 */ + if (!once_value_5) { + fra.me.REG[2] = BOX_NativeString("_nit.h"); + REGB0 = TAG_Int(6); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_5 = fra.me.REG[2]; + register_static_object(&once_value_5); + } else fra.me.REG[2] = once_value_5; + fra.me.REG[2] = fra.me.REG[2]; + fra.me.REG[2] = CALL_string___String_____plus(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]); + /* ./compiling//compiling.nit:102 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[2])(fra.me.REG[2]); + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:103 */ + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_6) { + fra.me.REG[6] = BOX_NativeString("#include <"); + REGB0 = TAG_Int(10); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_6 = fra.me.REG[6]; + register_static_object(&once_value_6); + } else fra.me.REG[6] = once_value_6; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + if (!once_value_7) { + fra.me.REG[6] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_7 = fra.me.REG[6]; + register_static_object(&once_value_7); + } else fra.me.REG[6] = once_value_7; + fra.me.REG[6] = fra.me.REG[6]; + fra.me.REG[6] = CALL_file___String___basename(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[6]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + if (!once_value_8) { + fra.me.REG[6] = BOX_NativeString(">"); + REGB0 = TAG_Int(1); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_8 = fra.me.REG[6]; + register_static_object(&once_value_8); + } else fra.me.REG[6] = once_value_8; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[5]); + /* ./compiling//compiling.nit:104 */ + fra.me.REG[5] = CALL_compiling_base___CProgram___include_dirs(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Int(3); + fra.me.REG[6] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_9) { + fra.me.REG[2] = BOX_NativeString("-I "); + REGB0 = TAG_Int(3); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_9 = fra.me.REG[2]; + register_static_object(&once_value_9); + } else fra.me.REG[2] = once_value_9; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + fra.me.REG[2] = CALL_file___String___dirname(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + if (!once_value_10) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_10 = fra.me.REG[2]; + register_static_object(&once_value_10); + } else fra.me.REG[2] = once_value_10; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + fra.me.REG[6] = CALL_string___Object___to_s(fra.me.REG[6])(fra.me.REG[6]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + } + /* ./compiling//compiling.nit:106 */ + if (!once_value_11) { + fra.me.REG[6] = BOX_NativeString("_nit.c"); + REGB0 = TAG_Int(6); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_11 = fra.me.REG[6]; + register_static_object(&once_value_11); + } else fra.me.REG[6] = once_value_11; + fra.me.REG[6] = fra.me.REG[6]; + fra.me.REG[6] = CALL_string___String_____plus(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + /* ./compiling//compiling.nit:107 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[6])(fra.me.REG[6]); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[4] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + } + /* ./compiling//compiling.nit:109 */ + CALL_compiling_global___MMModule___declare_class_tables_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + /* ./compiling//compiling.nit:110 */ + CALL_compiling_global___MMModule___compile_mod_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + /* ./compiling//compiling.nit:112 */ + fra.me.REG[6] = CALL_compiling_base___CProgram___module_header_name(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + /* ./compiling//compiling.nit:113 */ + REGB0 = TAG_Int(5); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_12) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_12 = fra.me.REG[5]; + register_static_object(&once_value_12); + } else fra.me.REG[5] = once_value_12; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_13) { + fra.me.REG[5] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_13 = fra.me.REG[5]; + register_static_object(&once_value_13); + } else fra.me.REG[5] = once_value_13; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + if (!once_value_14) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_14 = fra.me.REG[5]; + register_static_object(&once_value_14); + } else fra.me.REG[5] = once_value_14; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + fra.me.REG[4] = NEW_OFStream_file___OFStream___open(fra.me.REG[4]); + /* ./compiling//compiling.nit:114 */ + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_15) { + fra.me.REG[2] = BOX_NativeString("/* This C header file is generated by NIT to compile modules and programs that requires "); + REGB0 = TAG_Int(88); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_15 = fra.me.REG[2]; + register_static_object(&once_value_15); + } else fra.me.REG[2] = once_value_15; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_16) { + fra.me.REG[2] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_16 = fra.me.REG[2]; + register_static_object(&once_value_16); + } else fra.me.REG[2] = once_value_16; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:115 */ + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_17) { + fra.me.REG[2] = BOX_NativeString("#ifndef "); + REGB0 = TAG_Int(8); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_17 = fra.me.REG[2]; + register_static_object(&once_value_17); + } else fra.me.REG[2] = once_value_17; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_18) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_18 = fra.me.REG[2]; + register_static_object(&once_value_18); + } else fra.me.REG[2] = once_value_18; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_19) { + fra.me.REG[2] = BOX_NativeString("\n"); + REGB0 = TAG_Int(1); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_19 = fra.me.REG[2]; + register_static_object(&once_value_19); + } else fra.me.REG[2] = once_value_19; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:116 */ + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_20) { + fra.me.REG[2] = BOX_NativeString("#define "); + REGB0 = TAG_Int(8); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_20 = fra.me.REG[2]; + register_static_object(&once_value_20); + } else fra.me.REG[2] = once_value_20; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_21) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_21 = fra.me.REG[2]; + register_static_object(&once_value_21); + } else fra.me.REG[2] = once_value_21; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_22) { + fra.me.REG[2] = BOX_NativeString("\n"); + REGB0 = TAG_Int(1); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_22 = fra.me.REG[2]; + register_static_object(&once_value_22); + } else fra.me.REG[2] = once_value_22; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:117 */ + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(fra.me.REG[5]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 117); } - variable[6] = variable[0]; - CALL_compiling_global___MMSrcModule___declare_class_tables_to_c(variable[6])(variable[6], variable[4] /*v*/) /*MMSrcModule::declare_class_tables_to_c*/; - variable[6] = variable[0]; - CALL_compiling_global___MMSrcModule___compile_mod_to_c(variable[6])(variable[6], variable[4] /*v*/) /*MMSrcModule::compile_mod_to_c*/; - variable[7] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[9] = variable[8]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[9]) /*AbstractArray::add*/; - variable[10] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[11] = variable[10]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[11]) /*AbstractArray::add*/; - variable[12] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[13]) /*AbstractArray::add*/; - variable[14] = variable[0]; - variable[14] = CALL_abstractmetamodel___MMModule___name(variable[14])(variable[14]) /*MMModule::name*/; - variable[15] = variable[14]; - variable[15] = CALL_string___Object___to_s(variable[15])(variable[15]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[15]) /*AbstractArray::add*/; - variable[16] = NEW_String_string___String___with_native(BOX_NativeString("._sep.h"), TAG_Int(7)); /*new String*/ - variable[17] = variable[16]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[17]) /*AbstractArray::add*/; - variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/; - variable[8] = NEW_OFStream_file___OFStream___open(variable[7]); /*new OFStream*/ - variable[7] = variable[8]; - variable[6] = variable[7]; - variable[7] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("/* This C header file is generated by NIT to compile modules and programs that requires "), TAG_Int(88)); /*new String*/ - variable[9] = variable[8]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[9]) /*AbstractArray::add*/; - variable[10] = variable[0]; - variable[10] = CALL_abstractmetamodel___MMModule___name(variable[10])(variable[10]) /*MMModule::name*/; - variable[11] = variable[10]; - variable[11] = CALL_string___Object___to_s(variable[11])(variable[11]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[11]) /*AbstractArray::add*/; - variable[12] = NEW_String_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[13]) /*AbstractArray::add*/; - variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[7]) /*OFStream::write*/; - variable[7] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("#ifndef "), TAG_Int(8)); /*new String*/ - variable[9] = variable[8]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[9]) /*AbstractArray::add*/; - variable[10] = variable[0]; - variable[10] = CALL_abstractmetamodel___MMModule___name(variable[10])(variable[10]) /*MMModule::name*/; - variable[11] = variable[10]; - variable[11] = CALL_string___Object___to_s(variable[11])(variable[11]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[11]) /*AbstractArray::add*/; - variable[12] = NEW_String_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/ - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[13]) /*AbstractArray::add*/; - variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[7]) /*OFStream::write*/; - variable[7] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("#define "), TAG_Int(8)); /*new String*/ - variable[9] = variable[8]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[9]) /*AbstractArray::add*/; - variable[10] = variable[0]; - variable[10] = CALL_abstractmetamodel___MMModule___name(variable[10])(variable[10]) /*MMModule::name*/; - variable[11] = variable[10]; - variable[11] = CALL_string___Object___to_s(variable[11])(variable[11]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[11]) /*AbstractArray::add*/; - variable[12] = NEW_String_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/ - variable[13] = variable[12]; - CALL_abstract_collection___SimpleCollection___add(variable[7])(variable[7], variable[13]) /*AbstractArray::add*/; - variable[7] = CALL_string___Object___to_s(variable[7])(variable[7]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[7]) /*OFStream::write*/; - variable[7] = variable[0]; - variable[7] = CALL_abstractmetamodel___MMModule___mhe(variable[7])(variable[7]) /*MMModule::mhe*/; - variable[7] = CALL_partial_order___PartialOrderElement___direct_greaters(variable[7])(variable[7]) /*PartialOrderElement::direct_greaters*/; - variable[7] = CALL_abstract_collection___Collection___iterator(variable[7])(variable[7]) /*AbstractArray::iterator*/; - while (true) { /*for*/ - variable[8] = CALL_abstract_collection___Iterator___is_ok(variable[7])(variable[7]) /*ArrayIterator::is_ok*/; - if (!UNTAG_Bool(variable[8])) break; /*for*/ - variable[8] = CALL_abstract_collection___Iterator___item(variable[7])(variable[7]) /*ArrayIterator::item*/; - variable[9] = variable[8]; - variable[10] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[11] = NEW_String_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[12]) /*AbstractArray::add*/; - variable[13] = CALL_abstractmetamodel___MMModule___name( variable[9] /*m*/)( variable[9] /*m*/) /*MMModule::name*/; - variable[14] = variable[13]; - variable[14] = CALL_string___Object___to_s(variable[14])(variable[14]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[14]) /*AbstractArray::add*/; - variable[15] = NEW_String_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable[16] = variable[15]; - CALL_abstract_collection___SimpleCollection___add(variable[10])(variable[10], variable[16]) /*AbstractArray::add*/; - variable[10] = CALL_string___Object___to_s(variable[10])(variable[10]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[10]) /*OFStream::write*/; - continue_6: while(0); - CALL_abstract_collection___Iterator___next(variable[7])(variable[7]) /*ArrayIterator::next*/; + fra.me.REG[5] = CALL_partial_order___PartialOrderElement___direct_greaters(fra.me.REG[5])(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:234 */ + REGB0 = TAG_Int(0); + /* ./../lib/standard//collection//array.nit:235 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[5])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:236 */ + fra.me.REG[2] = ATTR_array___Array____items(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:237 */ + while(1) { + /* ./../lib/standard//collection//array.nit:23 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[5])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[5]); + /* ./../lib/standard//kernel.nit:212 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)val[UNTAG_Int(REGB0)]; + /* ./compiling//compiling.nit:117 */ + REGB1 = TAG_Int(3); + fra.me.REG[8] = NEW_Array_array___Array___with_capacity(REGB1); + if (!once_value_23) { + fra.me.REG[9] = BOX_NativeString("#include \""); + REGB1 = TAG_Int(10); + fra.me.REG[9] = NEW_String_string___String___with_native(fra.me.REG[9], REGB1); + once_value_23 = fra.me.REG[9]; + register_static_object(&once_value_23); + } else fra.me.REG[9] = once_value_23; + fra.me.REG[9] = fra.me.REG[9]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[9]); + fra.me.REG[7] = CALL_compiling_base___CProgram___module_header_name(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[7]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[7]); + if (!once_value_24) { + fra.me.REG[7] = BOX_NativeString("\"\n"); + REGB1 = TAG_Int(2); + fra.me.REG[7] = NEW_String_string___String___with_native(fra.me.REG[7], REGB1); + once_value_24 = fra.me.REG[7]; + register_static_object(&once_value_24); + } else fra.me.REG[7] = once_value_24; + fra.me.REG[7] = fra.me.REG[7]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[7]); + fra.me.REG[8] = CALL_string___Object___to_s(fra.me.REG[8])(fra.me.REG[8]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[8]); + /* ./../lib/standard//collection//array.nit:239 */ + REGB1 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1)); + /* ./../lib/standard//collection//array.nit:239 */ + REGB0 = REGB1; + } else { + /* ./../lib/standard//collection//array.nit:237 */ + goto label25; + } } - break_6: while(0); - variable[7] = CALL_compiling_base___CompilerVisitor___ctx( variable[4] /*v*/)( variable[4] /*v*/) /*CompilerVisitor::ctx*/; - variable[7] = CALL_compiling_base___CContext___decls(variable[7])(variable[7]) /*CContext::decls*/; - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable[7] = CALL_string___Collection___join(variable[7])(variable[7], variable[8]) /*Collection::join*/; - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[7]) /*OFStream::write*/; - variable[7] = NEW_String_string___String___with_native(BOX_NativeString("\n#endif\n"), TAG_Int(8)); /*new String*/ - CALL_stream___OStream___write( variable[6] /*f*/)( variable[6] /*f*/, variable[7]) /*OFStream::write*/; - CALL_stream___IOS___close( variable[6] /*f*/)( variable[6] /*f*/) /*OFStream::close*/; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = CALL_compiling_base___ToolContext___compdir( variable[1] /*tc*/)( variable[1] /*tc*/) /*ToolContext::compdir*/; - variable[12] = variable[11]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[15] = variable[0]; - variable[15] = CALL_abstractmetamodel___MMModule___name(variable[15])(variable[15]) /*MMModule::name*/; - variable[16] = variable[15]; - variable[16] = CALL_string___Object___to_s(variable[16])(variable[16]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[16]) /*AbstractArray::add*/; - variable[17] = NEW_String_string___String___with_native(BOX_NativeString("._sep.c"), TAG_Int(7)); /*new String*/ - variable[18] = variable[17]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[18]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - variable[9] = NEW_OFStream_file___OFStream___open(variable[8]); /*new OFStream*/ - variable[8] = variable[9]; - variable[7] = variable[8]; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile module "), TAG_Int(53)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = variable[0]; - variable[11] = CALL_abstractmetamodel___MMModule___name(variable[11])(variable[11]) /*MMModule::name*/; - variable[12] = variable[11]; - variable[12] = CALL_string___Object___to_s(variable[12])(variable[12]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = NEW_Array_array___Array___with_capacity(TAG_Int(3)); /*new Array[String]*/ - variable[9] = NEW_String_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable[10] = variable[9]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[10]) /*AbstractArray::add*/; - variable[11] = variable[0]; - variable[11] = CALL_abstractmetamodel___MMModule___name(variable[11])(variable[11]) /*MMModule::name*/; - variable[12] = variable[11]; - variable[12] = CALL_string___Object___to_s(variable[12])(variable[12]) /*Object::to_s*/; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[12]) /*AbstractArray::add*/; - variable[13] = NEW_String_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable[14] = variable[13]; - CALL_abstract_collection___SimpleCollection___add(variable[8])(variable[8], variable[14]) /*AbstractArray::add*/; - variable[8] = CALL_string___Object___to_s(variable[8])(variable[8]) /*Object::to_s*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = CALL_compiling_base___CompilerVisitor___ctx( variable[4] /*v*/)( variable[4] /*v*/) /*CompilerVisitor::ctx*/; - variable[8] = CALL_compiling_base___CContext___instrs(variable[8])(variable[8]) /*CContext::instrs*/; - variable[9] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable[8] = CALL_string___Collection___join(variable[8])(variable[8], variable[9]) /*Collection::join*/; - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - CALL_stream___OStream___write( variable[7] /*f*/)( variable[7] /*f*/, variable[8]) /*OFStream::write*/; - CALL_stream___IOS___close( variable[7] /*f*/)( variable[7] /*f*/) /*OFStream::close*/; - return_label5: while(false); - tracehead = trace.prev; + label25: while(0); + /* ./compiling//compiling.nit:118 */ + fra.me.REG[2] = CALL_compiling_base___CompilerVisitor___header_writer(fra.me.REG[3])(fra.me.REG[3]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[4]); + /* ./compiling//compiling.nit:119 */ + if (!once_value_26) { + fra.me.REG[2] = BOX_NativeString("#endif\n"); + REGB0 = TAG_Int(7); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_26 = fra.me.REG[2]; + register_static_object(&once_value_26); + } else fra.me.REG[2] = once_value_26; + fra.me.REG[2] = fra.me.REG[2]; + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]); + /* ./compiling//compiling.nit:120 */ + CALL_stream___IOS___close(fra.me.REG[4])(fra.me.REG[4]); + /* ./compiling//compiling.nit:122 */ + REGB0 = TAG_Int(7); + fra.me.REG[2] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_27) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_27 = fra.me.REG[5]; + register_static_object(&once_value_27); + } else fra.me.REG[5] = once_value_27; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_28) { + fra.me.REG[5] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_28 = fra.me.REG[5]; + register_static_object(&once_value_28); + } else fra.me.REG[5] = once_value_28; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_29) { + fra.me.REG[5] = BOX_NativeString("."); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_29 = fra.me.REG[5]; + register_static_object(&once_value_29); + } else fra.me.REG[5] = once_value_29; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_30) { + fra.me.REG[5] = BOX_NativeString(".c"); + REGB0 = TAG_Int(2); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_30 = fra.me.REG[5]; + register_static_object(&once_value_30); + } else fra.me.REG[5] = once_value_30; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:123 */ + fra.me.REG[1] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + /* ./compiling//compiling.nit:124 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_31) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_31 = fra.me.REG[5]; + register_static_object(&once_value_31); + } else fra.me.REG[5] = once_value_31; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + if (!once_value_32) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_32 = fra.me.REG[2]; + register_static_object(&once_value_32); + } else fra.me.REG[2] = once_value_32; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[1] = NEW_OFStream_file___OFStream___open(fra.me.REG[1]); + fra.me.REG[4] = fra.me.REG[1]; + /* ./compiling//compiling.nit:125 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_33) { + fra.me.REG[2] = BOX_NativeString("/* This C file is generated by NIT to compile module "); + REGB0 = TAG_Int(53); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_33 = fra.me.REG[2]; + register_static_object(&once_value_33); + } else fra.me.REG[2] = once_value_33; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[0] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[0] = CALL_string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + if (!once_value_34) { + fra.me.REG[0] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_34 = fra.me.REG[0]; + register_static_object(&once_value_34); + } else fra.me.REG[0] = once_value_34; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + /* ./compiling//compiling.nit:126 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_35) { + fra.me.REG[0] = BOX_NativeString("#include \""); + REGB0 = TAG_Int(10); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_35 = fra.me.REG[0]; + register_static_object(&once_value_35); + } else fra.me.REG[0] = once_value_35; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[6]); + if (!once_value_36) { + fra.me.REG[6] = BOX_NativeString("\"\n"); + REGB0 = TAG_Int(2); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_36 = fra.me.REG[6]; + register_static_object(&once_value_36); + } else fra.me.REG[6] = once_value_36; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[6]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + /* ./compiling//compiling.nit:127 */ + fra.me.REG[3] = CALL_compiling_base___CompilerVisitor___top_writer(fra.me.REG[3])(fra.me.REG[3]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + /* ./compiling//compiling.nit:128 */ + CALL_stream___IOS___close(fra.me.REG[4])(fra.me.REG[4]); + stack_frame_head = fra.me.prev; return; }