1 /* This C file is generated by NIT to compile module nitc. */
3 void nitc___NitCompiler___process_options(val_t self
) {
4 struct trace_t trace
= {NULL
, NULL
, 41, LOCATE_nitc___NitCompiler___process_options
};
5 static val_t once_value_1
= NIT_NULL
; /* Once value for string variable[2]*/
6 static val_t once_value_2
; static int once_bool_2
; /* Once value for variable[3]*/
7 static val_t once_value_3
= NIT_NULL
; /* Once value for string variable[3]*/
8 static val_t once_value_4
= NIT_NULL
; /* Once value for string variable[3]*/
9 static val_t once_value_5
; static int once_bool_5
; /* Once value for variable[3]*/
10 static val_t once_value_6
= NIT_NULL
; /* Once value for string variable[3]*/
11 static val_t once_value_7
= NIT_NULL
; /* Once value for string variable[5]*/
12 static val_t once_value_8
= NIT_NULL
; /* Once value for string variable[5]*/
13 static val_t once_value_9
= NIT_NULL
; /* Once value for string variable[4]*/
14 static val_t once_value_10
= NIT_NULL
; /* Once value for string variable[4]*/
15 static val_t once_value_11
= NIT_NULL
; /* Once value for string variable[3]*/
16 static val_t once_value_12
; static int once_bool_12
; /* Once value for variable[3]*/
17 static val_t once_value_13
= NIT_NULL
; /* Once value for string variable[3]*/
18 static val_t once_value_14
= NIT_NULL
; /* Once value for string variable[5]*/
19 static val_t once_value_15
= NIT_NULL
; /* Once value for string variable[5]*/
20 static val_t once_value_16
= NIT_NULL
; /* Once value for string variable[4]*/
21 static val_t once_value_17
= NIT_NULL
; /* Once value for string variable[4]*/
22 static val_t once_value_18
= NIT_NULL
; /* Once value for string variable[3]*/
24 struct WBT_
**closurevariable
= NULL
;
25 trace
.prev
= tracehead
; tracehead
= &trace
;
26 trace
.file
= LOCATE_nitc
;
27 /* Register variable[0]: Local variable */
29 /* Register variable[1]: Method return value and escape marker */
30 CALL_SUPER_nitc___NitCompiler___process_options(variable
[0])(variable
[0]) /*super NitCompiler::process_options*/;
31 /* Register variable[2]: Result */
32 variable
[2] = CALL_nitc___NitCompiler___opt_output(variable
[0])(variable
[0]) /*NitCompiler::opt_output*/;
33 /* Register variable[2]: Result */
34 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
35 CALL_compiling_base___ToolContext___output_file__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::output_file=*/;
36 /* Register variable[2]: Result */
37 variable
[2] = CALL_nitc___NitCompiler___opt_boost(variable
[0])(variable
[0]) /*NitCompiler::opt_boost*/;
38 /* Register variable[2]: Result */
39 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
40 CALL_compiling_base___ToolContext___boost__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::boost=*/;
41 /* Register variable[2]: Result */
42 variable
[2] = CALL_nitc___NitCompiler___opt_no_cc(variable
[0])(variable
[0]) /*NitCompiler::opt_no_cc*/;
43 /* Register variable[2]: Result */
44 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
45 CALL_compiling_base___ToolContext___no_cc__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::no_cc=*/;
46 /* Register variable[2]: Result */
47 variable
[2] = CALL_nitc___NitCompiler___opt_extension_prefix(variable
[0])(variable
[0]) /*NitCompiler::opt_extension_prefix*/;
48 /* Register variable[2]: Result */
49 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
50 CALL_compiling_base___ToolContext___ext_prefix__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::ext_prefix=*/;
51 /* Register variable[2]: Result */
52 variable
[2] = CALL_compiling_base___ToolContext___ext_prefix(variable
[0])(variable
[0]) /*ToolContext::ext_prefix*/;
53 /* Register variable[2]: Result */
54 variable
[2] = TAG_Bool((variable
[2] == NIT_NULL
/*null*/) || ((variable
[2] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[2])(variable
[2], NIT_NULL
/*null*/) /*String::==*/)));
55 if (UNTAG_Bool(variable
[2])) { /*if*/
56 /* Register variable[2]: Once String constant */
57 if (once_value_1
!= NIT_NULL
) variable
[2] = once_value_1
;
59 variable
[2] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
60 once_value_1
= variable
[2];
62 /* Register variable[2]: Result */
63 CALL_compiling_base___ToolContext___ext_prefix__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::ext_prefix=*/;
65 /* Register variable[2]: Result */
66 variable
[2] = CALL_nitc___NitCompiler___opt_global(variable
[0])(variable
[0]) /*NitCompiler::opt_global*/;
67 /* Register variable[2]: Result */
68 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
69 CALL_compiling_base___ToolContext___global__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::global=*/;
70 /* Register variable[2]: Result */
71 variable
[2] = CALL_nitc___NitCompiler___opt_compdir(variable
[0])(variable
[0]) /*NitCompiler::opt_compdir*/;
72 /* Register variable[2]: Result */
73 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
74 CALL_compiling_base___ToolContext___compdir__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::compdir=*/;
75 /* Register variable[2]: Result */
76 variable
[2] = CALL_compiling_base___ToolContext___compdir(variable
[0])(variable
[0]) /*ToolContext::compdir*/;
77 /* Register variable[2]: Result */
78 variable
[2] = TAG_Bool((variable
[2] == NIT_NULL
/*null*/) || ((variable
[2] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[2])(variable
[2], NIT_NULL
/*null*/) /*String::==*/)));
79 if (UNTAG_Bool(variable
[2])) { /*if*/
80 /* Register variable[2]: Local variable */
81 /* Register variable[3]: Once expression result */
82 if (once_bool_2
) variable
[3] = once_value_2
;
84 /* Register variable[3]: Once String constant */
85 if (once_value_3
!= NIT_NULL
) variable
[3] = once_value_3
;
87 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_COMPDIR"), TAG_Int(11)) /*new String*/;
88 once_value_3
= variable
[3];
90 /* Register variable[3]: Result */
91 /* Register variable[3]: Result */
92 variable
[3] = CALL_symbol___String___to_symbol(variable
[3])(variable
[3]) /*String::to_symbol*/;
93 /* Register variable[3]: Result */
94 variable
[3] = CALL_environ___Symbol___environ(variable
[3])(variable
[3]) /*Symbol::environ*/;
95 once_value_2
= variable
[3];
98 /* Register variable[3]: Result */
99 variable
[2] = variable
[3];
100 /* Register variable[3]: Result */
101 variable
[3] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*AbstractArrayRead::is_empty*/;
102 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[3])))) { /*if*/
103 CALL_compiling_base___ToolContext___compdir__eq(variable
[0])(variable
[0], variable
[2] /*dir*/) /*ToolContext::compdir=*/;
105 /* Register variable[3]: Result */
106 variable
[3] = CALL_compiling_base___ToolContext___compdir(variable
[0])(variable
[0]) /*ToolContext::compdir*/;
107 /* Register variable[3]: Result */
108 variable
[3] = TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*String::==*/)));
109 if (UNTAG_Bool(variable
[3])) { /*if*/
110 /* Register variable[3]: Once String constant */
111 if (once_value_4
!= NIT_NULL
) variable
[3] = once_value_4
;
113 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString(".nit_compile"), TAG_Int(12)) /*new String*/;
114 once_value_4
= variable
[3];
116 /* Register variable[3]: Result */
117 CALL_compiling_base___ToolContext___compdir__eq(variable
[0])(variable
[0], variable
[3]) /*ToolContext::compdir=*/;
120 /* Register variable[2]: Result */
121 variable
[2] = CALL_compiling_base___ToolContext___ext_prefix(variable
[0])(variable
[0]) /*ToolContext::ext_prefix*/;
122 CALL_compiling_base___ToolContext___compdir__eq(variable
[0])(variable
[0], CALL_string___String_____plus(CALL_compiling_base___ToolContext___compdir(variable
[0])(variable
[0]) /*ToolContext::compdir*/)(CALL_compiling_base___ToolContext___compdir(variable
[0])(variable
[0]) /*ToolContext::compdir*/, variable
[2]) /*String::+*/) /*ToolContext::compdir=*/;
123 /* Register variable[2]: Result */
124 variable
[2] = CALL_nitc___NitCompiler___opt_clibdir(variable
[0])(variable
[0]) /*NitCompiler::opt_clibdir*/;
125 /* Register variable[2]: Result */
126 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
127 CALL_compiling_base___ToolContext___clibdir__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::clibdir=*/;
128 /* Register variable[2]: Result */
129 variable
[2] = CALL_compiling_base___ToolContext___clibdir(variable
[0])(variable
[0]) /*ToolContext::clibdir*/;
130 /* Register variable[2]: Result */
131 variable
[2] = TAG_Bool((variable
[2] == NIT_NULL
/*null*/) || ((variable
[2] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[2])(variable
[2], NIT_NULL
/*null*/) /*String::==*/)));
132 if (UNTAG_Bool(variable
[2])) { /*if*/
133 /* Register variable[2]: Local variable */
134 /* Register variable[3]: Once expression result */
135 if (once_bool_5
) variable
[3] = once_value_5
;
137 /* Register variable[3]: Once String constant */
138 if (once_value_6
!= NIT_NULL
) variable
[3] = once_value_6
;
140 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)) /*new String*/;
141 once_value_6
= variable
[3];
143 /* Register variable[3]: Result */
144 /* Register variable[3]: Result */
145 variable
[3] = CALL_symbol___String___to_symbol(variable
[3])(variable
[3]) /*String::to_symbol*/;
146 /* Register variable[3]: Result */
147 variable
[3] = CALL_environ___Symbol___environ(variable
[3])(variable
[3]) /*Symbol::environ*/;
148 once_value_5
= variable
[3];
151 /* Register variable[3]: Result */
152 variable
[2] = variable
[3];
153 /* Register variable[3]: Result */
154 variable
[3] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*AbstractArrayRead::is_empty*/;
155 if (UNTAG_Bool(variable
[3])) { /*if*/
156 /* Register variable[3]: Local variable */
157 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
158 /* Register variable[5]: Once String constant */
159 if (once_value_7
!= NIT_NULL
) variable
[5] = once_value_7
;
161 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
162 once_value_7
= variable
[5];
164 /* Register variable[5]: Result */
165 /* Ensure var variable[5]: super-string element*/
166 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
167 /* Register variable[5]: Result */
168 variable
[5] = (G_sys
);
169 /* Register variable[5]: Result */
170 variable
[5] = CALL_string___Sys___program_name(variable
[5])(variable
[5]) /*Sys::program_name*/;
171 /* Register variable[5]: Result */
172 variable
[5] = CALL_file___String___dirname(variable
[5])(variable
[5]) /*String::dirname*/;
173 /* Ensure var variable[5]: super-string element*/
174 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
175 /* Register variable[5]: Once String constant */
176 if (once_value_8
!= NIT_NULL
) variable
[5] = once_value_8
;
178 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)) /*new String*/;
179 once_value_8
= variable
[5];
181 /* Register variable[5]: Result */
182 /* Ensure var variable[5]: super-string element*/
183 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
184 /* Register variable[4]: Result */
185 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
186 variable
[3] = variable
[4];
187 /* Register variable[4]: Result */
188 variable
[4] = CALL_file___String___file_exists( variable
[3] /*dir*/)( variable
[3] /*dir*/) /*String::file_exists*/;
189 if (UNTAG_Bool(variable
[4])) { /*if*/
190 CALL_compiling_base___ToolContext___clibdir__eq(variable
[0])(variable
[0], variable
[3] /*dir*/) /*ToolContext::clibdir=*/;
193 variable
[3] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
194 /* Register variable[4]: Once String constant */
195 if (once_value_9
!= NIT_NULL
) variable
[4] = once_value_9
;
197 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
198 once_value_9
= variable
[4];
200 /* Register variable[4]: Result */
201 /* Ensure var variable[4]: super-string element*/
202 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
203 variable
[4] = variable
[2] /*dir*/ /* Ensure var: super-string element*/;
204 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
205 /* Register variable[4]: Once String constant */
206 if (once_value_10
!= NIT_NULL
) variable
[4] = once_value_10
;
208 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)) /*new String*/;
209 once_value_10
= variable
[4];
211 /* Register variable[4]: Result */
212 /* Ensure var variable[4]: super-string element*/
213 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
214 /* Register variable[3]: Result */
215 variable
[3] = CALL_string___Object___to_s(variable
[3])(variable
[3]) /*Object::to_s*/;
216 variable
[2] = variable
[3] /*dir=*/;
217 /* Register variable[3]: Result */
218 variable
[3] = CALL_file___String___file_exists( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*String::file_exists*/;
219 if (UNTAG_Bool(variable
[3])) { /*if*/
220 CALL_compiling_base___ToolContext___clibdir__eq(variable
[0])(variable
[0], variable
[2] /*dir*/) /*ToolContext::clibdir=*/;
223 /* Register variable[3]: Result */
224 variable
[3] = CALL_compiling_base___ToolContext___clibdir(variable
[0])(variable
[0]) /*ToolContext::clibdir*/;
225 /* Register variable[3]: Result */
226 variable
[3] = TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*String::==*/)));
227 if (UNTAG_Bool(variable
[3])) { /*if*/
228 /* Register variable[3]: Once String constant */
229 if (once_value_11
!= NIT_NULL
) variable
[3] = once_value_11
;
231 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("Error: Cannot locate NIT C library directory. Uses --clibdir or envvar NIT_DIR."), TAG_Int(79)) /*new String*/;
232 once_value_11
= variable
[3];
234 /* Register variable[3]: Result */
235 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[3]) /*ToolContext::error*/;
236 exit(UNTAG_Int( TAG_Int(1)));
239 /* Register variable[2]: Result */
240 variable
[2] = CALL_nitc___NitCompiler___opt_bindir(variable
[0])(variable
[0]) /*NitCompiler::opt_bindir*/;
241 /* Register variable[2]: Result */
242 variable
[2] = CALL_opts___Option___value(variable
[2])(variable
[2]) /*Option::value*/;
243 CALL_compiling_base___ToolContext___bindir__eq(variable
[0])(variable
[0], variable
[2]) /*ToolContext::bindir=*/;
244 /* Register variable[2]: Result */
245 variable
[2] = CALL_compiling_base___ToolContext___bindir(variable
[0])(variable
[0]) /*ToolContext::bindir*/;
246 /* Register variable[2]: Result */
247 variable
[2] = TAG_Bool((variable
[2] == NIT_NULL
/*null*/) || ((variable
[2] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[2])(variable
[2], NIT_NULL
/*null*/) /*String::==*/)));
248 if (UNTAG_Bool(variable
[2])) { /*if*/
249 /* Register variable[2]: Local variable */
250 /* Register variable[3]: Once expression result */
251 if (once_bool_12
) variable
[3] = once_value_12
;
253 /* Register variable[3]: Once String constant */
254 if (once_value_13
!= NIT_NULL
) variable
[3] = once_value_13
;
256 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)) /*new String*/;
257 once_value_13
= variable
[3];
259 /* Register variable[3]: Result */
260 /* Register variable[3]: Result */
261 variable
[3] = CALL_symbol___String___to_symbol(variable
[3])(variable
[3]) /*String::to_symbol*/;
262 /* Register variable[3]: Result */
263 variable
[3] = CALL_environ___Symbol___environ(variable
[3])(variable
[3]) /*Symbol::environ*/;
264 once_value_12
= variable
[3];
267 /* Register variable[3]: Result */
268 variable
[2] = variable
[3];
269 /* Register variable[3]: Result */
270 variable
[3] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*AbstractArrayRead::is_empty*/;
271 if (UNTAG_Bool(variable
[3])) { /*if*/
272 /* Register variable[3]: Local variable */
273 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
274 /* Register variable[5]: Once String constant */
275 if (once_value_14
!= NIT_NULL
) variable
[5] = once_value_14
;
277 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
278 once_value_14
= variable
[5];
280 /* Register variable[5]: Result */
281 /* Ensure var variable[5]: super-string element*/
282 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
283 /* Register variable[5]: Result */
284 variable
[5] = (G_sys
);
285 /* Register variable[5]: Result */
286 variable
[5] = CALL_string___Sys___program_name(variable
[5])(variable
[5]) /*Sys::program_name*/;
287 /* Register variable[5]: Result */
288 variable
[5] = CALL_file___String___dirname(variable
[5])(variable
[5]) /*String::dirname*/;
289 /* Ensure var variable[5]: super-string element*/
290 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
291 /* Register variable[5]: Once String constant */
292 if (once_value_15
!= NIT_NULL
) variable
[5] = once_value_15
;
294 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("/../bin"), TAG_Int(7)) /*new String*/;
295 once_value_15
= variable
[5];
297 /* Register variable[5]: Result */
298 /* Ensure var variable[5]: super-string element*/
299 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
300 /* Register variable[4]: Result */
301 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
302 variable
[3] = variable
[4];
303 /* Register variable[4]: Result */
304 variable
[4] = CALL_file___String___file_exists( variable
[3] /*dir*/)( variable
[3] /*dir*/) /*String::file_exists*/;
305 if (UNTAG_Bool(variable
[4])) { /*if*/
306 CALL_compiling_base___ToolContext___bindir__eq(variable
[0])(variable
[0], variable
[3] /*dir*/) /*ToolContext::bindir=*/;
309 variable
[3] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
310 /* Register variable[4]: Once String constant */
311 if (once_value_16
!= NIT_NULL
) variable
[4] = once_value_16
;
313 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
314 once_value_16
= variable
[4];
316 /* Register variable[4]: Result */
317 /* Ensure var variable[4]: super-string element*/
318 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
319 variable
[4] = variable
[2] /*dir*/ /* Ensure var: super-string element*/;
320 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
321 /* Register variable[4]: Once String constant */
322 if (once_value_17
!= NIT_NULL
) variable
[4] = once_value_17
;
324 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString("/bin"), TAG_Int(4)) /*new String*/;
325 once_value_17
= variable
[4];
327 /* Register variable[4]: Result */
328 /* Ensure var variable[4]: super-string element*/
329 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
330 /* Register variable[3]: Result */
331 variable
[3] = CALL_string___Object___to_s(variable
[3])(variable
[3]) /*Object::to_s*/;
332 variable
[2] = variable
[3] /*dir=*/;
333 /* Register variable[3]: Result */
334 variable
[3] = CALL_file___String___file_exists( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*String::file_exists*/;
335 if (UNTAG_Bool(variable
[3])) { /*if*/
336 CALL_compiling_base___ToolContext___bindir__eq(variable
[0])(variable
[0], variable
[2] /*dir*/) /*ToolContext::bindir=*/;
339 /* Register variable[3]: Result */
340 variable
[3] = CALL_compiling_base___ToolContext___bindir(variable
[0])(variable
[0]) /*ToolContext::bindir*/;
341 /* Register variable[3]: Result */
342 variable
[3] = TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*String::==*/)));
343 if (UNTAG_Bool(variable
[3])) { /*if*/
344 /* Register variable[3]: Once String constant */
345 if (once_value_18
!= NIT_NULL
) variable
[3] = once_value_18
;
347 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("Error: Cannot locate NIT tools directory. Uses --bindir or envvar NIT_DIR."), TAG_Int(74)) /*new String*/;
348 once_value_18
= variable
[3];
350 /* Register variable[3]: Result */
351 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[3]) /*ToolContext::error*/;
352 exit(UNTAG_Int( TAG_Int(1)));
355 return_label0
: while(false);
356 tracehead
= trace
.prev
;
359 void nitc___NitCompiler___perform_work(val_t self
, val_t param0
) {
360 struct trace_t trace
= {NULL
, NULL
, 95, LOCATE_nitc___NitCompiler___perform_work
};
362 struct WBT_
**closurevariable
= NULL
;
363 trace
.prev
= tracehead
; tracehead
= &trace
;
364 trace
.file
= LOCATE_nitc
;
365 /* Register variable[0]: Local variable */
367 /* Register variable[1]: Local variable */
368 variable
[1] = param0
;
369 /* Register variable[2]: Method return value and escape marker */
370 /* Register variable[3]: For iterator */
371 variable
[3] = CALL_abstract_collection___Collection___iterator( variable
[1] /*mods*/)( variable
[1] /*mods*/) /*AbstractArrayRead::iterator*/;
372 while (true) { /*for*/
373 /* Register variable[4]: For 'is_ok' result */
374 variable
[4] = CALL_abstract_collection___Iterator___is_ok(variable
[3])(variable
[3]) /*ArrayIterator::is_ok*/;
375 if (!UNTAG_Bool(variable
[4])) break; /*for*/
376 variable
[4] = CALL_abstract_collection___Iterator___item(variable
[3])(variable
[3]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
377 /* Register variable[5]: Local variable */
378 variable
[5] = variable
[4];
379 /* Register variable[6]: Result */
380 variable
[6] = TAG_Bool(( variable
[5] /*mod*/==NIT_NULL
) || VAL_ISA( variable
[5] /*mod*/, COLOR_MMSrcModule
, ID_MMSrcModule
)) /*cast MMSrcModule*/;
381 if (!UNTAG_Bool(variable
[6])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_nitc___NitCompiler___perform_work
, LOCATE_nitc
, 98); nit_exit(1);}
382 CALL_compiling___MMSrcModule___compile_prog_to_c( variable
[5] /*mod*/)( variable
[5] /*mod*/, variable
[0]) /*MMSrcModule::compile_prog_to_c*/;
383 continue_20
: while(0);
384 CALL_abstract_collection___Iterator___next(variable
[3])(variable
[3]) /*ArrayIterator::next*/;
387 return_label19
: while(false);
388 tracehead
= trace
.prev
;
391 val_t
nitc___NitCompiler___opt_output(val_t self
) {
392 struct trace_t trace
= {NULL
, NULL
, 26, LOCATE_nitc___NitCompiler___opt_output
};
393 val_t
*variable
= NULL
;
394 struct WBT_
**closurevariable
= NULL
;
395 trace
.prev
= tracehead
; tracehead
= &trace
;
396 trace
.file
= LOCATE_nitc
;
397 tracehead
= trace
.prev
;
398 return ATTR_nitc___NitCompiler____opt_output( self
) /*NitCompiler::_opt_output*/;
400 val_t
nitc___NitCompiler___opt_boost(val_t self
) {
401 struct trace_t trace
= {NULL
, NULL
, 27, LOCATE_nitc___NitCompiler___opt_boost
};
402 val_t
*variable
= NULL
;
403 struct WBT_
**closurevariable
= NULL
;
404 trace
.prev
= tracehead
; tracehead
= &trace
;
405 trace
.file
= LOCATE_nitc
;
406 tracehead
= trace
.prev
;
407 return ATTR_nitc___NitCompiler____opt_boost( self
) /*NitCompiler::_opt_boost*/;
409 val_t
nitc___NitCompiler___opt_no_cc(val_t self
) {
410 struct trace_t trace
= {NULL
, NULL
, 28, LOCATE_nitc___NitCompiler___opt_no_cc
};
411 val_t
*variable
= NULL
;
412 struct WBT_
**closurevariable
= NULL
;
413 trace
.prev
= tracehead
; tracehead
= &trace
;
414 trace
.file
= LOCATE_nitc
;
415 tracehead
= trace
.prev
;
416 return ATTR_nitc___NitCompiler____opt_no_cc( self
) /*NitCompiler::_opt_no_cc*/;
418 val_t
nitc___NitCompiler___opt_global(val_t self
) {
419 struct trace_t trace
= {NULL
, NULL
, 29, LOCATE_nitc___NitCompiler___opt_global
};
420 val_t
*variable
= NULL
;
421 struct WBT_
**closurevariable
= NULL
;
422 trace
.prev
= tracehead
; tracehead
= &trace
;
423 trace
.file
= LOCATE_nitc
;
424 tracehead
= trace
.prev
;
425 return ATTR_nitc___NitCompiler____opt_global( self
) /*NitCompiler::_opt_global*/;
427 val_t
nitc___NitCompiler___opt_clibdir(val_t self
) {
428 struct trace_t trace
= {NULL
, NULL
, 30, LOCATE_nitc___NitCompiler___opt_clibdir
};
429 val_t
*variable
= NULL
;
430 struct WBT_
**closurevariable
= NULL
;
431 trace
.prev
= tracehead
; tracehead
= &trace
;
432 trace
.file
= LOCATE_nitc
;
433 tracehead
= trace
.prev
;
434 return ATTR_nitc___NitCompiler____opt_clibdir( self
) /*NitCompiler::_opt_clibdir*/;
436 val_t
nitc___NitCompiler___opt_bindir(val_t self
) {
437 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_nitc___NitCompiler___opt_bindir
};
438 val_t
*variable
= NULL
;
439 struct WBT_
**closurevariable
= NULL
;
440 trace
.prev
= tracehead
; tracehead
= &trace
;
441 trace
.file
= LOCATE_nitc
;
442 tracehead
= trace
.prev
;
443 return ATTR_nitc___NitCompiler____opt_bindir( self
) /*NitCompiler::_opt_bindir*/;
445 val_t
nitc___NitCompiler___opt_compdir(val_t self
) {
446 struct trace_t trace
= {NULL
, NULL
, 32, LOCATE_nitc___NitCompiler___opt_compdir
};
447 val_t
*variable
= NULL
;
448 struct WBT_
**closurevariable
= NULL
;
449 trace
.prev
= tracehead
; tracehead
= &trace
;
450 trace
.file
= LOCATE_nitc
;
451 tracehead
= trace
.prev
;
452 return ATTR_nitc___NitCompiler____opt_compdir( self
) /*NitCompiler::_opt_compdir*/;
454 val_t
nitc___NitCompiler___opt_extension_prefix(val_t self
) {
455 struct trace_t trace
= {NULL
, NULL
, 33, LOCATE_nitc___NitCompiler___opt_extension_prefix
};
456 val_t
*variable
= NULL
;
457 struct WBT_
**closurevariable
= NULL
;
458 trace
.prev
= tracehead
; tracehead
= &trace
;
459 trace
.file
= LOCATE_nitc
;
460 tracehead
= trace
.prev
;
461 return ATTR_nitc___NitCompiler____opt_extension_prefix( self
) /*NitCompiler::_opt_extension_prefix*/;
463 void nitc___NitCompiler___init(val_t self
, int* init_table
) {
464 struct trace_t trace
= {NULL
, NULL
, 35, LOCATE_nitc___NitCompiler___init
};
466 struct WBT_
**closurevariable
= NULL
;
467 trace
.prev
= tracehead
; tracehead
= &trace
;
468 trace
.file
= LOCATE_nitc
;
469 /* Register variable[0]: Local variable */
471 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_NitCompiler
].i
]) return;
472 /* Register variable[1]: Method return value and escape marker */
473 CALL_abstracttool___AbstractCompiler___init(variable
[0])(variable
[0], init_table
/*YYY*/) /*AbstractCompiler::init*/;
474 /* Register variable[2]: Result */
475 variable
[2] = CALL_mmloader___ToolContext___option_context(variable
[0])(variable
[0]) /*ToolContext::option_context*/;
476 variable
[3] = NEW_Array_array___Array___with_capacity(TAG_Int(8)) /*new Array[Option]*/ /* Ensure var: Literal array*/;
477 /* Register variable[4]: Result */
478 variable
[4] = CALL_nitc___NitCompiler___opt_output(variable
[0])(variable
[0]) /*NitCompiler::opt_output*/;
479 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
480 /* Register variable[5]: Result */
481 variable
[5] = CALL_nitc___NitCompiler___opt_boost(variable
[0])(variable
[0]) /*NitCompiler::opt_boost*/;
482 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[5]) /*AbstractArray::add*/;
483 /* Register variable[6]: Result */
484 variable
[6] = CALL_nitc___NitCompiler___opt_no_cc(variable
[0])(variable
[0]) /*NitCompiler::opt_no_cc*/;
485 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[6]) /*AbstractArray::add*/;
486 /* Register variable[7]: Result */
487 variable
[7] = CALL_nitc___NitCompiler___opt_global(variable
[0])(variable
[0]) /*NitCompiler::opt_global*/;
488 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[7]) /*AbstractArray::add*/;
489 /* Register variable[8]: Result */
490 variable
[8] = CALL_nitc___NitCompiler___opt_clibdir(variable
[0])(variable
[0]) /*NitCompiler::opt_clibdir*/;
491 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[8]) /*AbstractArray::add*/;
492 /* Register variable[9]: Result */
493 variable
[9] = CALL_nitc___NitCompiler___opt_bindir(variable
[0])(variable
[0]) /*NitCompiler::opt_bindir*/;
494 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[9]) /*AbstractArray::add*/;
495 /* Register variable[10]: Result */
496 variable
[10] = CALL_nitc___NitCompiler___opt_compdir(variable
[0])(variable
[0]) /*NitCompiler::opt_compdir*/;
497 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[10]) /*AbstractArray::add*/;
498 /* Register variable[11]: Result */
499 variable
[11] = CALL_nitc___NitCompiler___opt_extension_prefix(variable
[0])(variable
[0]) /*NitCompiler::opt_extension_prefix*/;
500 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[11]) /*AbstractArray::add*/;
501 /* Register variable[3]: Result */
502 CALL_opts___OptionContext___add_option(variable
[2])(variable
[2], variable
[3]) /*OptionContext::add_option*/;
503 return_label21
: while(false);
504 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_NitCompiler
].i
] = 1;
505 tracehead
= trace
.prev
;
508 void nitc___Sys___main(val_t self
) {
509 struct trace_t trace
= {NULL
, NULL
, 105, LOCATE_nitc___Sys___main
};
511 struct WBT_
**closurevariable
= NULL
;
512 trace
.prev
= tracehead
; tracehead
= &trace
;
513 trace
.file
= LOCATE_nitc
;
514 /* Register variable[0]: Local variable */
516 /* Register variable[1]: Method return value and escape marker */
517 /* Register variable[2]: Local variable */
518 /* Register variable[3]: Result */
519 variable
[3] = NEW_NitCompiler_nitc___NitCompiler___init() /*new NitCompiler*/;
520 variable
[2] = variable
[3];
521 CALL_abstracttool___AbstractCompiler___exec_cmd_line( variable
[2] /*c*/)( variable
[2] /*c*/) /*AbstractCompiler::exec_cmd_line*/;
522 return_label22
: while(false);
523 tracehead
= trace
.prev
;