mkcsrc: copy .c and .h file to avoid the break of the bootstrap
[nit.git] / c_src / global___cha_analysis._sep.c
1 /* This C file is generated by NIT to compile module global___cha_analysis. */
2 #include "global___cha_analysis._sep.h"
3 static const char LOCATE_global___cha_analysis___ChaContext___reachable_iroutines[] = "cha_analysis::ChaContext::reachable_iroutines";
4 val_t global___cha_analysis___ChaContext___reachable_iroutines(val_t p0){
5 struct {struct stack_frame_t me;} fra;
6 val_t REGB0;
7 val_t tmp;
8 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
9 fra.me.file = LOCATE_global___cha_analysis;
10 fra.me.line = 26;
11 fra.me.meth = LOCATE_global___cha_analysis___ChaContext___reachable_iroutines;
12 fra.me.has_broke = 0;
13 fra.me.REG_size = 1;
14 fra.me.nitni_local_ref_head = NULL;
15 fra.me.REG[0] = NIT_NULL;
16 fra.me.REG[0] = p0;
17 /* global/cha_analysis.nit:26 */
18 REGB0 = TAG_Bool(ATTR_global___cha_analysis___ChaContext____reachable_iroutines(fra.me.REG[0])!=NIT_NULL);
19 if (UNTAG_Bool(REGB0)) {
20 } else {
21 nit_abort("Uninitialized attribute %s", "_reachable_iroutines", LOCATE_global___cha_analysis, 26);
22 }
23 fra.me.REG[0] = ATTR_global___cha_analysis___ChaContext____reachable_iroutines(fra.me.REG[0]);
24 stack_frame_head = fra.me.prev;
25 return fra.me.REG[0];
26 }
27 static const char LOCATE_global___cha_analysis___ChaContext___is_iroutine_reachable[] = "cha_analysis::ChaContext::(reachable_method_analysis::ReachableMethodAnalysis::is_iroutine_reachable)";
28 val_t global___cha_analysis___ChaContext___is_iroutine_reachable(val_t p0, val_t p1){
29 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
30 val_t REGB0;
31 val_t REGB1;
32 val_t tmp;
33 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
34 fra.me.file = LOCATE_global___cha_analysis;
35 fra.me.line = 28;
36 fra.me.meth = LOCATE_global___cha_analysis___ChaContext___is_iroutine_reachable;
37 fra.me.has_broke = 0;
38 fra.me.REG_size = 2;
39 fra.me.nitni_local_ref_head = NULL;
40 fra.me.REG[0] = NIT_NULL;
41 fra.me.REG[1] = NIT_NULL;
42 fra.me.REG[0] = p0;
43 fra.me.REG[1] = p1;
44 /* global/cha_analysis.nit:29 */
45 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
46 if (UNTAG_Bool(REGB0)) {
47 } else {
48 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
49 if (UNTAG_Bool(REGB1)) {
50 REGB1 = TAG_Bool(0);
51 REGB0 = REGB1;
52 } else {
53 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
54 REGB0 = REGB1;
55 }
56 }
57 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
58 if (UNTAG_Bool(REGB0)) {
59 fra.me.REG[0] = CALL_global___cha_analysis___ChaContext___reachable_iroutines(fra.me.REG[0])(fra.me.REG[0]);
60 REGB0 = CALL_standard___collection___abstract_collection___Collection___has(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
61 } else {
62 REGB1 = TAG_Bool(0);
63 REGB0 = REGB1;
64 }
65 goto label1;
66 label1: while(0);
67 stack_frame_head = fra.me.prev;
68 return REGB0;
69 }
70 static const char LOCATE_global___cha_analysis___ChaContext___is_method_reachable[] = "cha_analysis::ChaContext::(reachable_method_analysis::ReachableMethodAnalysis::is_method_reachable)";
71 val_t global___cha_analysis___ChaContext___is_method_reachable(val_t p0, val_t p1){
72 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
73 val_t REGB0;
74 val_t tmp;
75 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
76 fra.me.file = LOCATE_global___cha_analysis;
77 fra.me.line = 32;
78 fra.me.meth = LOCATE_global___cha_analysis___ChaContext___is_method_reachable;
79 fra.me.has_broke = 0;
80 fra.me.REG_size = 2;
81 fra.me.nitni_local_ref_head = NULL;
82 fra.me.REG[0] = NIT_NULL;
83 fra.me.REG[1] = NIT_NULL;
84 fra.me.REG[0] = p0;
85 fra.me.REG[1] = p1;
86 /* global/cha_analysis.nit:33 */
87 fra.me.REG[1] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[1])(fra.me.REG[1]);
88 REGB0 = CALL_global___reachable_method_analysis___ReachableMethodAnalysis___is_iroutine_reachable(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
89 goto label1;
90 label1: while(0);
91 stack_frame_head = fra.me.prev;
92 return REGB0;
93 }
94 static const char LOCATE_global___cha_analysis___ChaContext___init[] = "cha_analysis::ChaContext::init";
95 void global___cha_analysis___ChaContext___init(val_t p0, int* init_table){
96 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_global___cha_analysis___ChaContext].i;
97 struct {struct stack_frame_t me;} fra;
98 val_t tmp;
99 if (init_table[itpos0]) return;
100 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
101 fra.me.file = LOCATE_global___cha_analysis;
102 fra.me.line = 0;
103 fra.me.meth = LOCATE_global___cha_analysis___ChaContext___init;
104 fra.me.has_broke = 0;
105 fra.me.REG_size = 0;
106 fra.me.nitni_local_ref_head = NULL;
107 stack_frame_head = fra.me.prev;
108 init_table[itpos0] = 1;
109 return;
110 }
111 static const char LOCATE_global___cha_analysis___ChaBuilder___iroutine_to_search[] = "cha_analysis::ChaBuilder::iroutine_to_search";
112 val_t global___cha_analysis___ChaBuilder___iroutine_to_search(val_t p0){
113 struct {struct stack_frame_t me;} fra;
114 val_t REGB0;
115 val_t tmp;
116 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
117 fra.me.file = LOCATE_global___cha_analysis;
118 fra.me.line = 38;
119 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___iroutine_to_search;
120 fra.me.has_broke = 0;
121 fra.me.REG_size = 1;
122 fra.me.nitni_local_ref_head = NULL;
123 fra.me.REG[0] = NIT_NULL;
124 fra.me.REG[0] = p0;
125 /* global/cha_analysis.nit:38 */
126 REGB0 = TAG_Bool(ATTR_global___cha_analysis___ChaBuilder____iroutine_to_search(fra.me.REG[0])!=NIT_NULL);
127 if (UNTAG_Bool(REGB0)) {
128 } else {
129 nit_abort("Uninitialized attribute %s", "_iroutine_to_search", LOCATE_global___cha_analysis, 38);
130 }
131 fra.me.REG[0] = ATTR_global___cha_analysis___ChaBuilder____iroutine_to_search(fra.me.REG[0]);
132 stack_frame_head = fra.me.prev;
133 return fra.me.REG[0];
134 }
135 static const char LOCATE_global___cha_analysis___ChaBuilder___context[] = "cha_analysis::ChaBuilder::context";
136 val_t global___cha_analysis___ChaBuilder___context(val_t p0){
137 struct {struct stack_frame_t me;} fra;
138 val_t REGB0;
139 val_t tmp;
140 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
141 fra.me.file = LOCATE_global___cha_analysis;
142 fra.me.line = 39;
143 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___context;
144 fra.me.has_broke = 0;
145 fra.me.REG_size = 1;
146 fra.me.nitni_local_ref_head = NULL;
147 fra.me.REG[0] = NIT_NULL;
148 fra.me.REG[0] = p0;
149 /* global/cha_analysis.nit:39 */
150 REGB0 = TAG_Bool(ATTR_global___cha_analysis___ChaBuilder____context(fra.me.REG[0])!=NIT_NULL);
151 if (UNTAG_Bool(REGB0)) {
152 } else {
153 nit_abort("Uninitialized attribute %s", "_context", LOCATE_global___cha_analysis, 39);
154 }
155 fra.me.REG[0] = ATTR_global___cha_analysis___ChaBuilder____context(fra.me.REG[0]);
156 stack_frame_head = fra.me.prev;
157 return fra.me.REG[0];
158 }
159 static const char LOCATE_global___cha_analysis___ChaBuilder___program[] = "cha_analysis::ChaBuilder::program";
160 val_t global___cha_analysis___ChaBuilder___program(val_t p0){
161 struct {struct stack_frame_t me;} fra;
162 val_t REGB0;
163 val_t tmp;
164 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
165 fra.me.file = LOCATE_global___cha_analysis;
166 fra.me.line = 40;
167 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___program;
168 fra.me.has_broke = 0;
169 fra.me.REG_size = 1;
170 fra.me.nitni_local_ref_head = NULL;
171 fra.me.REG[0] = NIT_NULL;
172 fra.me.REG[0] = p0;
173 /* global/cha_analysis.nit:40 */
174 REGB0 = TAG_Bool(ATTR_global___cha_analysis___ChaBuilder____program(fra.me.REG[0])!=NIT_NULL);
175 if (UNTAG_Bool(REGB0)) {
176 } else {
177 nit_abort("Uninitialized attribute %s", "_program", LOCATE_global___cha_analysis, 40);
178 }
179 fra.me.REG[0] = ATTR_global___cha_analysis___ChaBuilder____program(fra.me.REG[0]);
180 stack_frame_head = fra.me.prev;
181 return fra.me.REG[0];
182 }
183 static const char LOCATE_global___cha_analysis___ChaBuilder___init[] = "cha_analysis::ChaBuilder::init";
184 void global___cha_analysis___ChaBuilder___init(val_t p0, val_t p1, int* init_table){
185 int itpos1 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_global___cha_analysis___ChaBuilder].i;
186 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
187 val_t tmp;
188 if (init_table[itpos1]) return;
189 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
190 fra.me.file = LOCATE_global___cha_analysis;
191 fra.me.line = 42;
192 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___init;
193 fra.me.has_broke = 0;
194 fra.me.REG_size = 2;
195 fra.me.nitni_local_ref_head = NULL;
196 fra.me.REG[0] = NIT_NULL;
197 fra.me.REG[1] = NIT_NULL;
198 fra.me.REG[0] = p0;
199 fra.me.REG[1] = p1;
200 /* global/cha_analysis.nit:43 */
201 ATTR_global___cha_analysis___ChaBuilder____program(fra.me.REG[0]) = fra.me.REG[1];
202 /* global/cha_analysis.nit:44 */
203 fra.me.REG[1] = NEW_ChaContext_global___cha_analysis___ChaContext___init();
204 ATTR_global___cha_analysis___ChaBuilder____context(fra.me.REG[0]) = fra.me.REG[1];
205 stack_frame_head = fra.me.prev;
206 init_table[itpos1] = 1;
207 return;
208 }
209 static const char LOCATE_global___cha_analysis___ChaBuilder___add_search[] = "cha_analysis::ChaBuilder::add_search";
210 void global___cha_analysis___ChaBuilder___add_search(val_t p0, val_t p1, val_t p2, val_t p3, val_t p4){
211 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
212 val_t REGB0;
213 val_t REGB1;
214 val_t REGB2;
215 val_t REGB3;
216 val_t tmp;
217 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
218 fra.me.file = LOCATE_global___cha_analysis;
219 fra.me.line = 47;
220 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___add_search;
221 fra.me.has_broke = 0;
222 fra.me.REG_size = 4;
223 fra.me.nitni_local_ref_head = NULL;
224 fra.me.REG[0] = NIT_NULL;
225 fra.me.REG[1] = NIT_NULL;
226 fra.me.REG[2] = NIT_NULL;
227 fra.me.REG[3] = NIT_NULL;
228 fra.me.REG[0] = p0;
229 fra.me.REG[1] = p1;
230 fra.me.REG[2] = p2;
231 REGB0 = p3;
232 REGB1 = p4;
233 /* global/cha_analysis.nit:49 */
234 REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
235 if (UNTAG_Bool(REGB2)) {
236 } else {
237 REGB3 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
238 if (UNTAG_Bool(REGB3)) {
239 REGB3 = TAG_Bool(0);
240 REGB2 = REGB3;
241 } else {
242 REGB3 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL);
243 REGB2 = REGB3;
244 }
245 }
246 REGB2 = TAG_Bool(!UNTAG_Bool(REGB2));
247 if (UNTAG_Bool(REGB2)) {
248 fra.me.REG[3] = CALL_global___cha_analysis___ChaBuilder___context(fra.me.REG[0])(fra.me.REG[0]);
249 REGB2 = CALL_global___reachable_method_analysis___ReachableMethodAnalysis___is_iroutine_reachable(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
250 REGB2 = TAG_Bool(!UNTAG_Bool(REGB2));
251 } else {
252 REGB3 = TAG_Bool(0);
253 REGB2 = REGB3;
254 }
255 if (UNTAG_Bool(REGB2)) {
256 /* global/cha_analysis.nit:50 */
257 fra.me.REG[3] = CALL_global___cha_analysis___ChaBuilder___context(fra.me.REG[0])(fra.me.REG[0]);
258 fra.me.REG[3] = CALL_global___cha_analysis___ChaContext___reachable_iroutines(fra.me.REG[3])(fra.me.REG[3]);
259 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
260 /* global/cha_analysis.nit:51 */
261 REGB2 = TAG_Bool(ATTR_global___cha_analysis___ChaBuilder____iroutine_to_search(fra.me.REG[0])!=NIT_NULL);
262 if (UNTAG_Bool(REGB2)) {
263 } else {
264 nit_abort("Uninitialized attribute %s", "_iroutine_to_search", LOCATE_global___cha_analysis, 51);
265 }
266 fra.me.REG[3] = ATTR_global___cha_analysis___ChaBuilder____iroutine_to_search(fra.me.REG[0]);
267 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
268 }
269 /* global/cha_analysis.nit:54 */
270 REGB2 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
271 if (UNTAG_Bool(REGB2)) {
272 } else {
273 REGB3 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
274 if (UNTAG_Bool(REGB3)) {
275 REGB3 = TAG_Bool(0);
276 REGB2 = REGB3;
277 } else {
278 REGB3 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
279 REGB2 = REGB3;
280 }
281 }
282 REGB2 = TAG_Bool(!UNTAG_Bool(REGB2));
283 if (UNTAG_Bool(REGB2)) {
284 /* global/cha_analysis.nit:56 */
285 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
286 if (UNTAG_Bool(REGB0)) {
287 /* global/cha_analysis.nit:57 */
288 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
289 if (UNTAG_Bool(REGB0)) {
290 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 57);
291 }
292 fra.me.REG[2] = CALL_metamodel___abstractmetamodel___MMLocalProperty___prhe(fra.me.REG[1])(fra.me.REG[1]);
293 fra.me.REG[2] = CALL_metamodel___partial_order___PartialOrderElement___smallers(fra.me.REG[2])(fra.me.REG[2]);
294 CALL_standard___collection___abstract_collection___Collection___iterate(fra.me.REG[2])(fra.me.REG[2], (&(fra.me)), ((fun_t)OC_global___cha_analysis___ChaBuilder___add_search_1));
295 }
296 /* global/cha_analysis.nit:65 */
297 if (UNTAG_Bool(REGB1)) {
298 /* global/cha_analysis.nit:66 */
299 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
300 if (UNTAG_Bool(REGB1)) {
301 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 66);
302 }
303 fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMLocalProperty___prhe(fra.me.REG[1])(fra.me.REG[1]);
304 fra.me.REG[1] = CALL_metamodel___partial_order___PartialOrderElement___greaters(fra.me.REG[1])(fra.me.REG[1]);
305 CALL_standard___collection___abstract_collection___Collection___iterate(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_global___cha_analysis___ChaBuilder___add_search_2));
306 }
307 }
308 stack_frame_head = fra.me.prev;
309 return;
310 }
311 void OC_global___cha_analysis___ChaBuilder___add_search_1(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
312 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
313 val_t REGB0;
314 val_t REGB1;
315 fun_t CREG[1];
316 val_t tmp;
317 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
318 fra.me.file = LOCATE_global___cha_analysis;
319 fra.me.line = 0;
320 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___add_search;
321 fra.me.has_broke = 0;
322 fra.me.REG_size = 2;
323 fra.me.nitni_local_ref_head = NULL;
324 fra.me.REG[0] = NIT_NULL;
325 fra.me.REG[1] = NIT_NULL;
326 fra.me.closure_ctx = closctx_param;
327 fra.me.closure_funs = CREG;
328 fra.me.REG[0] = p0;
329 CREG[0] = clos_fun0;
330 /* global/cha_analysis.nit:58 */
331 REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_metamodel___abstractmetamodel___MMMethod, ID_metamodel___abstractmetamodel___MMMethod)) /*cast MMMethod*/;
332 if (UNTAG_Bool(REGB0)) {
333 /* global/cha_analysis.nit:59 */
334 fra.me.REG[1] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[0])(fra.me.REG[0]);
335 REGB0 = TAG_Bool(1);
336 REGB1 = TAG_Bool(0);
337 CALL_global___cha_analysis___ChaBuilder___add_search(closctx->REG[0])(closctx->REG[0], fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
338 }
339 stack_frame_head = fra.me.prev;
340 return;
341 }
342 void OC_global___cha_analysis___ChaBuilder___add_search_2(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
343 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
344 val_t REGB0;
345 val_t REGB1;
346 fun_t CREG[1];
347 val_t tmp;
348 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
349 fra.me.file = LOCATE_global___cha_analysis;
350 fra.me.line = 0;
351 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___add_search;
352 fra.me.has_broke = 0;
353 fra.me.REG_size = 2;
354 fra.me.nitni_local_ref_head = NULL;
355 fra.me.REG[0] = NIT_NULL;
356 fra.me.REG[1] = NIT_NULL;
357 fra.me.closure_ctx = closctx_param;
358 fra.me.closure_funs = CREG;
359 fra.me.REG[0] = p0;
360 CREG[0] = clos_fun0;
361 /* global/cha_analysis.nit:67 */
362 REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_metamodel___abstractmetamodel___MMMethod, ID_metamodel___abstractmetamodel___MMMethod)) /*cast MMMethod*/;
363 if (UNTAG_Bool(REGB0)) {
364 /* global/cha_analysis.nit:68 */
365 fra.me.REG[1] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[0])(fra.me.REG[0]);
366 REGB0 = TAG_Bool(1);
367 REGB1 = TAG_Bool(0);
368 CALL_global___cha_analysis___ChaBuilder___add_search(closctx->REG[0])(closctx->REG[0], fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
369 }
370 stack_frame_head = fra.me.prev;
371 return;
372 }
373 static const char LOCATE_global___cha_analysis___ChaBuilder___work[] = "cha_analysis::ChaBuilder::work";
374 void global___cha_analysis___ChaBuilder___work(val_t p0){
375 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
376 val_t REGB0;
377 val_t REGB1;
378 val_t tmp;
379 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
380 fra.me.file = LOCATE_global___cha_analysis;
381 fra.me.line = 75;
382 fra.me.meth = LOCATE_global___cha_analysis___ChaBuilder___work;
383 fra.me.has_broke = 0;
384 fra.me.REG_size = 3;
385 fra.me.nitni_local_ref_head = NULL;
386 fra.me.REG[0] = NIT_NULL;
387 fra.me.REG[1] = NIT_NULL;
388 fra.me.REG[2] = NIT_NULL;
389 fra.me.REG[0] = p0;
390 /* global/cha_analysis.nit:77 */
391 fra.me.REG[1] = CALL_global___cha_analysis___ChaBuilder___program(fra.me.REG[0])(fra.me.REG[0]);
392 fra.me.REG[1] = CALL_program___Program___main_method(fra.me.REG[1])(fra.me.REG[1]);
393 /* global/cha_analysis.nit:78 */
394 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
395 if (UNTAG_Bool(REGB0)) {
396 } else {
397 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
398 if (UNTAG_Bool(REGB1)) {
399 REGB1 = TAG_Bool(0);
400 REGB0 = REGB1;
401 } else {
402 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
403 REGB0 = REGB1;
404 }
405 }
406 if (UNTAG_Bool(REGB0)) {
407 goto label1;
408 }
409 /* global/cha_analysis.nit:80 */
410 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
411 if (UNTAG_Bool(REGB0)) {
412 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 80);
413 }
414 fra.me.REG[2] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[1])(fra.me.REG[1]);
415 REGB0 = TAG_Bool(1);
416 REGB1 = TAG_Bool(0);
417 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2], REGB0, REGB1);
418 /* global/cha_analysis.nit:82 */
419 while(1) {
420 fra.me.REG[2] = CALL_global___cha_analysis___ChaBuilder___iroutine_to_search(fra.me.REG[0])(fra.me.REG[0]);
421 REGB1 = CALL_standard___collection___abstract_collection___Collection___is_empty(fra.me.REG[2])(fra.me.REG[2]);
422 REGB1 = TAG_Bool(!UNTAG_Bool(REGB1));
423 if (UNTAG_Bool(REGB1)) {
424 /* global/cha_analysis.nit:83 */
425 fra.me.REG[2] = NEW_ChaVisitor_global___cha_analysis___ChaVisitor___init(fra.me.REG[0]);
426 /* global/cha_analysis.nit:84 */
427 fra.me.REG[1] = CALL_global___cha_analysis___ChaBuilder___iroutine_to_search(fra.me.REG[0])(fra.me.REG[0]);
428 fra.me.REG[1] = CALL_standard___collection___abstract_collection___Sequence___pop(fra.me.REG[1])(fra.me.REG[1]);
429 /* global/cha_analysis.nit:85 */
430 fra.me.REG[1] = CALL_icode___icode_base___IRoutine___body(fra.me.REG[1])(fra.me.REG[1]);
431 CALL_icode___icode_tools___ICodeVisitor___visit_icode(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
432 } else {
433 /* global/cha_analysis.nit:82 */
434 goto label2;
435 }
436 }
437 label2: while(0);
438 label1: while(0);
439 stack_frame_head = fra.me.prev;
440 return;
441 }
442 static const char LOCATE_global___cha_analysis___ChaVisitor___builder[] = "cha_analysis::ChaVisitor::builder";
443 val_t global___cha_analysis___ChaVisitor___builder(val_t p0){
444 struct {struct stack_frame_t me;} fra;
445 val_t REGB0;
446 val_t tmp;
447 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
448 fra.me.file = LOCATE_global___cha_analysis;
449 fra.me.line = 92;
450 fra.me.meth = LOCATE_global___cha_analysis___ChaVisitor___builder;
451 fra.me.has_broke = 0;
452 fra.me.REG_size = 1;
453 fra.me.nitni_local_ref_head = NULL;
454 fra.me.REG[0] = NIT_NULL;
455 fra.me.REG[0] = p0;
456 /* global/cha_analysis.nit:92 */
457 REGB0 = TAG_Bool(ATTR_global___cha_analysis___ChaVisitor____builder(fra.me.REG[0])!=NIT_NULL);
458 if (UNTAG_Bool(REGB0)) {
459 } else {
460 nit_abort("Uninitialized attribute %s", "_builder", LOCATE_global___cha_analysis, 92);
461 }
462 fra.me.REG[0] = ATTR_global___cha_analysis___ChaVisitor____builder(fra.me.REG[0]);
463 stack_frame_head = fra.me.prev;
464 return fra.me.REG[0];
465 }
466 static const char LOCATE_global___cha_analysis___ChaVisitor___visit_icode[] = "cha_analysis::ChaVisitor::(icode_tools::ICodeVisitor::visit_icode)";
467 void global___cha_analysis___ChaVisitor___visit_icode(val_t p0, val_t p1){
468 struct {struct stack_frame_t me; val_t MORE_REG[6];} fra;
469 val_t REGB0;
470 val_t REGB1;
471 val_t tmp;
472 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
473 fra.me.file = LOCATE_global___cha_analysis;
474 fra.me.line = 94;
475 fra.me.meth = LOCATE_global___cha_analysis___ChaVisitor___visit_icode;
476 fra.me.has_broke = 0;
477 fra.me.REG_size = 7;
478 fra.me.nitni_local_ref_head = NULL;
479 fra.me.REG[0] = NIT_NULL;
480 fra.me.REG[1] = NIT_NULL;
481 fra.me.REG[2] = NIT_NULL;
482 fra.me.REG[3] = NIT_NULL;
483 fra.me.REG[4] = NIT_NULL;
484 fra.me.REG[5] = NIT_NULL;
485 fra.me.REG[6] = NIT_NULL;
486 fra.me.REG[0] = p0;
487 fra.me.REG[1] = p1;
488 /* global/cha_analysis.nit:94 */
489 fra.me.REG[2] = fra.me.REG[0];
490 fra.me.REG[3] = fra.me.REG[1];
491 /* global/cha_analysis.nit:96 */
492 REGB0 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___IStaticCall, ID_icode___icode_base___IStaticCall)) /*cast IStaticCall*/;
493 if (UNTAG_Bool(REGB0)) {
494 /* global/cha_analysis.nit:98 */
495 fra.me.REG[4] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
496 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
497 if (UNTAG_Bool(REGB0)) {
498 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 98);
499 }
500 fra.me.REG[5] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
501 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
502 if (UNTAG_Bool(REGB0)) {
503 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 98);
504 }
505 fra.me.REG[6] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
506 fra.me.REG[6] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[6])(fra.me.REG[6]);
507 REGB0 = TAG_Bool(1);
508 REGB1 = TAG_Bool(0);
509 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5], fra.me.REG[6], REGB0, REGB1);
510 } else {
511 /* global/cha_analysis.nit:99 */
512 REGB1 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___INew, ID_icode___icode_base___INew)) /*cast INew*/;
513 if (UNTAG_Bool(REGB1)) {
514 /* global/cha_analysis.nit:101 */
515 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
516 if (UNTAG_Bool(REGB1)) {
517 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 101);
518 }
519 fra.me.REG[6] = CALL_icode___icode_base___INew___stype(fra.me.REG[3])(fra.me.REG[3]);
520 /* global/cha_analysis.nit:102 */
521 fra.me.REG[5] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
522 fra.me.REG[5] = CALL_global___cha_analysis___ChaBuilder___program(fra.me.REG[5])(fra.me.REG[5]);
523 fra.me.REG[5] = CALL_program___Program___main_module(fra.me.REG[5])(fra.me.REG[5]);
524 fra.me.REG[5] = CALL_metamodel___static_type___MMType___for_module(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[5]);
525 fra.me.REG[5] = CALL_metamodel___static_type___MMType___local_class(fra.me.REG[5])(fra.me.REG[5]);
526 /* global/cha_analysis.nit:103 */
527 fra.me.REG[6] = CALL_metamodel___abstractmetamodel___MMLocalClass___global(fra.me.REG[5])(fra.me.REG[5]);
528 REGB1 = CALL_metamodel___abstractmetamodel___MMGlobalClass___is_extern(fra.me.REG[6])(fra.me.REG[6]);
529 REGB1 = TAG_Bool(!UNTAG_Bool(REGB1));
530 if (UNTAG_Bool(REGB1)) {
531 /* global/cha_analysis.nit:104 */
532 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
533 if (UNTAG_Bool(REGB1)) {
534 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 104);
535 }
536 fra.me.REG[6] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
537 fra.me.REG[6] = CALL_metamodel___abstractmetamodel___MMLocalProperty___global(fra.me.REG[6])(fra.me.REG[6]);
538 fra.me.REG[6] = CALL_metamodel___abstractmetamodel___MMLocalClass_____bra(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
539 REGB1 = TAG_Bool(VAL_ISA(fra.me.REG[6], COLOR_metamodel___abstractmetamodel___MMMethod, ID_metamodel___abstractmetamodel___MMMethod)) /*cast MMMethod*/;
540 if (UNTAG_Bool(REGB1)) {
541 } else {
542 nit_abort("Cast failed", NULL, LOCATE_global___cha_analysis, 104);
543 }
544 /* global/cha_analysis.nit:105 */
545 fra.me.REG[5] = CALL_program___MMLocalClass___new_instance_iroutine(fra.me.REG[5])(fra.me.REG[5]);
546 fra.me.REG[6] = CALL_standard___collection___abstract_collection___MapRead_____bra(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
547 /* global/cha_analysis.nit:106 */
548 fra.me.REG[5] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
549 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
550 if (UNTAG_Bool(REGB1)) {
551 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 106);
552 }
553 fra.me.REG[4] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
554 REGB1 = TAG_Bool(0);
555 REGB0 = TAG_Bool(0);
556 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[4], fra.me.REG[6], REGB1, REGB0);
557 }
558 } else {
559 /* global/cha_analysis.nit:108 */
560 REGB0 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___ISuper, ID_icode___icode_base___ISuper)) /*cast ISuper*/;
561 if (UNTAG_Bool(REGB0)) {
562 /* global/cha_analysis.nit:109 */
563 fra.me.REG[6] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
564 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
565 if (UNTAG_Bool(REGB0)) {
566 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 109);
567 }
568 fra.me.REG[4] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
569 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
570 if (UNTAG_Bool(REGB0)) {
571 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 109);
572 }
573 fra.me.REG[5] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
574 fra.me.REG[5] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[5])(fra.me.REG[5]);
575 REGB0 = TAG_Bool(0);
576 REGB1 = TAG_Bool(1);
577 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[4], fra.me.REG[5], REGB0, REGB1);
578 } else {
579 /* global/cha_analysis.nit:110 */
580 REGB1 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___ICall, ID_icode___icode_base___ICall)) /*cast ICall*/;
581 if (UNTAG_Bool(REGB1)) {
582 /* global/cha_analysis.nit:111 */
583 fra.me.REG[5] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
584 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
585 if (UNTAG_Bool(REGB1)) {
586 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 111);
587 }
588 fra.me.REG[4] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
589 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
590 if (UNTAG_Bool(REGB1)) {
591 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 111);
592 }
593 fra.me.REG[6] = CALL_icode___icode_base___IAbsCall___property(fra.me.REG[3])(fra.me.REG[3]);
594 fra.me.REG[6] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[6])(fra.me.REG[6]);
595 REGB1 = TAG_Bool(0);
596 REGB0 = TAG_Bool(0);
597 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[4], fra.me.REG[6], REGB1, REGB0);
598 } else {
599 /* global/cha_analysis.nit:112 */
600 REGB0 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___ICheckInstance, ID_icode___icode_base___ICheckInstance)) /*cast ICheckInstance*/;
601 if (UNTAG_Bool(REGB0)) {
602 /* global/cha_analysis.nit:113 */
603 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
604 if (UNTAG_Bool(REGB0)) {
605 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 113);
606 }
607 fra.me.REG[6] = CALL_icode___icode_base___ICheckInstance___stype(fra.me.REG[3])(fra.me.REG[3]);
608 /* global/cha_analysis.nit:114 */
609 fra.me.REG[4] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
610 fra.me.REG[4] = CALL_global___cha_analysis___ChaBuilder___program(fra.me.REG[4])(fra.me.REG[4]);
611 fra.me.REG[4] = CALL_program___Program___main_module(fra.me.REG[4])(fra.me.REG[4]);
612 fra.me.REG[4] = CALL_metamodel___static_type___MMType___for_module(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[4]);
613 fra.me.REG[4] = CALL_metamodel___static_type___MMType___local_class(fra.me.REG[4])(fra.me.REG[4]);
614 /* global/cha_analysis.nit:115 */
615 fra.me.REG[4] = CALL_program___MMLocalClass___checknew_iroutine(fra.me.REG[4])(fra.me.REG[4]);
616 /* global/cha_analysis.nit:116 */
617 fra.me.REG[6] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
618 REGB0 = TAG_Bool(1);
619 REGB1 = TAG_Bool(0);
620 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[6])(fra.me.REG[6], NIT_NULL, fra.me.REG[4], REGB0, REGB1);
621 } else {
622 /* global/cha_analysis.nit:117 */
623 REGB1 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_icode___icode_base___IInitAttributes, ID_icode___icode_base___IInitAttributes)) /*cast IInitAttributes*/;
624 if (UNTAG_Bool(REGB1)) {
625 /* global/cha_analysis.nit:118 */
626 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
627 if (UNTAG_Bool(REGB1)) {
628 nit_abort("Reciever is null", NULL, LOCATE_global___cha_analysis, 118);
629 }
630 fra.me.REG[3] = CALL_icode___icode_base___IInitAttributes___stype(fra.me.REG[3])(fra.me.REG[3]);
631 /* global/cha_analysis.nit:119 */
632 fra.me.REG[4] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
633 fra.me.REG[4] = CALL_global___cha_analysis___ChaBuilder___program(fra.me.REG[4])(fra.me.REG[4]);
634 fra.me.REG[4] = CALL_program___Program___main_module(fra.me.REG[4])(fra.me.REG[4]);
635 fra.me.REG[4] = CALL_metamodel___static_type___MMType___for_module(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
636 fra.me.REG[4] = CALL_metamodel___static_type___MMType___local_class(fra.me.REG[4])(fra.me.REG[4]);
637 /* global/cha_analysis.nit:120 */
638 fra.me.REG[4] = CALL_program___MMLocalClass___init_var_iroutine(fra.me.REG[4])(fra.me.REG[4]);
639 /* global/cha_analysis.nit:121 */
640 fra.me.REG[2] = CALL_global___cha_analysis___ChaVisitor___builder(fra.me.REG[2])(fra.me.REG[2]);
641 REGB1 = TAG_Bool(1);
642 REGB0 = TAG_Bool(0);
643 CALL_global___cha_analysis___ChaBuilder___add_search(fra.me.REG[2])(fra.me.REG[2], NIT_NULL, fra.me.REG[4], REGB1, REGB0);
644 }
645 }
646 }
647 }
648 }
649 }
650 /* global/cha_analysis.nit:123 */
651 CALL_SUPER_global___cha_analysis___ChaVisitor___visit_icode(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
652 stack_frame_head = fra.me.prev;
653 return;
654 }
655 static const char LOCATE_global___cha_analysis___ChaVisitor___init[] = "cha_analysis::ChaVisitor::init";
656 void global___cha_analysis___ChaVisitor___init(val_t p0, val_t p1, int* init_table){
657 int itpos2 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_global___cha_analysis___ChaVisitor].i;
658 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
659 val_t tmp;
660 if (init_table[itpos2]) return;
661 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
662 fra.me.file = LOCATE_global___cha_analysis;
663 fra.me.line = 126;
664 fra.me.meth = LOCATE_global___cha_analysis___ChaVisitor___init;
665 fra.me.has_broke = 0;
666 fra.me.REG_size = 3;
667 fra.me.nitni_local_ref_head = NULL;
668 fra.me.REG[0] = NIT_NULL;
669 fra.me.REG[1] = NIT_NULL;
670 fra.me.REG[2] = NIT_NULL;
671 fra.me.REG[0] = p0;
672 fra.me.REG[1] = p1;
673 /* global/cha_analysis.nit:126 */
674 fra.me.REG[2] = fra.me.REG[0];
675 CALL_icode___icode_tools___ICodeVisitor___init(fra.me.REG[0])(fra.me.REG[0], init_table);
676 /* global/cha_analysis.nit:128 */
677 ATTR_global___cha_analysis___ChaVisitor____builder(fra.me.REG[2]) = fra.me.REG[1];
678 stack_frame_head = fra.me.prev;
679 init_table[itpos2] = 1;
680 return;
681 }