nitc: fix calling extern constructors from extern code in separate compiler
[nit.git] / c_src / phase.sep.1.c
1 #include "phase.sep.0.h"
2 /* method phase#ToolContext#phases for (self: ToolContext): POSet[Phase] */
3 val* phase__ToolContext__phases(val* self) {
4 val* var /* : POSet[Phase] */;
5 val* var1 /* : POSet[Phase] */;
6 var1 = self->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <self:ToolContext> */
7 if (unlikely(var1 == NULL)) {
8 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
9 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
10 show_backtrace(1);
11 }
12 var = var1;
13 RET_LABEL:;
14 return var;
15 }
16 /* method phase#ToolContext#phases for (self: Object): POSet[Phase] */
17 val* VIRTUAL_phase__ToolContext__phases(val* self) {
18 val* var /* : POSet[Phase] */;
19 val* var1 /* : POSet[Phase] */;
20 val* var3 /* : POSet[Phase] */;
21 { /* Inline phase#ToolContext#phases (self) on <self:Object(ToolContext)> */
22 var3 = self->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <self:Object(ToolContext)> */
23 if (unlikely(var3 == NULL)) {
24 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
25 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
26 show_backtrace(1);
27 }
28 var1 = var3;
29 RET_LABEL2:(void)0;
30 }
31 var = var1;
32 RET_LABEL:;
33 return var;
34 }
35 /* method phase#ToolContext#opt_disable_phase for (self: ToolContext): OptionArray */
36 val* phase__ToolContext__opt_disable_phase(val* self) {
37 val* var /* : OptionArray */;
38 val* var1 /* : OptionArray */;
39 var1 = self->attrs[COLOR_phase__ToolContext___opt_disable_phase].val; /* _opt_disable_phase on <self:ToolContext> */
40 if (unlikely(var1 == NULL)) {
41 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_disable_phase");
42 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 30);
43 show_backtrace(1);
44 }
45 var = var1;
46 RET_LABEL:;
47 return var;
48 }
49 /* method phase#ToolContext#opt_disable_phase for (self: Object): OptionArray */
50 val* VIRTUAL_phase__ToolContext__opt_disable_phase(val* self) {
51 val* var /* : OptionArray */;
52 val* var1 /* : OptionArray */;
53 val* var3 /* : OptionArray */;
54 { /* Inline phase#ToolContext#opt_disable_phase (self) on <self:Object(ToolContext)> */
55 var3 = self->attrs[COLOR_phase__ToolContext___opt_disable_phase].val; /* _opt_disable_phase on <self:Object(ToolContext)> */
56 if (unlikely(var3 == NULL)) {
57 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_disable_phase");
58 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 30);
59 show_backtrace(1);
60 }
61 var1 = var3;
62 RET_LABEL2:(void)0;
63 }
64 var = var1;
65 RET_LABEL:;
66 return var;
67 }
68 /* method phase#ToolContext#init for (self: ToolContext) */
69 void phase__ToolContext__init(val* self) {
70 val* var /* : OptionContext */;
71 val* var2 /* : OptionContext */;
72 val* var3 /* : OptionArray */;
73 val* var5 /* : OptionArray */;
74 val* var6 /* : Array[Option] */;
75 long var7 /* : Int */;
76 val* var8 /* : NativeArray[Option] */;
77 {
78 ((void (*)(val*))(self->class->vft[COLOR_phase__ToolContext__init]))(self) /* init on <self:ToolContext>*/;
79 }
80 {
81 { /* Inline toolcontext#ToolContext#option_context (self) on <self:ToolContext> */
82 var2 = self->attrs[COLOR_toolcontext__ToolContext___option_context].val; /* _option_context on <self:ToolContext> */
83 if (unlikely(var2 == NULL)) {
84 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _option_context");
85 PRINT_ERROR(" (%s:%d)\n", "toolcontext.nit", 231);
86 show_backtrace(1);
87 }
88 var = var2;
89 RET_LABEL1:(void)0;
90 }
91 }
92 {
93 { /* Inline phase#ToolContext#opt_disable_phase (self) on <self:ToolContext> */
94 var5 = self->attrs[COLOR_phase__ToolContext___opt_disable_phase].val; /* _opt_disable_phase on <self:ToolContext> */
95 if (unlikely(var5 == NULL)) {
96 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_disable_phase");
97 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 30);
98 show_backtrace(1);
99 }
100 var3 = var5;
101 RET_LABEL4:(void)0;
102 }
103 }
104 var6 = NEW_array__Array(&type_array__Arrayopts__Option);
105 { /* var6 = array_instance Array[Option] */
106 var7 = 1;
107 var8 = NEW_array__NativeArray(var7, &type_array__NativeArrayopts__Option);
108 ((struct instance_array__NativeArray*)var8)->values[0] = (val*) var3;
109 {
110 ((void (*)(val*, val*, long))(var6->class->vft[COLOR_array__Array__with_native]))(var6, var8, var7) /* with_native on <var6:Array[Option]>*/;
111 }
112 }
113 {
114 opts__OptionContext__add_option(var, var6); /* Direct call opts#OptionContext#add_option on <var:OptionContext>*/
115 }
116 RET_LABEL:;
117 }
118 /* method phase#ToolContext#init for (self: Object) */
119 void VIRTUAL_phase__ToolContext__init(val* self) {
120 phase__ToolContext__init(self); /* Direct call phase#ToolContext#init on <self:Object(ToolContext)>*/
121 RET_LABEL:;
122 }
123 /* method phase#ToolContext#process_options for (self: ToolContext, Sequence[String]) */
124 void phase__ToolContext__process_options(val* self, val* p0) {
125 val* var_args /* var args: Sequence[String] */;
126 val* var /* : OptionArray */;
127 val* var2 /* : OptionArray */;
128 val* var3 /* : nullable Object */;
129 val* var5 /* : nullable Object */;
130 val* var_ /* var : Array[String] */;
131 val* var6 /* : ArrayIterator[nullable Object] */;
132 val* var_7 /* var : ArrayIterator[String] */;
133 short int var8 /* : Bool */;
134 val* var9 /* : nullable Object */;
135 val* var_v /* var v: String */;
136 static val* varonce;
137 val* var10 /* : String */;
138 char* var11 /* : NativeString */;
139 long var12 /* : Int */;
140 val* var13 /* : FlatString */;
141 short int var14 /* : Bool */;
142 short int var15 /* : Bool */;
143 val* var16 /* : Sequence[Phase] */;
144 val* var_17 /* var : Sequence[Phase] */;
145 val* var18 /* : Iterator[nullable Object] */;
146 val* var_19 /* var : IndexedIterator[Phase] */;
147 short int var20 /* : Bool */;
148 val* var21 /* : nullable Object */;
149 val* var_p /* var p: Phase */;
150 val* var22 /* : POSetElement[Phase] */;
151 val* var24 /* : POSetElement[Phase] */;
152 val* var25 /* : Collection[Object] */;
153 val* var_deps /* var deps: Collection[Phase] */;
154 short int var26 /* : Bool */;
155 static val* varonce27;
156 val* var28 /* : String */;
157 char* var29 /* : NativeString */;
158 long var30 /* : Int */;
159 val* var31 /* : FlatString */;
160 static val* varonce32;
161 val* var33 /* : String */;
162 char* var34 /* : NativeString */;
163 long var35 /* : Int */;
164 val* var36 /* : FlatString */;
165 val* var37 /* : String */;
166 static val* varonce38;
167 val* var39 /* : String */;
168 char* var40 /* : NativeString */;
169 long var41 /* : Int */;
170 val* var42 /* : FlatString */;
171 val* var43 /* : Array[Object] */;
172 long var44 /* : Int */;
173 val* var45 /* : NativeArray[Object] */;
174 val* var46 /* : String */;
175 long var48 /* : Int */;
176 short int var50 /* : Bool */;
177 short int var_found /* var found: Bool */;
178 val* var51 /* : POSet[Phase] */;
179 val* var53 /* : POSet[Phase] */;
180 val* var_54 /* var : POSet[Phase] */;
181 val* var55 /* : Iterator[Object] */;
182 val* var_56 /* var : Iterator[Phase] */;
183 short int var57 /* : Bool */;
184 val* var58 /* : nullable Object */;
185 val* var_p59 /* var p: Phase */;
186 val* var60 /* : String */;
187 short int var61 /* : Bool */;
188 short int var62 /* : Bool */;
189 val* var_other /* var other: nullable Object */;
190 short int var64 /* : Bool */;
191 short int var65 /* : Bool */;
192 short int var66 /* : Bool */;
193 short int var68 /* : Bool */;
194 short int var69 /* : Bool */;
195 short int var73 /* : Bool */;
196 val* var74 /* : null */;
197 static val* varonce75;
198 val* var76 /* : String */;
199 char* var77 /* : NativeString */;
200 long var78 /* : Int */;
201 val* var79 /* : FlatString */;
202 static val* varonce80;
203 val* var81 /* : String */;
204 char* var82 /* : NativeString */;
205 long var83 /* : Int */;
206 val* var84 /* : FlatString */;
207 val* var85 /* : Array[Object] */;
208 long var86 /* : Int */;
209 val* var87 /* : NativeArray[Object] */;
210 val* var88 /* : String */;
211 var_args = p0;
212 {
213 ((void (*)(val*, val*))(self->class->vft[COLOR_phase__ToolContext__process_options]))(self, p0) /* process_options on <self:ToolContext>*/;
214 }
215 {
216 { /* Inline phase#ToolContext#opt_disable_phase (self) on <self:ToolContext> */
217 var2 = self->attrs[COLOR_phase__ToolContext___opt_disable_phase].val; /* _opt_disable_phase on <self:ToolContext> */
218 if (unlikely(var2 == NULL)) {
219 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_disable_phase");
220 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 30);
221 show_backtrace(1);
222 }
223 var = var2;
224 RET_LABEL1:(void)0;
225 }
226 }
227 {
228 { /* Inline opts#Option#value (var) on <var:OptionArray> */
229 var5 = var->attrs[COLOR_opts__Option___value].val; /* _value on <var:OptionArray> */
230 var3 = var5;
231 RET_LABEL4:(void)0;
232 }
233 }
234 var_ = var3;
235 {
236 var6 = array__AbstractArrayRead__iterator(var_);
237 }
238 var_7 = var6;
239 for(;;) {
240 {
241 var8 = array__ArrayIterator__is_ok(var_7);
242 }
243 if (var8){
244 {
245 var9 = array__ArrayIterator__item(var_7);
246 }
247 var_v = var9;
248 if (varonce) {
249 var10 = varonce;
250 } else {
251 var11 = "list";
252 var12 = 4;
253 var13 = string__NativeString__to_s_with_length(var11, var12);
254 var10 = var13;
255 varonce = var10;
256 }
257 {
258 var15 = string__FlatString___61d_61d(var_v, var10);
259 var14 = var15;
260 }
261 if (var14){
262 {
263 var16 = phase__ToolContext__phases_list(self);
264 }
265 var_17 = var16;
266 {
267 var18 = ((val* (*)(val*))(var_17->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_17) /* iterator on <var_17:Sequence[Phase]>*/;
268 }
269 var_19 = var18;
270 for(;;) {
271 {
272 var20 = ((short int (*)(val*))(var_19->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_19) /* is_ok on <var_19:IndexedIterator[Phase]>*/;
273 }
274 if (var20){
275 {
276 var21 = ((val* (*)(val*))(var_19->class->vft[COLOR_abstract_collection__Iterator__item]))(var_19) /* item on <var_19:IndexedIterator[Phase]>*/;
277 }
278 var_p = var21;
279 {
280 { /* Inline phase#Phase#in_hierarchy (var_p) on <var_p:Phase> */
281 var24 = var_p->attrs[COLOR_phase__Phase___in_hierarchy].val; /* _in_hierarchy on <var_p:Phase> */
282 if (unlikely(var24 == NULL)) {
283 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _in_hierarchy");
284 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 165);
285 show_backtrace(1);
286 }
287 var22 = var24;
288 RET_LABEL23:(void)0;
289 }
290 }
291 {
292 var25 = poset__POSetElement__direct_greaters(var22);
293 }
294 var_deps = var25;
295 {
296 var26 = ((short int (*)(val*))(var_deps->class->vft[COLOR_abstract_collection__Collection__is_empty]))(var_deps) /* is_empty on <var_deps:Collection[Phase]>*/;
297 }
298 if (var26){
299 {
300 file__Object__print(self, var_p); /* Direct call file#Object#print on <self:ToolContext>*/
301 }
302 } else {
303 if (varonce27) {
304 var28 = varonce27;
305 } else {
306 var29 = " (dep: ";
307 var30 = 7;
308 var31 = string__NativeString__to_s_with_length(var29, var30);
309 var28 = var31;
310 varonce27 = var28;
311 }
312 if (varonce32) {
313 var33 = varonce32;
314 } else {
315 var34 = ", ";
316 var35 = 2;
317 var36 = string__NativeString__to_s_with_length(var34, var35);
318 var33 = var36;
319 varonce32 = var33;
320 }
321 {
322 var37 = string__Collection__join(var_deps, var33);
323 }
324 if (varonce38) {
325 var39 = varonce38;
326 } else {
327 var40 = ")";
328 var41 = 1;
329 var42 = string__NativeString__to_s_with_length(var40, var41);
330 var39 = var42;
331 varonce38 = var39;
332 }
333 var43 = NEW_array__Array(&type_array__Arraykernel__Object);
334 { /* var43 = array_instance Array[Object] */
335 var44 = 4;
336 var45 = NEW_array__NativeArray(var44, &type_array__NativeArraykernel__Object);
337 ((struct instance_array__NativeArray*)var45)->values[0] = (val*) var_p;
338 ((struct instance_array__NativeArray*)var45)->values[1] = (val*) var28;
339 ((struct instance_array__NativeArray*)var45)->values[2] = (val*) var37;
340 ((struct instance_array__NativeArray*)var45)->values[3] = (val*) var39;
341 {
342 ((void (*)(val*, val*, long))(var43->class->vft[COLOR_array__Array__with_native]))(var43, var45, var44) /* with_native on <var43:Array[Object]>*/;
343 }
344 }
345 {
346 var46 = ((val* (*)(val*))(var43->class->vft[COLOR_string__Object__to_s]))(var43) /* to_s on <var43:Array[Object]>*/;
347 }
348 {
349 file__Object__print(self, var46); /* Direct call file#Object#print on <self:ToolContext>*/
350 }
351 }
352 {
353 ((void (*)(val*))(var_19->class->vft[COLOR_abstract_collection__Iterator__next]))(var_19) /* next on <var_19:IndexedIterator[Phase]>*/;
354 }
355 } else {
356 goto BREAK_label;
357 }
358 }
359 BREAK_label: (void)0;
360 {
361 { /* Inline abstract_collection#Iterator#finish (var_19) on <var_19:IndexedIterator[Phase]> */
362 RET_LABEL47:(void)0;
363 }
364 }
365 var48 = 0;
366 {
367 { /* Inline kernel#Object#exit (self,var48) on <self:ToolContext> */
368 exit(var48);
369 RET_LABEL49:(void)0;
370 }
371 }
372 } else {
373 }
374 var50 = 0;
375 var_found = var50;
376 {
377 { /* Inline phase#ToolContext#phases (self) on <self:ToolContext> */
378 var53 = self->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <self:ToolContext> */
379 if (unlikely(var53 == NULL)) {
380 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
381 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
382 show_backtrace(1);
383 }
384 var51 = var53;
385 RET_LABEL52:(void)0;
386 }
387 }
388 var_54 = var51;
389 {
390 var55 = poset__POSet__iterator(var_54);
391 }
392 var_56 = var55;
393 for(;;) {
394 {
395 var57 = ((short int (*)(val*))(var_56->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_56) /* is_ok on <var_56:Iterator[Phase]>*/;
396 }
397 if (var57){
398 {
399 var58 = ((val* (*)(val*))(var_56->class->vft[COLOR_abstract_collection__Iterator__item]))(var_56) /* item on <var_56:Iterator[Phase]>*/;
400 }
401 var_p59 = var58;
402 {
403 var60 = phase__Phase__to_s(var_p59);
404 }
405 {
406 { /* Inline kernel#Object#!= (var_v,var60) on <var_v:String> */
407 var_other = var60;
408 {
409 var65 = ((short int (*)(val*, val*))(var_v->class->vft[COLOR_kernel__Object___61d_61d]))(var_v, var_other) /* == on <var_v:String>*/;
410 var64 = var65;
411 }
412 var66 = !var64;
413 var62 = var66;
414 goto RET_LABEL63;
415 RET_LABEL63:(void)0;
416 }
417 var61 = var62;
418 }
419 if (var61){
420 goto BREAK_label67;
421 } else {
422 }
423 var68 = 1;
424 var_found = var68;
425 var69 = 1;
426 {
427 { /* Inline phase#Phase#disabled= (var_p59,var69) on <var_p59:Phase> */
428 var_p59->attrs[COLOR_phase__Phase___disabled].s = var69; /* _disabled on <var_p59:Phase> */
429 RET_LABEL70:(void)0;
430 }
431 }
432 BREAK_label67: (void)0;
433 {
434 ((void (*)(val*))(var_56->class->vft[COLOR_abstract_collection__Iterator__next]))(var_56) /* next on <var_56:Iterator[Phase]>*/;
435 }
436 } else {
437 goto BREAK_label71;
438 }
439 }
440 BREAK_label71: (void)0;
441 {
442 { /* Inline abstract_collection#Iterator#finish (var_56) on <var_56:Iterator[Phase]> */
443 RET_LABEL72:(void)0;
444 }
445 }
446 var73 = !var_found;
447 if (var73){
448 var74 = NULL;
449 if (varonce75) {
450 var76 = varonce75;
451 } else {
452 var77 = "Error: no phase named `";
453 var78 = 23;
454 var79 = string__NativeString__to_s_with_length(var77, var78);
455 var76 = var79;
456 varonce75 = var76;
457 }
458 if (varonce80) {
459 var81 = varonce80;
460 } else {
461 var82 = "`. Use `list` to list all phases.";
462 var83 = 33;
463 var84 = string__NativeString__to_s_with_length(var82, var83);
464 var81 = var84;
465 varonce80 = var81;
466 }
467 var85 = NEW_array__Array(&type_array__Arraykernel__Object);
468 { /* var85 = array_instance Array[Object] */
469 var86 = 3;
470 var87 = NEW_array__NativeArray(var86, &type_array__NativeArraykernel__Object);
471 ((struct instance_array__NativeArray*)var87)->values[0] = (val*) var76;
472 ((struct instance_array__NativeArray*)var87)->values[1] = (val*) var_v;
473 ((struct instance_array__NativeArray*)var87)->values[2] = (val*) var81;
474 {
475 ((void (*)(val*, val*, long))(var85->class->vft[COLOR_array__Array__with_native]))(var85, var87, var86) /* with_native on <var85:Array[Object]>*/;
476 }
477 }
478 {
479 var88 = ((val* (*)(val*))(var85->class->vft[COLOR_string__Object__to_s]))(var85) /* to_s on <var85:Array[Object]>*/;
480 }
481 {
482 toolcontext__ToolContext__fatal_error(self, var74, var88); /* Direct call toolcontext#ToolContext#fatal_error on <self:ToolContext>*/
483 }
484 } else {
485 }
486 {
487 array__ArrayIterator__next(var_7); /* Direct call array#ArrayIterator#next on <var_7:ArrayIterator[String]>*/
488 }
489 } else {
490 goto BREAK_label89;
491 }
492 }
493 BREAK_label89: (void)0;
494 {
495 { /* Inline abstract_collection#Iterator#finish (var_7) on <var_7:ArrayIterator[String]> */
496 RET_LABEL90:(void)0;
497 }
498 }
499 RET_LABEL:;
500 }
501 /* method phase#ToolContext#process_options for (self: Object, Sequence[String]) */
502 void VIRTUAL_phase__ToolContext__process_options(val* self, val* p0) {
503 phase__ToolContext__process_options(self, p0); /* Direct call phase#ToolContext#process_options on <self:Object(ToolContext)>*/
504 RET_LABEL:;
505 }
506 /* method phase#ToolContext#phases_list for (self: ToolContext): Sequence[Phase] */
507 val* phase__ToolContext__phases_list(val* self) {
508 val* var /* : Sequence[Phase] */;
509 val* var1 /* : POSet[Phase] */;
510 val* var3 /* : POSet[Phase] */;
511 val* var4 /* : Array[nullable Object] */;
512 val* var_phases /* var phases: Array[Phase] */;
513 val* var5 /* : POSet[Phase] */;
514 val* var7 /* : POSet[Phase] */;
515 {
516 { /* Inline phase#ToolContext#phases (self) on <self:ToolContext> */
517 var3 = self->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <self:ToolContext> */
518 if (unlikely(var3 == NULL)) {
519 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
520 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
521 show_backtrace(1);
522 }
523 var1 = var3;
524 RET_LABEL2:(void)0;
525 }
526 }
527 {
528 var4 = array__Collection__to_a(var1);
529 }
530 var_phases = var4;
531 {
532 { /* Inline phase#ToolContext#phases (self) on <self:ToolContext> */
533 var7 = self->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <self:ToolContext> */
534 if (unlikely(var7 == NULL)) {
535 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
536 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
537 show_backtrace(1);
538 }
539 var5 = var7;
540 RET_LABEL6:(void)0;
541 }
542 }
543 {
544 sorter__Comparator__sort(var5, var_phases); /* Direct call sorter#Comparator#sort on <var5:POSet[Phase]>*/
545 }
546 var = var_phases;
547 goto RET_LABEL;
548 RET_LABEL:;
549 return var;
550 }
551 /* method phase#ToolContext#phases_list for (self: Object): Sequence[Phase] */
552 val* VIRTUAL_phase__ToolContext__phases_list(val* self) {
553 val* var /* : Sequence[Phase] */;
554 val* var1 /* : Sequence[Phase] */;
555 var1 = phase__ToolContext__phases_list(self);
556 var = var1;
557 RET_LABEL:;
558 return var;
559 }
560 /* method phase#ToolContext#phased_modules for (self: ToolContext): HashSet[AModule] */
561 val* phase__ToolContext__phased_modules(val* self) {
562 val* var /* : HashSet[AModule] */;
563 val* var1 /* : HashSet[AModule] */;
564 var1 = self->attrs[COLOR_phase__ToolContext___phased_modules].val; /* _phased_modules on <self:ToolContext> */
565 if (unlikely(var1 == NULL)) {
566 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phased_modules");
567 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 74);
568 show_backtrace(1);
569 }
570 var = var1;
571 RET_LABEL:;
572 return var;
573 }
574 /* method phase#ToolContext#phased_modules for (self: Object): HashSet[AModule] */
575 val* VIRTUAL_phase__ToolContext__phased_modules(val* self) {
576 val* var /* : HashSet[AModule] */;
577 val* var1 /* : HashSet[AModule] */;
578 val* var3 /* : HashSet[AModule] */;
579 { /* Inline phase#ToolContext#phased_modules (self) on <self:Object(ToolContext)> */
580 var3 = self->attrs[COLOR_phase__ToolContext___phased_modules].val; /* _phased_modules on <self:Object(ToolContext)> */
581 if (unlikely(var3 == NULL)) {
582 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phased_modules");
583 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 74);
584 show_backtrace(1);
585 }
586 var1 = var3;
587 RET_LABEL2:(void)0;
588 }
589 var = var1;
590 RET_LABEL:;
591 return var;
592 }
593 /* method phase#ToolContext#run_phases for (self: ToolContext, Collection[AModule]) */
594 void phase__ToolContext__run_phases(val* self, val* p0) {
595 val* var_nmodules /* var nmodules: Collection[AModule] */;
596 long var /* : Int */;
597 long var2 /* : Int for extern */;
598 long var_time0 /* var time0: Int */;
599 static val* varonce;
600 val* var3 /* : String */;
601 char* var4 /* : NativeString */;
602 long var5 /* : Int */;
603 val* var6 /* : FlatString */;
604 long var7 /* : Int */;
605 val* var8 /* : Sequence[Phase] */;
606 val* var_phases /* var phases: Sequence[Phase] */;
607 val* var_ /* var : Sequence[Phase] */;
608 val* var9 /* : Iterator[nullable Object] */;
609 val* var_10 /* var : IndexedIterator[Phase] */;
610 short int var11 /* : Bool */;
611 val* var12 /* : nullable Object */;
612 val* var_phase /* var phase: Phase */;
613 static val* varonce13;
614 val* var14 /* : String */;
615 char* var15 /* : NativeString */;
616 long var16 /* : Int */;
617 val* var17 /* : FlatString */;
618 val* var18 /* : Array[Object] */;
619 long var19 /* : Int */;
620 val* var20 /* : NativeArray[Object] */;
621 val* var21 /* : String */;
622 long var22 /* : Int */;
623 val* var_24 /* var : Collection[AModule] */;
624 val* var25 /* : Iterator[nullable Object] */;
625 val* var_26 /* var : Iterator[AModule] */;
626 short int var27 /* : Bool */;
627 val* var28 /* : nullable Object */;
628 val* var_nmodule /* var nmodule: AModule */;
629 val* var29 /* : HashSet[AModule] */;
630 val* var31 /* : HashSet[AModule] */;
631 short int var32 /* : Bool */;
632 val* var34 /* : HashSet[AModule] */;
633 val* var36 /* : HashSet[AModule] */;
634 static val* varonce37;
635 val* var38 /* : String */;
636 char* var39 /* : NativeString */;
637 long var40 /* : Int */;
638 val* var41 /* : FlatString */;
639 val* var42 /* : Location */;
640 val* var44 /* : Location */;
641 val* var45 /* : nullable SourceFile */;
642 val* var47 /* : nullable SourceFile */;
643 val* var48 /* : String */;
644 val* var50 /* : String */;
645 val* var51 /* : Array[Object] */;
646 long var52 /* : Int */;
647 val* var53 /* : NativeArray[Object] */;
648 val* var54 /* : String */;
649 long var55 /* : Int */;
650 val* var56 /* : AnnotationPhaseVisitor */;
651 val* var_vannot /* var vannot: AnnotationPhaseVisitor */;
652 val* var_57 /* var : Sequence[Phase] */;
653 val* var58 /* : Iterator[nullable Object] */;
654 val* var_59 /* var : IndexedIterator[Phase] */;
655 short int var60 /* : Bool */;
656 val* var61 /* : nullable Object */;
657 val* var_phase62 /* var phase: Phase */;
658 short int var63 /* : Bool */;
659 short int var65 /* : Bool */;
660 static val* varonce67;
661 val* var68 /* : String */;
662 char* var69 /* : NativeString */;
663 long var70 /* : Int */;
664 val* var71 /* : FlatString */;
665 val* var72 /* : Array[Object] */;
666 long var73 /* : Int */;
667 val* var74 /* : NativeArray[Object] */;
668 val* var75 /* : String */;
669 long var76 /* : Int */;
670 val* var77 /* : ToolContext */;
671 val* var79 /* : ToolContext */;
672 short int var80 /* : Bool */;
673 short int var81 /* : Bool */;
674 val* var_other /* var other: nullable Object */;
675 short int var83 /* : Bool */;
676 short int var85 /* : Bool */;
677 long var86 /* : Int */;
678 long var88 /* : Int */;
679 long var_errcount /* var errcount: Int */;
680 long var89 /* : Int */;
681 long var91 /* : Int */;
682 short int var92 /* : Bool */;
683 short int var93 /* : Bool */;
684 short int var95 /* : Bool */;
685 short int var96 /* : Bool */;
686 long var98 /* : Int */;
687 long var100 /* : Int */;
688 val* var101 /* : ANodes[AClassdef] */;
689 val* var103 /* : ANodes[AClassdef] */;
690 val* var_104 /* var : ANodes[AClassdef] */;
691 val* var105 /* : Iterator[ANode] */;
692 val* var_106 /* var : Iterator[AClassdef] */;
693 short int var107 /* : Bool */;
694 val* var108 /* : nullable Object */;
695 val* var_nclassdef /* var nclassdef: AClassdef */;
696 val* var109 /* : ToolContext */;
697 val* var111 /* : ToolContext */;
698 short int var112 /* : Bool */;
699 short int var113 /* : Bool */;
700 short int var115 /* : Bool */;
701 short int var117 /* : Bool */;
702 val* var_nclassdef119 /* var nclassdef: AClassdef */;
703 val* var120 /* : ANodes[APropdef] */;
704 val* var122 /* : ANodes[APropdef] */;
705 val* var_123 /* var : ANodes[APropdef] */;
706 val* var124 /* : Iterator[ANode] */;
707 val* var_125 /* var : Iterator[APropdef] */;
708 short int var126 /* : Bool */;
709 val* var127 /* : nullable Object */;
710 val* var_npropdef /* var npropdef: APropdef */;
711 val* var128 /* : ToolContext */;
712 val* var130 /* : ToolContext */;
713 short int var131 /* : Bool */;
714 short int var132 /* : Bool */;
715 short int var134 /* : Bool */;
716 short int var136 /* : Bool */;
717 long var141 /* : Int */;
718 long var143 /* : Int */;
719 short int var144 /* : Bool */;
720 short int var145 /* : Bool */;
721 short int var147 /* : Bool */;
722 short int var148 /* : Bool */;
723 val* var149 /* : Array[AAnnotation] */;
724 val* var151 /* : Array[AAnnotation] */;
725 val* var_152 /* var : Array[AAnnotation] */;
726 val* var153 /* : ArrayIterator[nullable Object] */;
727 val* var_154 /* var : ArrayIterator[AAnnotation] */;
728 short int var155 /* : Bool */;
729 val* var156 /* : nullable Object */;
730 val* var_na /* var na: AAnnotation */;
731 val* var157 /* : nullable ANode */;
732 val* var159 /* : nullable ANode */;
733 val* var160 /* : nullable ANode */;
734 val* var162 /* : nullable ANode */;
735 long var165 /* : Int */;
736 long var167 /* : Int */;
737 short int var168 /* : Bool */;
738 short int var169 /* : Bool */;
739 short int var171 /* : Bool */;
740 short int var172 /* : Bool */;
741 long var176 /* : Int */;
742 long var178 /* : Int for extern */;
743 long var_time1 /* var time1: Int */;
744 static val* varonce179;
745 val* var180 /* : String */;
746 char* var181 /* : NativeString */;
747 long var182 /* : Int */;
748 val* var183 /* : FlatString */;
749 long var184 /* : Int */;
750 short int var186 /* : Bool */;
751 int cltype;
752 int idtype;
753 const char* var_class_name;
754 long var187 /* : Int */;
755 static val* varonce188;
756 val* var189 /* : String */;
757 char* var190 /* : NativeString */;
758 long var191 /* : Int */;
759 val* var192 /* : FlatString */;
760 val* var193 /* : Array[Object] */;
761 long var194 /* : Int */;
762 val* var195 /* : NativeArray[Object] */;
763 val* var196 /* : Object */;
764 val* var197 /* : String */;
765 long var198 /* : Int */;
766 var_nmodules = p0;
767 {
768 { /* Inline time#Object#get_time (self) on <self:ToolContext> */
769 var2 = kernel_Any_Any_get_time_0(self);
770 var = var2;
771 goto RET_LABEL1;
772 RET_LABEL1:(void)0;
773 }
774 }
775 var_time0 = var;
776 if (varonce) {
777 var3 = varonce;
778 } else {
779 var4 = "*** SEMANTIC ANALYSIS ***";
780 var5 = 25;
781 var6 = string__NativeString__to_s_with_length(var4, var5);
782 var3 = var6;
783 varonce = var3;
784 }
785 var7 = 1;
786 {
787 toolcontext__ToolContext__info(self, var3, var7); /* Direct call toolcontext#ToolContext#info on <self:ToolContext>*/
788 }
789 {
790 var8 = phase__ToolContext__phases_list(self);
791 }
792 var_phases = var8;
793 var_ = var_phases;
794 {
795 var9 = ((val* (*)(val*))(var_->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_) /* iterator on <var_:Sequence[Phase]>*/;
796 }
797 var_10 = var9;
798 for(;;) {
799 {
800 var11 = ((short int (*)(val*))(var_10->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_10) /* is_ok on <var_10:IndexedIterator[Phase]>*/;
801 }
802 if (var11){
803 {
804 var12 = ((val* (*)(val*))(var_10->class->vft[COLOR_abstract_collection__Iterator__item]))(var_10) /* item on <var_10:IndexedIterator[Phase]>*/;
805 }
806 var_phase = var12;
807 if (varonce13) {
808 var14 = varonce13;
809 } else {
810 var15 = " registered phases: ";
811 var16 = 20;
812 var17 = string__NativeString__to_s_with_length(var15, var16);
813 var14 = var17;
814 varonce13 = var14;
815 }
816 var18 = NEW_array__Array(&type_array__Arraykernel__Object);
817 { /* var18 = array_instance Array[Object] */
818 var19 = 2;
819 var20 = NEW_array__NativeArray(var19, &type_array__NativeArraykernel__Object);
820 ((struct instance_array__NativeArray*)var20)->values[0] = (val*) var14;
821 ((struct instance_array__NativeArray*)var20)->values[1] = (val*) var_phase;
822 {
823 ((void (*)(val*, val*, long))(var18->class->vft[COLOR_array__Array__with_native]))(var18, var20, var19) /* with_native on <var18:Array[Object]>*/;
824 }
825 }
826 {
827 var21 = ((val* (*)(val*))(var18->class->vft[COLOR_string__Object__to_s]))(var18) /* to_s on <var18:Array[Object]>*/;
828 }
829 var22 = 2;
830 {
831 toolcontext__ToolContext__info(self, var21, var22); /* Direct call toolcontext#ToolContext#info on <self:ToolContext>*/
832 }
833 {
834 ((void (*)(val*))(var_10->class->vft[COLOR_abstract_collection__Iterator__next]))(var_10) /* next on <var_10:IndexedIterator[Phase]>*/;
835 }
836 } else {
837 goto BREAK_label;
838 }
839 }
840 BREAK_label: (void)0;
841 {
842 { /* Inline abstract_collection#Iterator#finish (var_10) on <var_10:IndexedIterator[Phase]> */
843 RET_LABEL23:(void)0;
844 }
845 }
846 var_24 = var_nmodules;
847 {
848 var25 = ((val* (*)(val*))(var_24->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_24) /* iterator on <var_24:Collection[AModule]>*/;
849 }
850 var_26 = var25;
851 for(;;) {
852 {
853 var27 = ((short int (*)(val*))(var_26->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_26) /* is_ok on <var_26:Iterator[AModule]>*/;
854 }
855 if (var27){
856 {
857 var28 = ((val* (*)(val*))(var_26->class->vft[COLOR_abstract_collection__Iterator__item]))(var_26) /* item on <var_26:Iterator[AModule]>*/;
858 }
859 var_nmodule = var28;
860 {
861 { /* Inline phase#ToolContext#phased_modules (self) on <self:ToolContext> */
862 var31 = self->attrs[COLOR_phase__ToolContext___phased_modules].val; /* _phased_modules on <self:ToolContext> */
863 if (unlikely(var31 == NULL)) {
864 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phased_modules");
865 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 74);
866 show_backtrace(1);
867 }
868 var29 = var31;
869 RET_LABEL30:(void)0;
870 }
871 }
872 {
873 var32 = hash_collection__HashSet__has(var29, var_nmodule);
874 }
875 if (var32){
876 goto BREAK_label33;
877 } else {
878 }
879 {
880 { /* Inline phase#ToolContext#phased_modules (self) on <self:ToolContext> */
881 var36 = self->attrs[COLOR_phase__ToolContext___phased_modules].val; /* _phased_modules on <self:ToolContext> */
882 if (unlikely(var36 == NULL)) {
883 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phased_modules");
884 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 74);
885 show_backtrace(1);
886 }
887 var34 = var36;
888 RET_LABEL35:(void)0;
889 }
890 }
891 {
892 hash_collection__HashSet__add(var34, var_nmodule); /* Direct call hash_collection#HashSet#add on <var34:HashSet[AModule]>*/
893 }
894 if (varonce37) {
895 var38 = varonce37;
896 } else {
897 var39 = "Semantic analysis module ";
898 var40 = 25;
899 var41 = string__NativeString__to_s_with_length(var39, var40);
900 var38 = var41;
901 varonce37 = var38;
902 }
903 {
904 { /* Inline parser_nodes#ANode#location (var_nmodule) on <var_nmodule:AModule> */
905 var44 = var_nmodule->attrs[COLOR_parser_nodes__ANode___location].val; /* _location on <var_nmodule:AModule> */
906 if (unlikely(var44 == NULL)) {
907 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _location");
908 PRINT_ERROR(" (%s:%d)\n", "parser/parser_nodes.nit", 23);
909 show_backtrace(1);
910 }
911 var42 = var44;
912 RET_LABEL43:(void)0;
913 }
914 }
915 {
916 { /* Inline location#Location#file (var42) on <var42:Location> */
917 var47 = var42->attrs[COLOR_location__Location___file].val; /* _file on <var42:Location> */
918 var45 = var47;
919 RET_LABEL46:(void)0;
920 }
921 }
922 if (var45 == NULL) {
923 PRINT_ERROR("Runtime error: %s", "Receiver is null");
924 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 94);
925 show_backtrace(1);
926 } else {
927 { /* Inline location#SourceFile#filename (var45) on <var45:nullable SourceFile> */
928 if (unlikely(var45 == NULL)) {
929 PRINT_ERROR("Runtime error: %s", "Receiver is null");
930 PRINT_ERROR(" (%s:%d)\n", "location.nit", 22);
931 show_backtrace(1);
932 }
933 var50 = var45->attrs[COLOR_location__SourceFile___filename].val; /* _filename on <var45:nullable SourceFile> */
934 if (unlikely(var50 == NULL)) {
935 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _filename");
936 PRINT_ERROR(" (%s:%d)\n", "location.nit", 22);
937 show_backtrace(1);
938 }
939 var48 = var50;
940 RET_LABEL49:(void)0;
941 }
942 }
943 var51 = NEW_array__Array(&type_array__Arraykernel__Object);
944 { /* var51 = array_instance Array[Object] */
945 var52 = 2;
946 var53 = NEW_array__NativeArray(var52, &type_array__NativeArraykernel__Object);
947 ((struct instance_array__NativeArray*)var53)->values[0] = (val*) var38;
948 ((struct instance_array__NativeArray*)var53)->values[1] = (val*) var48;
949 {
950 ((void (*)(val*, val*, long))(var51->class->vft[COLOR_array__Array__with_native]))(var51, var53, var52) /* with_native on <var51:Array[Object]>*/;
951 }
952 }
953 {
954 var54 = ((val* (*)(val*))(var51->class->vft[COLOR_string__Object__to_s]))(var51) /* to_s on <var51:Array[Object]>*/;
955 }
956 var55 = 2;
957 {
958 toolcontext__ToolContext__info(self, var54, var55); /* Direct call toolcontext#ToolContext#info on <self:ToolContext>*/
959 }
960 var56 = NEW_phase__AnnotationPhaseVisitor(&type_phase__AnnotationPhaseVisitor);
961 {
962 ((void (*)(val*))(var56->class->vft[COLOR_kernel__Object__init]))(var56) /* init on <var56:AnnotationPhaseVisitor>*/;
963 }
964 var_vannot = var56;
965 {
966 parser_nodes__Visitor__enter_visit(var_vannot, var_nmodule); /* Direct call parser_nodes#Visitor#enter_visit on <var_vannot:AnnotationPhaseVisitor>*/
967 }
968 var_57 = var_phases;
969 {
970 var58 = ((val* (*)(val*))(var_57->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_57) /* iterator on <var_57:Sequence[Phase]>*/;
971 }
972 var_59 = var58;
973 for(;;) {
974 {
975 var60 = ((short int (*)(val*))(var_59->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_59) /* is_ok on <var_59:IndexedIterator[Phase]>*/;
976 }
977 if (var60){
978 {
979 var61 = ((val* (*)(val*))(var_59->class->vft[COLOR_abstract_collection__Iterator__item]))(var_59) /* item on <var_59:IndexedIterator[Phase]>*/;
980 }
981 var_phase62 = var61;
982 {
983 { /* Inline phase#Phase#disabled (var_phase62) on <var_phase62:Phase> */
984 var65 = var_phase62->attrs[COLOR_phase__Phase___disabled].s; /* _disabled on <var_phase62:Phase> */
985 var63 = var65;
986 RET_LABEL64:(void)0;
987 }
988 }
989 if (var63){
990 goto BREAK_label66;
991 } else {
992 }
993 if (varonce67) {
994 var68 = varonce67;
995 } else {
996 var69 = " phase: ";
997 var70 = 8;
998 var71 = string__NativeString__to_s_with_length(var69, var70);
999 var68 = var71;
1000 varonce67 = var68;
1001 }
1002 var72 = NEW_array__Array(&type_array__Arraykernel__Object);
1003 { /* var72 = array_instance Array[Object] */
1004 var73 = 2;
1005 var74 = NEW_array__NativeArray(var73, &type_array__NativeArraykernel__Object);
1006 ((struct instance_array__NativeArray*)var74)->values[0] = (val*) var68;
1007 ((struct instance_array__NativeArray*)var74)->values[1] = (val*) var_phase62;
1008 {
1009 ((void (*)(val*, val*, long))(var72->class->vft[COLOR_array__Array__with_native]))(var72, var74, var73) /* with_native on <var72:Array[Object]>*/;
1010 }
1011 }
1012 {
1013 var75 = ((val* (*)(val*))(var72->class->vft[COLOR_string__Object__to_s]))(var72) /* to_s on <var72:Array[Object]>*/;
1014 }
1015 var76 = 3;
1016 {
1017 toolcontext__ToolContext__info(self, var75, var76); /* Direct call toolcontext#ToolContext#info on <self:ToolContext>*/
1018 }
1019 {
1020 { /* Inline phase#Phase#toolcontext (var_phase62) on <var_phase62:Phase> */
1021 var79 = var_phase62->attrs[COLOR_phase__Phase___toolcontext].val; /* _toolcontext on <var_phase62:Phase> */
1022 if (unlikely(var79 == NULL)) {
1023 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
1024 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 162);
1025 show_backtrace(1);
1026 }
1027 var77 = var79;
1028 RET_LABEL78:(void)0;
1029 }
1030 }
1031 {
1032 { /* Inline kernel#Object#== (var77,self) on <var77:ToolContext> */
1033 var_other = self;
1034 {
1035 { /* Inline kernel#Object#is_same_instance (var77,var_other) on <var77:ToolContext> */
1036 var85 = var77 == var_other;
1037 var83 = var85;
1038 goto RET_LABEL84;
1039 RET_LABEL84:(void)0;
1040 }
1041 }
1042 var81 = var83;
1043 goto RET_LABEL82;
1044 RET_LABEL82:(void)0;
1045 }
1046 var80 = var81;
1047 }
1048 if (unlikely(!var80)) {
1049 PRINT_ERROR("Runtime error: %s", "Assert failed");
1050 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 102);
1051 show_backtrace(1);
1052 }
1053 {
1054 { /* Inline toolcontext#ToolContext#error_count (self) on <self:ToolContext> */
1055 var88 = self->attrs[COLOR_toolcontext__ToolContext___error_count].l; /* _error_count on <self:ToolContext> */
1056 var86 = var88;
1057 RET_LABEL87:(void)0;
1058 }
1059 }
1060 var_errcount = var86;
1061 {
1062 ((void (*)(val*, val*))(var_phase62->class->vft[COLOR_phase__Phase__process_nmodule]))(var_phase62, var_nmodule) /* process_nmodule on <var_phase62:Phase>*/;
1063 }
1064 {
1065 { /* Inline toolcontext#ToolContext#error_count (self) on <self:ToolContext> */
1066 var91 = self->attrs[COLOR_toolcontext__ToolContext___error_count].l; /* _error_count on <self:ToolContext> */
1067 var89 = var91;
1068 RET_LABEL90:(void)0;
1069 }
1070 }
1071 {
1072 { /* Inline kernel#Int#!= (var_errcount,var89) on <var_errcount:Int> */
1073 var95 = var_errcount == var89;
1074 var96 = !var95;
1075 var93 = var96;
1076 goto RET_LABEL94;
1077 RET_LABEL94:(void)0;
1078 }
1079 var92 = var93;
1080 }
1081 if (var92){
1082 {
1083 toolcontext__ToolContext__check_errors(self); /* Direct call toolcontext#ToolContext#check_errors on <self:ToolContext>*/
1084 }
1085 goto BREAK_label97;
1086 } else {
1087 }
1088 {
1089 { /* Inline toolcontext#ToolContext#error_count (self) on <self:ToolContext> */
1090 var100 = self->attrs[COLOR_toolcontext__ToolContext___error_count].l; /* _error_count on <self:ToolContext> */
1091 var98 = var100;
1092 RET_LABEL99:(void)0;
1093 }
1094 }
1095 var_errcount = var98;
1096 {
1097 { /* Inline parser_nodes#AModule#n_classdefs (var_nmodule) on <var_nmodule:AModule> */
1098 var103 = var_nmodule->attrs[COLOR_parser_nodes__AModule___n_classdefs].val; /* _n_classdefs on <var_nmodule:AModule> */
1099 if (unlikely(var103 == NULL)) {
1100 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _n_classdefs");
1101 PRINT_ERROR(" (%s:%d)\n", "parser/parser_nodes.nit", 859);
1102 show_backtrace(1);
1103 }
1104 var101 = var103;
1105 RET_LABEL102:(void)0;
1106 }
1107 }
1108 var_104 = var101;
1109 {
1110 var105 = parser_nodes__ANodes__iterator(var_104);
1111 }
1112 var_106 = var105;
1113 for(;;) {
1114 {
1115 var107 = ((short int (*)(val*))(var_106->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_106) /* is_ok on <var_106:Iterator[AClassdef]>*/;
1116 }
1117 if (var107){
1118 {
1119 var108 = ((val* (*)(val*))(var_106->class->vft[COLOR_abstract_collection__Iterator__item]))(var_106) /* item on <var_106:Iterator[AClassdef]>*/;
1120 }
1121 var_nclassdef = var108;
1122 {
1123 { /* Inline phase#Phase#toolcontext (var_phase62) on <var_phase62:Phase> */
1124 var111 = var_phase62->attrs[COLOR_phase__Phase___toolcontext].val; /* _toolcontext on <var_phase62:Phase> */
1125 if (unlikely(var111 == NULL)) {
1126 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
1127 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 162);
1128 show_backtrace(1);
1129 }
1130 var109 = var111;
1131 RET_LABEL110:(void)0;
1132 }
1133 }
1134 {
1135 { /* Inline kernel#Object#== (var109,self) on <var109:ToolContext> */
1136 var_other = self;
1137 {
1138 { /* Inline kernel#Object#is_same_instance (var109,var_other) on <var109:ToolContext> */
1139 var117 = var109 == var_other;
1140 var115 = var117;
1141 goto RET_LABEL116;
1142 RET_LABEL116:(void)0;
1143 }
1144 }
1145 var113 = var115;
1146 goto RET_LABEL114;
1147 RET_LABEL114:(void)0;
1148 }
1149 var112 = var113;
1150 }
1151 if (unlikely(!var112)) {
1152 PRINT_ERROR("Runtime error: %s", "Assert failed");
1153 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 111);
1154 show_backtrace(1);
1155 }
1156 {
1157 { /* Inline phase#Phase#process_nclassdef (var_phase62,var_nclassdef) on <var_phase62:Phase> */
1158 var_nclassdef119 = var_nclassdef;
1159 RET_LABEL118:(void)0;
1160 }
1161 }
1162 {
1163 { /* Inline parser_nodes#AClassdef#n_propdefs (var_nclassdef) on <var_nclassdef:AClassdef> */
1164 var122 = var_nclassdef->attrs[COLOR_parser_nodes__AClassdef___n_propdefs].val; /* _n_propdefs on <var_nclassdef:AClassdef> */
1165 if (unlikely(var122 == NULL)) {
1166 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _n_propdefs");
1167 PRINT_ERROR(" (%s:%d)\n", "parser/parser_nodes.nit", 929);
1168 show_backtrace(1);
1169 }
1170 var120 = var122;
1171 RET_LABEL121:(void)0;
1172 }
1173 }
1174 var_123 = var120;
1175 {
1176 var124 = parser_nodes__ANodes__iterator(var_123);
1177 }
1178 var_125 = var124;
1179 for(;;) {
1180 {
1181 var126 = ((short int (*)(val*))(var_125->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_125) /* is_ok on <var_125:Iterator[APropdef]>*/;
1182 }
1183 if (var126){
1184 {
1185 var127 = ((val* (*)(val*))(var_125->class->vft[COLOR_abstract_collection__Iterator__item]))(var_125) /* item on <var_125:Iterator[APropdef]>*/;
1186 }
1187 var_npropdef = var127;
1188 {
1189 { /* Inline phase#Phase#toolcontext (var_phase62) on <var_phase62:Phase> */
1190 var130 = var_phase62->attrs[COLOR_phase__Phase___toolcontext].val; /* _toolcontext on <var_phase62:Phase> */
1191 if (unlikely(var130 == NULL)) {
1192 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
1193 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 162);
1194 show_backtrace(1);
1195 }
1196 var128 = var130;
1197 RET_LABEL129:(void)0;
1198 }
1199 }
1200 {
1201 { /* Inline kernel#Object#== (var128,self) on <var128:ToolContext> */
1202 var_other = self;
1203 {
1204 { /* Inline kernel#Object#is_same_instance (var128,var_other) on <var128:ToolContext> */
1205 var136 = var128 == var_other;
1206 var134 = var136;
1207 goto RET_LABEL135;
1208 RET_LABEL135:(void)0;
1209 }
1210 }
1211 var132 = var134;
1212 goto RET_LABEL133;
1213 RET_LABEL133:(void)0;
1214 }
1215 var131 = var132;
1216 }
1217 if (unlikely(!var131)) {
1218 PRINT_ERROR("Runtime error: %s", "Assert failed");
1219 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 114);
1220 show_backtrace(1);
1221 }
1222 {
1223 phase__ToolContext__phase_process_npropdef(self, var_phase62, var_npropdef); /* Direct call phase#ToolContext#phase_process_npropdef on <self:ToolContext>*/
1224 }
1225 {
1226 ((void (*)(val*))(var_125->class->vft[COLOR_abstract_collection__Iterator__next]))(var_125) /* next on <var_125:Iterator[APropdef]>*/;
1227 }
1228 } else {
1229 goto BREAK_label137;
1230 }
1231 }
1232 BREAK_label137: (void)0;
1233 {
1234 { /* Inline abstract_collection#Iterator#finish (var_125) on <var_125:Iterator[APropdef]> */
1235 RET_LABEL138:(void)0;
1236 }
1237 }
1238 {
1239 ((void (*)(val*))(var_106->class->vft[COLOR_abstract_collection__Iterator__next]))(var_106) /* next on <var_106:Iterator[AClassdef]>*/;
1240 }
1241 } else {
1242 goto BREAK_label139;
1243 }
1244 }
1245 BREAK_label139: (void)0;
1246 {
1247 { /* Inline abstract_collection#Iterator#finish (var_106) on <var_106:Iterator[AClassdef]> */
1248 RET_LABEL140:(void)0;
1249 }
1250 }
1251 {
1252 { /* Inline toolcontext#ToolContext#error_count (self) on <self:ToolContext> */
1253 var143 = self->attrs[COLOR_toolcontext__ToolContext___error_count].l; /* _error_count on <self:ToolContext> */
1254 var141 = var143;
1255 RET_LABEL142:(void)0;
1256 }
1257 }
1258 {
1259 { /* Inline kernel#Int#!= (var_errcount,var141) on <var_errcount:Int> */
1260 var147 = var_errcount == var141;
1261 var148 = !var147;
1262 var145 = var148;
1263 goto RET_LABEL146;
1264 RET_LABEL146:(void)0;
1265 }
1266 var144 = var145;
1267 }
1268 if (var144){
1269 {
1270 toolcontext__ToolContext__check_errors(self); /* Direct call toolcontext#ToolContext#check_errors on <self:ToolContext>*/
1271 }
1272 goto BREAK_label97;
1273 } else {
1274 }
1275 {
1276 { /* Inline phase#AnnotationPhaseVisitor#annotations (var_vannot) on <var_vannot:AnnotationPhaseVisitor> */
1277 var151 = var_vannot->attrs[COLOR_phase__AnnotationPhaseVisitor___annotations].val; /* _annotations on <var_vannot:AnnotationPhaseVisitor> */
1278 if (unlikely(var151 == NULL)) {
1279 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _annotations");
1280 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 149);
1281 show_backtrace(1);
1282 }
1283 var149 = var151;
1284 RET_LABEL150:(void)0;
1285 }
1286 }
1287 var_152 = var149;
1288 {
1289 var153 = array__AbstractArrayRead__iterator(var_152);
1290 }
1291 var_154 = var153;
1292 for(;;) {
1293 {
1294 var155 = array__ArrayIterator__is_ok(var_154);
1295 }
1296 if (var155){
1297 {
1298 var156 = array__ArrayIterator__item(var_154);
1299 }
1300 var_na = var156;
1301 {
1302 { /* Inline parser_nodes#ANode#parent (var_na) on <var_na:AAnnotation> */
1303 var159 = var_na->attrs[COLOR_parser_nodes__ANode___parent].val; /* _parent on <var_na:AAnnotation> */
1304 var157 = var159;
1305 RET_LABEL158:(void)0;
1306 }
1307 }
1308 if (var157 == NULL) {
1309 PRINT_ERROR("Runtime error: %s", "Receiver is null");
1310 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 123);
1311 show_backtrace(1);
1312 } else {
1313 { /* Inline parser_nodes#ANode#parent (var157) on <var157:nullable ANode> */
1314 if (unlikely(var157 == NULL)) {
1315 PRINT_ERROR("Runtime error: %s", "Receiver is null");
1316 PRINT_ERROR(" (%s:%d)\n", "parser/parser_nodes.nit", 36);
1317 show_backtrace(1);
1318 }
1319 var162 = var157->attrs[COLOR_parser_nodes__ANode___parent].val; /* _parent on <var157:nullable ANode> */
1320 var160 = var162;
1321 RET_LABEL161:(void)0;
1322 }
1323 }
1324 if (unlikely(var160 == NULL)) {
1325 PRINT_ERROR("Runtime error: %s", "Cast failed");
1326 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 123);
1327 show_backtrace(1);
1328 }
1329 {
1330 ((void (*)(val*, val*, val*))(var_phase62->class->vft[COLOR_phase__Phase__process_annotated_node]))(var_phase62, var160, var_na) /* process_annotated_node on <var_phase62:Phase>*/;
1331 }
1332 {
1333 array__ArrayIterator__next(var_154); /* Direct call array#ArrayIterator#next on <var_154:ArrayIterator[AAnnotation]>*/
1334 }
1335 } else {
1336 goto BREAK_label163;
1337 }
1338 }
1339 BREAK_label163: (void)0;
1340 {
1341 { /* Inline abstract_collection#Iterator#finish (var_154) on <var_154:ArrayIterator[AAnnotation]> */
1342 RET_LABEL164:(void)0;
1343 }
1344 }
1345 {
1346 { /* Inline toolcontext#ToolContext#error_count (self) on <self:ToolContext> */
1347 var167 = self->attrs[COLOR_toolcontext__ToolContext___error_count].l; /* _error_count on <self:ToolContext> */
1348 var165 = var167;
1349 RET_LABEL166:(void)0;
1350 }
1351 }
1352 {
1353 { /* Inline kernel#Int#!= (var_errcount,var165) on <var_errcount:Int> */
1354 var171 = var_errcount == var165;
1355 var172 = !var171;
1356 var169 = var172;
1357 goto RET_LABEL170;
1358 RET_LABEL170:(void)0;
1359 }
1360 var168 = var169;
1361 }
1362 if (var168){
1363 {
1364 toolcontext__ToolContext__check_errors(self); /* Direct call toolcontext#ToolContext#check_errors on <self:ToolContext>*/
1365 }
1366 goto BREAK_label97;
1367 } else {
1368 }
1369 BREAK_label66: (void)0;
1370 {
1371 ((void (*)(val*))(var_59->class->vft[COLOR_abstract_collection__Iterator__next]))(var_59) /* next on <var_59:IndexedIterator[Phase]>*/;
1372 }
1373 } else {
1374 goto BREAK_label97;
1375 }
1376 }
1377 BREAK_label97: (void)0;
1378 {
1379 { /* Inline abstract_collection#Iterator#finish (var_59) on <var_59:IndexedIterator[Phase]> */
1380 RET_LABEL173:(void)0;
1381 }
1382 }
1383 {
1384 toolcontext__ToolContext__check_errors(self); /* Direct call toolcontext#ToolContext#check_errors on <self:ToolContext>*/
1385 }
1386 BREAK_label33: (void)0;
1387 {
1388 ((void (*)(val*))(var_26->class->vft[COLOR_abstract_collection__Iterator__next]))(var_26) /* next on <var_26:Iterator[AModule]>*/;
1389 }
1390 } else {
1391 goto BREAK_label174;
1392 }
1393 }
1394 BREAK_label174: (void)0;
1395 {
1396 { /* Inline abstract_collection#Iterator#finish (var_26) on <var_26:Iterator[AModule]> */
1397 RET_LABEL175:(void)0;
1398 }
1399 }
1400 {
1401 { /* Inline time#Object#get_time (self) on <self:ToolContext> */
1402 var178 = kernel_Any_Any_get_time_0(self);
1403 var176 = var178;
1404 goto RET_LABEL177;
1405 RET_LABEL177:(void)0;
1406 }
1407 }
1408 var_time1 = var176;
1409 if (varonce179) {
1410 var180 = varonce179;
1411 } else {
1412 var181 = "*** END SEMANTIC ANALYSIS: ";
1413 var182 = 27;
1414 var183 = string__NativeString__to_s_with_length(var181, var182);
1415 var180 = var183;
1416 varonce179 = var180;
1417 }
1418 {
1419 { /* Inline kernel#Int#- (var_time1,var_time0) on <var_time1:Int> */
1420 /* Covariant cast for argument 0 (i) <var_time0:Int> isa OTHER */
1421 /* <var_time0:Int> isa OTHER */
1422 var186 = 1; /* easy <var_time0:Int> isa OTHER*/
1423 if (unlikely(!var186)) {
1424 var_class_name = type_kernel__Int.name;
1425 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
1426 PRINT_ERROR(" (%s:%d)\n", "../lib/standard/kernel.nit", 377);
1427 show_backtrace(1);
1428 }
1429 var187 = var_time1 - var_time0;
1430 var184 = var187;
1431 goto RET_LABEL185;
1432 RET_LABEL185:(void)0;
1433 }
1434 }
1435 if (varonce188) {
1436 var189 = varonce188;
1437 } else {
1438 var190 = " ***";
1439 var191 = 4;
1440 var192 = string__NativeString__to_s_with_length(var190, var191);
1441 var189 = var192;
1442 varonce188 = var189;
1443 }
1444 var193 = NEW_array__Array(&type_array__Arraykernel__Object);
1445 { /* var193 = array_instance Array[Object] */
1446 var194 = 3;
1447 var195 = NEW_array__NativeArray(var194, &type_array__NativeArraykernel__Object);
1448 ((struct instance_array__NativeArray*)var195)->values[0] = (val*) var180;
1449 var196 = BOX_kernel__Int(var184); /* autobox from Int to Object */
1450 ((struct instance_array__NativeArray*)var195)->values[1] = (val*) var196;
1451 ((struct instance_array__NativeArray*)var195)->values[2] = (val*) var189;
1452 {
1453 ((void (*)(val*, val*, long))(var193->class->vft[COLOR_array__Array__with_native]))(var193, var195, var194) /* with_native on <var193:Array[Object]>*/;
1454 }
1455 }
1456 {
1457 var197 = ((val* (*)(val*))(var193->class->vft[COLOR_string__Object__to_s]))(var193) /* to_s on <var193:Array[Object]>*/;
1458 }
1459 var198 = 2;
1460 {
1461 toolcontext__ToolContext__info(self, var197, var198); /* Direct call toolcontext#ToolContext#info on <self:ToolContext>*/
1462 }
1463 {
1464 toolcontext__ToolContext__errors_info(self); /* Direct call toolcontext#ToolContext#errors_info on <self:ToolContext>*/
1465 }
1466 RET_LABEL:;
1467 }
1468 /* method phase#ToolContext#run_phases for (self: Object, Collection[AModule]) */
1469 void VIRTUAL_phase__ToolContext__run_phases(val* self, val* p0) {
1470 phase__ToolContext__run_phases(self, p0); /* Direct call phase#ToolContext#run_phases on <self:Object(ToolContext)>*/
1471 RET_LABEL:;
1472 }
1473 /* method phase#ToolContext#phase_process_npropdef for (self: ToolContext, Phase, APropdef) */
1474 void phase__ToolContext__phase_process_npropdef(val* self, val* p0, val* p1) {
1475 val* var_phase /* var phase: Phase */;
1476 val* var_npropdef /* var npropdef: APropdef */;
1477 var_phase = p0;
1478 var_npropdef = p1;
1479 {
1480 ((void (*)(val*, val*))(var_phase->class->vft[COLOR_phase__Phase__process_npropdef]))(var_phase, var_npropdef) /* process_npropdef on <var_phase:Phase>*/;
1481 }
1482 RET_LABEL:;
1483 }
1484 /* method phase#ToolContext#phase_process_npropdef for (self: Object, Phase, APropdef) */
1485 void VIRTUAL_phase__ToolContext__phase_process_npropdef(val* self, val* p0, val* p1) {
1486 phase__ToolContext__phase_process_npropdef(self, p0, p1); /* Direct call phase#ToolContext#phase_process_npropdef on <self:Object(ToolContext)>*/
1487 RET_LABEL:;
1488 }
1489 /* method phase#AnnotationPhaseVisitor#annotations for (self: AnnotationPhaseVisitor): Array[AAnnotation] */
1490 val* phase__AnnotationPhaseVisitor__annotations(val* self) {
1491 val* var /* : Array[AAnnotation] */;
1492 val* var1 /* : Array[AAnnotation] */;
1493 var1 = self->attrs[COLOR_phase__AnnotationPhaseVisitor___annotations].val; /* _annotations on <self:AnnotationPhaseVisitor> */
1494 if (unlikely(var1 == NULL)) {
1495 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _annotations");
1496 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 149);
1497 show_backtrace(1);
1498 }
1499 var = var1;
1500 RET_LABEL:;
1501 return var;
1502 }
1503 /* method phase#AnnotationPhaseVisitor#annotations for (self: Object): Array[AAnnotation] */
1504 val* VIRTUAL_phase__AnnotationPhaseVisitor__annotations(val* self) {
1505 val* var /* : Array[AAnnotation] */;
1506 val* var1 /* : Array[AAnnotation] */;
1507 val* var3 /* : Array[AAnnotation] */;
1508 { /* Inline phase#AnnotationPhaseVisitor#annotations (self) on <self:Object(AnnotationPhaseVisitor)> */
1509 var3 = self->attrs[COLOR_phase__AnnotationPhaseVisitor___annotations].val; /* _annotations on <self:Object(AnnotationPhaseVisitor)> */
1510 if (unlikely(var3 == NULL)) {
1511 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _annotations");
1512 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 149);
1513 show_backtrace(1);
1514 }
1515 var1 = var3;
1516 RET_LABEL2:(void)0;
1517 }
1518 var = var1;
1519 RET_LABEL:;
1520 return var;
1521 }
1522 /* method phase#AnnotationPhaseVisitor#visit for (self: AnnotationPhaseVisitor, ANode) */
1523 void phase__AnnotationPhaseVisitor__visit(val* self, val* p0) {
1524 val* var_n /* var n: ANode */;
1525 short int var /* : Bool */;
1526 int cltype;
1527 int idtype;
1528 val* var1 /* : Array[AAnnotation] */;
1529 val* var3 /* : Array[AAnnotation] */;
1530 var_n = p0;
1531 {
1532 ((void (*)(val*, val*))(var_n->class->vft[COLOR_parser_nodes__ANode__visit_all]))(var_n, self) /* visit_all on <var_n:ANode>*/;
1533 }
1534 /* <var_n:ANode> isa AAnnotation */
1535 cltype = type_parser_nodes__AAnnotation.color;
1536 idtype = type_parser_nodes__AAnnotation.id;
1537 if(cltype >= var_n->type->table_size) {
1538 var = 0;
1539 } else {
1540 var = var_n->type->type_table[cltype] == idtype;
1541 }
1542 if (var){
1543 {
1544 { /* Inline phase#AnnotationPhaseVisitor#annotations (self) on <self:AnnotationPhaseVisitor> */
1545 var3 = self->attrs[COLOR_phase__AnnotationPhaseVisitor___annotations].val; /* _annotations on <self:AnnotationPhaseVisitor> */
1546 if (unlikely(var3 == NULL)) {
1547 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _annotations");
1548 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 149);
1549 show_backtrace(1);
1550 }
1551 var1 = var3;
1552 RET_LABEL2:(void)0;
1553 }
1554 }
1555 {
1556 array__Array__add(var1, var_n); /* Direct call array#Array#add on <var1:Array[AAnnotation]>*/
1557 }
1558 } else {
1559 }
1560 RET_LABEL:;
1561 }
1562 /* method phase#AnnotationPhaseVisitor#visit for (self: Object, ANode) */
1563 void VIRTUAL_phase__AnnotationPhaseVisitor__visit(val* self, val* p0) {
1564 phase__AnnotationPhaseVisitor__visit(self, p0); /* Direct call phase#AnnotationPhaseVisitor#visit on <self:Object(AnnotationPhaseVisitor)>*/
1565 RET_LABEL:;
1566 }
1567 /* method phase#Phase#toolcontext for (self: Phase): ToolContext */
1568 val* phase__Phase__toolcontext(val* self) {
1569 val* var /* : ToolContext */;
1570 val* var1 /* : ToolContext */;
1571 var1 = self->attrs[COLOR_phase__Phase___toolcontext].val; /* _toolcontext on <self:Phase> */
1572 if (unlikely(var1 == NULL)) {
1573 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
1574 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 162);
1575 show_backtrace(1);
1576 }
1577 var = var1;
1578 RET_LABEL:;
1579 return var;
1580 }
1581 /* method phase#Phase#toolcontext for (self: Object): ToolContext */
1582 val* VIRTUAL_phase__Phase__toolcontext(val* self) {
1583 val* var /* : ToolContext */;
1584 val* var1 /* : ToolContext */;
1585 val* var3 /* : ToolContext */;
1586 { /* Inline phase#Phase#toolcontext (self) on <self:Object(Phase)> */
1587 var3 = self->attrs[COLOR_phase__Phase___toolcontext].val; /* _toolcontext on <self:Object(Phase)> */
1588 if (unlikely(var3 == NULL)) {
1589 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
1590 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 162);
1591 show_backtrace(1);
1592 }
1593 var1 = var3;
1594 RET_LABEL2:(void)0;
1595 }
1596 var = var1;
1597 RET_LABEL:;
1598 return var;
1599 }
1600 /* method phase#Phase#toolcontext= for (self: Phase, ToolContext) */
1601 void phase__Phase__toolcontext_61d(val* self, val* p0) {
1602 self->attrs[COLOR_phase__Phase___toolcontext].val = p0; /* _toolcontext on <self:Phase> */
1603 RET_LABEL:;
1604 }
1605 /* method phase#Phase#toolcontext= for (self: Object, ToolContext) */
1606 void VIRTUAL_phase__Phase__toolcontext_61d(val* self, val* p0) {
1607 { /* Inline phase#Phase#toolcontext= (self,p0) on <self:Object(Phase)> */
1608 self->attrs[COLOR_phase__Phase___toolcontext].val = p0; /* _toolcontext on <self:Object(Phase)> */
1609 RET_LABEL1:(void)0;
1610 }
1611 RET_LABEL:;
1612 }
1613 /* method phase#Phase#in_hierarchy for (self: Phase): POSetElement[Phase] */
1614 val* phase__Phase__in_hierarchy(val* self) {
1615 val* var /* : POSetElement[Phase] */;
1616 val* var1 /* : POSetElement[Phase] */;
1617 var1 = self->attrs[COLOR_phase__Phase___in_hierarchy].val; /* _in_hierarchy on <self:Phase> */
1618 if (unlikely(var1 == NULL)) {
1619 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _in_hierarchy");
1620 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 165);
1621 show_backtrace(1);
1622 }
1623 var = var1;
1624 RET_LABEL:;
1625 return var;
1626 }
1627 /* method phase#Phase#in_hierarchy for (self: Object): POSetElement[Phase] */
1628 val* VIRTUAL_phase__Phase__in_hierarchy(val* self) {
1629 val* var /* : POSetElement[Phase] */;
1630 val* var1 /* : POSetElement[Phase] */;
1631 val* var3 /* : POSetElement[Phase] */;
1632 { /* Inline phase#Phase#in_hierarchy (self) on <self:Object(Phase)> */
1633 var3 = self->attrs[COLOR_phase__Phase___in_hierarchy].val; /* _in_hierarchy on <self:Object(Phase)> */
1634 if (unlikely(var3 == NULL)) {
1635 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _in_hierarchy");
1636 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 165);
1637 show_backtrace(1);
1638 }
1639 var1 = var3;
1640 RET_LABEL2:(void)0;
1641 }
1642 var = var1;
1643 RET_LABEL:;
1644 return var;
1645 }
1646 /* method phase#Phase#in_hierarchy= for (self: Phase, POSetElement[Phase]) */
1647 void phase__Phase__in_hierarchy_61d(val* self, val* p0) {
1648 self->attrs[COLOR_phase__Phase___in_hierarchy].val = p0; /* _in_hierarchy on <self:Phase> */
1649 RET_LABEL:;
1650 }
1651 /* method phase#Phase#in_hierarchy= for (self: Object, POSetElement[Phase]) */
1652 void VIRTUAL_phase__Phase__in_hierarchy_61d(val* self, val* p0) {
1653 { /* Inline phase#Phase#in_hierarchy= (self,p0) on <self:Object(Phase)> */
1654 self->attrs[COLOR_phase__Phase___in_hierarchy].val = p0; /* _in_hierarchy on <self:Object(Phase)> */
1655 RET_LABEL1:(void)0;
1656 }
1657 RET_LABEL:;
1658 }
1659 /* method phase#Phase#init for (self: Phase, ToolContext, nullable Collection[Phase]) */
1660 void phase__Phase__init(val* self, val* p0, val* p1) {
1661 val* var_toolcontext /* var toolcontext: ToolContext */;
1662 val* var_depends /* var depends: nullable Collection[Phase] */;
1663 val* var /* : POSet[Phase] */;
1664 val* var3 /* : POSet[Phase] */;
1665 val* var4 /* : POSetElement[Object] */;
1666 val* var6 /* : null */;
1667 short int var7 /* : Bool */;
1668 short int var8 /* : Bool */;
1669 val* var_other /* var other: nullable Object */;
1670 short int var10 /* : Bool */;
1671 short int var11 /* : Bool */;
1672 short int var12 /* : Bool */;
1673 val* var_ /* var : Collection[Phase] */;
1674 val* var13 /* : Iterator[nullable Object] */;
1675 val* var_14 /* var : Iterator[Phase] */;
1676 short int var15 /* : Bool */;
1677 val* var16 /* : nullable Object */;
1678 val* var_d /* var d: Phase */;
1679 val* var17 /* : POSet[Phase] */;
1680 val* var19 /* : POSet[Phase] */;
1681 var_toolcontext = p0;
1682 var_depends = p1;
1683 {
1684 { /* Inline phase#Phase#toolcontext= (self,var_toolcontext) on <self:Phase> */
1685 self->attrs[COLOR_phase__Phase___toolcontext].val = var_toolcontext; /* _toolcontext on <self:Phase> */
1686 RET_LABEL1:(void)0;
1687 }
1688 }
1689 {
1690 { /* Inline phase#ToolContext#phases (var_toolcontext) on <var_toolcontext:ToolContext> */
1691 var3 = var_toolcontext->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <var_toolcontext:ToolContext> */
1692 if (unlikely(var3 == NULL)) {
1693 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
1694 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
1695 show_backtrace(1);
1696 }
1697 var = var3;
1698 RET_LABEL2:(void)0;
1699 }
1700 }
1701 {
1702 var4 = poset__POSet__add_node(var, self);
1703 }
1704 {
1705 { /* Inline phase#Phase#in_hierarchy= (self,var4) on <self:Phase> */
1706 self->attrs[COLOR_phase__Phase___in_hierarchy].val = var4; /* _in_hierarchy on <self:Phase> */
1707 RET_LABEL5:(void)0;
1708 }
1709 }
1710 var6 = NULL;
1711 if (var_depends == NULL) {
1712 var7 = 0; /* is null */
1713 } else {
1714 var7 = 1; /* arg is null and recv is not */
1715 }
1716 if (0) {
1717 { /* Inline kernel#Object#!= (var_depends,var6) on <var_depends:nullable Collection[Phase]> */
1718 var_other = var6;
1719 {
1720 var11 = ((short int (*)(val*, val*))(var_depends->class->vft[COLOR_kernel__Object___61d_61d]))(var_depends, var_other) /* == on <var_depends:nullable Collection[Phase](Collection[Phase])>*/;
1721 var10 = var11;
1722 }
1723 var12 = !var10;
1724 var8 = var12;
1725 goto RET_LABEL9;
1726 RET_LABEL9:(void)0;
1727 }
1728 var7 = var8;
1729 }
1730 if (var7){
1731 var_ = var_depends;
1732 {
1733 var13 = ((val* (*)(val*))(var_->class->vft[COLOR_abstract_collection__Collection__iterator]))(var_) /* iterator on <var_:Collection[Phase]>*/;
1734 }
1735 var_14 = var13;
1736 for(;;) {
1737 {
1738 var15 = ((short int (*)(val*))(var_14->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(var_14) /* is_ok on <var_14:Iterator[Phase]>*/;
1739 }
1740 if (var15){
1741 {
1742 var16 = ((val* (*)(val*))(var_14->class->vft[COLOR_abstract_collection__Iterator__item]))(var_14) /* item on <var_14:Iterator[Phase]>*/;
1743 }
1744 var_d = var16;
1745 {
1746 { /* Inline phase#ToolContext#phases (var_toolcontext) on <var_toolcontext:ToolContext> */
1747 var19 = var_toolcontext->attrs[COLOR_phase__ToolContext___phases].val; /* _phases on <var_toolcontext:ToolContext> */
1748 if (unlikely(var19 == NULL)) {
1749 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _phases");
1750 PRINT_ERROR(" (%s:%d)\n", "phase.nit", 23);
1751 show_backtrace(1);
1752 }
1753 var17 = var19;
1754 RET_LABEL18:(void)0;
1755 }
1756 }
1757 {
1758 poset__POSet__add_edge(var17, self, var_d); /* Direct call poset#POSet#add_edge on <var17:POSet[Phase]>*/
1759 }
1760 {
1761 ((void (*)(val*))(var_14->class->vft[COLOR_abstract_collection__Iterator__next]))(var_14) /* next on <var_14:Iterator[Phase]>*/;
1762 }
1763 } else {
1764 goto BREAK_label;
1765 }
1766 }
1767 BREAK_label: (void)0;
1768 {
1769 { /* Inline abstract_collection#Iterator#finish (var_14) on <var_14:Iterator[Phase]> */
1770 RET_LABEL20:(void)0;
1771 }
1772 }
1773 } else {
1774 }
1775 RET_LABEL:;
1776 }
1777 /* method phase#Phase#init for (self: Object, ToolContext, nullable Collection[Phase]) */
1778 void VIRTUAL_phase__Phase__init(val* self, val* p0, val* p1) {
1779 phase__Phase__init(self, p0, p1); /* Direct call phase#Phase#init on <self:Object(Phase)>*/
1780 RET_LABEL:;
1781 }
1782 /* method phase#Phase#to_s for (self: Phase): String */
1783 val* phase__Phase__to_s(val* self) {
1784 val* var /* : String */;
1785 val* var1 /* : String */;
1786 static val* varonce;
1787 val* var2 /* : String */;
1788 char* var3 /* : NativeString */;
1789 long var4 /* : Int */;
1790 val* var5 /* : FlatString */;
1791 val* var6 /* : String */;
1792 val* var7 /* : String */;
1793 {
1794 var1 = string__Object__class_name(self);
1795 }
1796 if (varonce) {
1797 var2 = varonce;
1798 } else {
1799 var3 = "Phase";
1800 var4 = 5;
1801 var5 = string__NativeString__to_s_with_length(var3, var4);
1802 var2 = var5;
1803 varonce = var2;
1804 }
1805 {
1806 var6 = file__String__strip_extension(var1, var2);
1807 }
1808 {
1809 var7 = string__FlatString__to_lower(var6);
1810 }
1811 var = var7;
1812 goto RET_LABEL;
1813 RET_LABEL:;
1814 return var;
1815 }
1816 /* method phase#Phase#to_s for (self: Object): String */
1817 val* VIRTUAL_phase__Phase__to_s(val* self) {
1818 val* var /* : String */;
1819 val* var1 /* : String */;
1820 var1 = phase__Phase__to_s(self);
1821 var = var1;
1822 RET_LABEL:;
1823 return var;
1824 }
1825 /* method phase#Phase#disabled for (self: Phase): Bool */
1826 short int phase__Phase__disabled(val* self) {
1827 short int var /* : Bool */;
1828 short int var1 /* : Bool */;
1829 var1 = self->attrs[COLOR_phase__Phase___disabled].s; /* _disabled on <self:Phase> */
1830 var = var1;
1831 RET_LABEL:;
1832 return var;
1833 }
1834 /* method phase#Phase#disabled for (self: Object): Bool */
1835 short int VIRTUAL_phase__Phase__disabled(val* self) {
1836 short int var /* : Bool */;
1837 short int var1 /* : Bool */;
1838 short int var3 /* : Bool */;
1839 { /* Inline phase#Phase#disabled (self) on <self:Object(Phase)> */
1840 var3 = self->attrs[COLOR_phase__Phase___disabled].s; /* _disabled on <self:Object(Phase)> */
1841 var1 = var3;
1842 RET_LABEL2:(void)0;
1843 }
1844 var = var1;
1845 RET_LABEL:;
1846 return var;
1847 }
1848 /* method phase#Phase#disabled= for (self: Phase, Bool) */
1849 void phase__Phase__disabled_61d(val* self, short int p0) {
1850 self->attrs[COLOR_phase__Phase___disabled].s = p0; /* _disabled on <self:Phase> */
1851 RET_LABEL:;
1852 }
1853 /* method phase#Phase#disabled= for (self: Object, Bool) */
1854 void VIRTUAL_phase__Phase__disabled_61d(val* self, short int p0) {
1855 { /* Inline phase#Phase#disabled= (self,p0) on <self:Object(Phase)> */
1856 self->attrs[COLOR_phase__Phase___disabled].s = p0; /* _disabled on <self:Object(Phase)> */
1857 RET_LABEL1:(void)0;
1858 }
1859 RET_LABEL:;
1860 }
1861 /* method phase#Phase#process_nmodule for (self: Phase, AModule) */
1862 void phase__Phase__process_nmodule(val* self, val* p0) {
1863 val* var_nmodule /* var nmodule: AModule */;
1864 var_nmodule = p0;
1865 RET_LABEL:;
1866 }
1867 /* method phase#Phase#process_nmodule for (self: Object, AModule) */
1868 void VIRTUAL_phase__Phase__process_nmodule(val* self, val* p0) {
1869 val* var_nmodule /* var nmodule: AModule */;
1870 { /* Inline phase#Phase#process_nmodule (self,p0) on <self:Object(Phase)> */
1871 var_nmodule = p0;
1872 RET_LABEL1:(void)0;
1873 }
1874 RET_LABEL:;
1875 }
1876 /* method phase#Phase#process_nclassdef for (self: Phase, AClassdef) */
1877 void phase__Phase__process_nclassdef(val* self, val* p0) {
1878 val* var_nclassdef /* var nclassdef: AClassdef */;
1879 var_nclassdef = p0;
1880 RET_LABEL:;
1881 }
1882 /* method phase#Phase#process_nclassdef for (self: Object, AClassdef) */
1883 void VIRTUAL_phase__Phase__process_nclassdef(val* self, val* p0) {
1884 val* var_nclassdef /* var nclassdef: AClassdef */;
1885 { /* Inline phase#Phase#process_nclassdef (self,p0) on <self:Object(Phase)> */
1886 var_nclassdef = p0;
1887 RET_LABEL1:(void)0;
1888 }
1889 RET_LABEL:;
1890 }
1891 /* method phase#Phase#process_npropdef for (self: Phase, APropdef) */
1892 void phase__Phase__process_npropdef(val* self, val* p0) {
1893 val* var_npropdef /* var npropdef: APropdef */;
1894 var_npropdef = p0;
1895 RET_LABEL:;
1896 }
1897 /* method phase#Phase#process_npropdef for (self: Object, APropdef) */
1898 void VIRTUAL_phase__Phase__process_npropdef(val* self, val* p0) {
1899 val* var_npropdef /* var npropdef: APropdef */;
1900 { /* Inline phase#Phase#process_npropdef (self,p0) on <self:Object(Phase)> */
1901 var_npropdef = p0;
1902 RET_LABEL1:(void)0;
1903 }
1904 RET_LABEL:;
1905 }
1906 /* method phase#Phase#process_annotated_node for (self: Phase, ANode, AAnnotation) */
1907 void phase__Phase__process_annotated_node(val* self, val* p0, val* p1) {
1908 val* var_node /* var node: ANode */;
1909 val* var_nat /* var nat: AAnnotation */;
1910 var_node = p0;
1911 var_nat = p1;
1912 RET_LABEL:;
1913 }
1914 /* method phase#Phase#process_annotated_node for (self: Object, ANode, AAnnotation) */
1915 void VIRTUAL_phase__Phase__process_annotated_node(val* self, val* p0, val* p1) {
1916 val* var_node /* var node: ANode */;
1917 val* var_nat /* var nat: AAnnotation */;
1918 { /* Inline phase#Phase#process_annotated_node (self,p0,p1) on <self:Object(Phase)> */
1919 var_node = p0;
1920 var_nat = p1;
1921 RET_LABEL1:(void)0;
1922 }
1923 RET_LABEL:;
1924 }