* gnu/regexp/CharIndexedReader.java: Removed.
[official-gcc.git] / gcc / f / top.c
blobce39dd09bf4c233c11a50b635caceee7c475a3dc
1 /* top.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996, 1997, 1999, 2001, 2003
3 Free Software Foundation, Inc.
4 Contributed by James Craig Burley.
6 This file is part of GNU Fortran.
8 GNU Fortran is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
13 GNU Fortran is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU Fortran; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, USA.
23 Related Modules:
24 None.
26 Description:
27 The GNU Fortran Front End.
29 Modifications:
32 /* Include files. */
34 #include "proj.h"
35 #include "top.h"
36 #include "bad.h"
37 #include "bit.h"
38 #include "bld.h"
39 #include "com.h"
40 #include "data.h"
41 #include "equiv.h"
42 #include "expr.h"
43 #include "global.h"
44 #include "implic.h"
45 #include "info.h"
46 #include "intrin.h"
47 #include "lab.h"
48 #include "lex.h"
49 #include "malloc.h"
50 #include "name.h"
51 #include "options.h"
52 #include "opts.h"
53 #include "src.h"
54 #include "st.h"
55 #include "storag.h"
56 #include "symbol.h"
57 #include "target.h"
58 #include "where.h"
59 #include "flags.h"
60 #include "toplev.h"
62 /* Externals defined here. */
64 bool ffe_is_do_internal_checks_ = FALSE;
65 bool ffe_is_90_ = FFETARGET_defaultIS_90;
66 bool ffe_is_automatic_ = FFETARGET_defaultIS_AUTOMATIC;
67 bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH;
68 bool ffe_is_emulate_complex_ = FALSE;
69 bool ffe_is_underscoring_ = FFETARGET_defaultEXTERNAL_UNDERSCORED
70 || FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
71 bool ffe_is_second_underscore_ = FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
72 bool ffe_is_debug_kludge_ = FALSE;
73 bool ffe_is_dollar_ok_ = FFETARGET_defaultIS_DOLLAR_OK;
74 bool ffe_is_f2c_ = FFETARGET_defaultIS_F2C;
75 bool ffe_is_f2c_library_ = FFETARGET_defaultIS_F2C_LIBRARY;
76 bool ffe_is_ffedebug_ = FALSE;
77 bool ffe_is_flatten_arrays_ = FALSE;
78 bool ffe_is_free_form_ = FFETARGET_defaultIS_FREE_FORM;
79 bool ffe_is_globals_ = TRUE;
80 bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
81 bool ffe_is_mainprog_; /* TRUE if current prog unit known to be
82 main. */
83 bool ffe_is_onetrip_ = FALSE;
84 bool ffe_is_silent_ = TRUE;
85 bool ffe_is_typeless_boz_ = FALSE;
86 bool ffe_is_pedantic_ = FFETARGET_defaultIS_PEDANTIC;
87 bool ffe_is_saveall_; /* TRUE if mainprog or SAVE (no args) seen. */
88 bool ffe_is_ugly_args_ = TRUE;
89 bool ffe_is_ugly_assign_ = FALSE; /* Try and store pointer to ASSIGN labels in INTEGER vars. */
90 bool ffe_is_ugly_assumed_ = FALSE; /* DIMENSION X([...,]1) => DIMENSION X([...,]*) */
91 bool ffe_is_ugly_comma_ = FALSE;
92 bool ffe_is_ugly_complex_ = FALSE;
93 bool ffe_is_ugly_init_ = TRUE;
94 bool ffe_is_ugly_logint_ = FALSE;
95 bool ffe_is_version_ = FALSE;
96 bool ffe_is_vxt_ = FALSE;
97 bool ffe_is_warn_globals_ = TRUE;
98 bool ffe_is_warn_implicit_ = FALSE;
99 bool ffe_is_warn_surprising_ = FALSE;
100 bool ffe_is_zeros_ = FALSE;
101 ffeCase ffe_case_intrin_ = FFETARGET_defaultCASE_INTRIN;
102 ffeCase ffe_case_match_ = FFETARGET_defaultCASE_MATCH;
103 ffeCase ffe_case_source_ = FFETARGET_defaultCASE_SOURCE;
104 ffeCase ffe_case_symbol_ = FFETARGET_defaultCASE_SYMBOL;
105 ffeIntrinsicState ffe_intrinsic_state_badu77_ = FFE_intrinsicstateENABLED;
106 ffeIntrinsicState ffe_intrinsic_state_gnu_ = FFE_intrinsicstateENABLED;
107 ffeIntrinsicState ffe_intrinsic_state_f2c_ = FFE_intrinsicstateENABLED;
108 ffeIntrinsicState ffe_intrinsic_state_f90_ = FFE_intrinsicstateENABLED;
109 ffeIntrinsicState ffe_intrinsic_state_mil_ = FFE_intrinsicstateENABLED;
110 ffeIntrinsicState ffe_intrinsic_state_unix_ = FFE_intrinsicstateENABLED;
111 ffeIntrinsicState ffe_intrinsic_state_vxt_ = FFE_intrinsicstateENABLED;
112 int ffe_fixed_line_length_ = FFETARGET_defaultFIXED_LINE_LENGTH;
113 mallocPool ffe_file_pool_ = NULL;
114 mallocPool ffe_any_unit_pool_ = NULL;
115 mallocPool ffe_program_unit_pool_ = NULL;
116 ffeCounter ffe_count_0 = 0;
117 ffeCounter ffe_count_1 = 0;
118 ffeCounter ffe_count_2 = 0;
119 ffeCounter ffe_count_3 = 0;
120 ffeCounter ffe_count_4 = 0;
121 bool ffe_in_0 = FALSE;
122 bool ffe_in_1 = FALSE;
123 bool ffe_in_2 = FALSE;
124 bool ffe_in_3 = FALSE;
125 bool ffe_in_4 = FALSE;
127 /* Simple definitions and enumerations. */
130 /* Internal typedefs. */
133 /* Private include files. */
136 /* Internal structure definitions. */
139 /* Static objects accessed by functions in this module. */
142 /* Static functions (internal). */
144 static bool ffe_is_digit_string_ (const char *s);
146 /* Internal macros. */
148 static bool
149 ffe_is_digit_string_ (const char *s)
151 const char *p;
153 for (p = s; ISDIGIT (*p); ++p)
156 return (p != s) && (*p == '\0');
159 /* Get ready for options handling. */
160 unsigned int
161 ffe_init_options (unsigned int argc ATTRIBUTE_UNUSED,
162 const char **argv ATTRIBUTE_UNUSED)
164 /* Set default options for Fortran. */
165 flag_move_all_movables = 1;
166 flag_reduce_all_givs = 1;
167 flag_argument_noalias = 2;
168 flag_merge_constants = 2;
169 flag_errno_math = 0;
170 flag_complex_divide_method = 1;
172 return CL_F77;
175 /* Handle command-line options. Returns 0 if unrecognized, 1 if
176 recognized and handled. */
178 ffe_handle_option (size_t scode, const char *arg, int value)
180 enum opt_code code = (enum opt_code) scode;
182 switch (code)
184 default:
185 abort();
187 case OPT_fversion:
188 ffe_set_is_version (TRUE);
189 ffe_set_is_do_internal_checks (TRUE);
190 break;
192 case OPT_ff66:
193 ffe_set_is_onetrip (value);
194 ffe_set_is_ugly_assumed (value);
195 break;
197 case OPT_ff77:
198 ffe_set_is_backslash (value);
199 if (value)
200 ffe_set_is_typeless_boz (FALSE);
201 break;
203 case OPT_ff90:
204 ffe_set_is_90 (value);
205 break;
207 case OPT_fautomatic:
208 ffe_set_is_automatic (value);
209 break;
211 case OPT_fdollar_ok:
212 ffe_set_is_dollar_ok (value);
213 break;
215 case OPT_ff2c:
216 ffe_set_is_f2c (value);
217 break;
219 case OPT_ff2c_library:
220 ffe_set_is_f2c_library (value);
221 break;
223 case OPT_fflatten_arrays:
224 ffe_set_is_f2c_library (value);
225 break;
227 case OPT_ffree_form:
228 ffe_set_is_free_form (value);
229 break;
231 case OPT_ffixed_form:
232 ffe_set_is_free_form (!value);
233 break;
235 case OPT_fpedantic:
236 ffe_set_is_pedantic (value);
237 break;
239 case OPT_fvxt:
240 ffe_set_is_vxt (value);
241 break;
243 case OPT_fvxt_not_f90:
244 warning ("-fvxt-not-f90 no longer supported -- try -fvxt");
245 break;
247 case OPT_ff90_not_vxt:
248 warning ("-ff90-not-vxt no longer supported -- try -fno-vxt -ff90");
249 break;
251 case OPT_fugly:
252 ffe_set_is_ugly_args (value);
253 ffe_set_is_ugly_assign (value);
254 ffe_set_is_ugly_assumed (value);
255 ffe_set_is_ugly_comma (value);
256 ffe_set_is_ugly_complex (value);
257 ffe_set_is_ugly_init (value);
258 ffe_set_is_ugly_logint (value);
259 break;
261 case OPT_fugly_args:
262 ffe_set_is_ugly_args (value);
263 break;
265 case OPT_fugly_assign:
266 ffe_set_is_ugly_assign (value);
267 break;
269 case OPT_fugly_assumed:
270 ffe_set_is_ugly_assumed (value);
271 break;
273 case OPT_fugly_comma:
274 ffe_set_is_ugly_comma (value);
275 break;
277 case OPT_fugly_complex:
278 ffe_set_is_ugly_complex (value);
279 break;
281 case OPT_fugly_init:
282 ffe_set_is_ugly_init (value);
283 break;
285 case OPT_fugly_logint:
286 ffe_set_is_ugly_logint (value);
287 break;
289 case OPT_fxyzzy:
290 ffe_set_is_ffedebug (value);
291 break;
293 case OPT_finit_local_zero:
294 ffe_set_is_init_local_zero (value);
295 break;
297 case OPT_femulate_complex:
298 ffe_set_is_emulate_complex (value);
299 break;
301 case OPT_fbackslash:
302 ffe_set_is_backslash (value);
303 break;
305 case OPT_funderscoring:
306 ffe_set_is_underscoring (value);
307 break;
309 case OPT_fsecond_underscore:
310 ffe_set_is_second_underscore (value);
311 break;
313 case OPT_fzeros:
314 ffe_set_is_zeros (value);
315 break;
317 case OPT_fdebug_kludge:
318 warning ("-fdebug-kludge is disabled, use normal debugging flags");
319 break;
321 case OPT_fonetrip:
322 ffe_set_is_onetrip (value);
323 break;
325 case OPT_fsilent:
326 ffe_set_is_silent (value);
327 break;
329 case OPT_fglobals:
330 ffe_set_is_globals (value);
331 break;
333 case OPT_ffortran_bounds_check:
334 flag_bounds_check = value;
335 break;
337 case OPT_ftypeless_boz:
338 ffe_set_is_typeless_boz (value);
339 break;
341 case OPT_fintrin_case_initcap:
342 ffe_set_case_intrin (FFE_caseINITCAP);
343 break;
345 case OPT_fintrin_case_lower:
346 ffe_set_case_intrin (FFE_caseLOWER);
347 break;
349 case OPT_fintrin_case_upper:
350 ffe_set_case_intrin (FFE_caseUPPER);
351 break;
353 case OPT_fintrin_case_any:
354 ffe_set_case_intrin (FFE_caseNONE);
355 break;
357 case OPT_fmatch_case_initcap:
358 ffe_set_case_match (FFE_caseINITCAP);
359 break;
361 case OPT_fmatch_case_lower:
362 ffe_set_case_match (FFE_caseLOWER);
363 break;
365 case OPT_fmatch_case_upper:
366 ffe_set_case_match (FFE_caseUPPER);
367 break;
369 case OPT_fmatch_case_any:
370 ffe_set_case_match (FFE_caseNONE);
371 break;
373 case OPT_fsource_case_lower:
374 ffe_set_case_source (FFE_caseLOWER);
375 break;
377 case OPT_fsource_case_preserve:
378 ffe_set_case_match (FFE_caseNONE);
379 break;
381 case OPT_fsource_case_upper:
382 ffe_set_case_source (FFE_caseUPPER);
383 break;
385 case OPT_fsymbol_case_initcap:
386 ffe_set_case_symbol (FFE_caseINITCAP);
387 break;
389 case OPT_fsymbol_case_lower:
390 ffe_set_case_symbol (FFE_caseLOWER);
391 break;
393 case OPT_fsymbol_case_upper:
394 ffe_set_case_symbol (FFE_caseUPPER);
395 break;
397 case OPT_fsymbol_case_any:
398 ffe_set_case_symbol (FFE_caseNONE);
399 break;
401 case OPT_fcase_strict_upper:
402 ffe_set_case_intrin (FFE_caseUPPER);
403 ffe_set_case_match (FFE_caseUPPER);
404 ffe_set_case_source (FFE_caseNONE);
405 ffe_set_case_symbol (FFE_caseUPPER);
406 break;
408 case OPT_fcase_strict_lower:
409 ffe_set_case_intrin (FFE_caseLOWER);
410 ffe_set_case_match (FFE_caseLOWER);
411 ffe_set_case_source (FFE_caseNONE);
412 ffe_set_case_symbol (FFE_caseLOWER);
413 break;
415 case OPT_fcase_initcap:
416 ffe_set_case_intrin (FFE_caseINITCAP);
417 ffe_set_case_match (FFE_caseINITCAP);
418 ffe_set_case_source (FFE_caseNONE);
419 ffe_set_case_symbol (FFE_caseINITCAP);
420 break;
422 case OPT_fcase_upper:
423 ffe_set_case_intrin (FFE_caseNONE);
424 ffe_set_case_match (FFE_caseNONE);
425 ffe_set_case_source (FFE_caseUPPER);
426 ffe_set_case_symbol (FFE_caseNONE);
427 break;
429 case OPT_fcase_lower:
430 ffe_set_case_intrin (FFE_caseNONE);
431 ffe_set_case_match (FFE_caseNONE);
432 ffe_set_case_source (FFE_caseLOWER);
433 ffe_set_case_symbol (FFE_caseNONE);
434 break;
436 case OPT_fcase_preserve:
437 ffe_set_case_intrin (FFE_caseNONE);
438 ffe_set_case_match (FFE_caseNONE);
439 ffe_set_case_source (FFE_caseNONE);
440 ffe_set_case_symbol (FFE_caseNONE);
441 break;
443 case OPT_fbadu77_intrinsics_delete:
444 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDELETED);
445 break;
447 case OPT_fbadu77_intrinsics_hide:
448 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateHIDDEN);
449 break;
451 case OPT_fbadu77_intrinsics_disable:
452 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDISABLED);
453 break;
455 case OPT_fbadu77_intrinsics_enable:
456 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateENABLED);
457 break;
459 case OPT_fgnu_intrinsics_delete:
460 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDELETED);
461 break;
463 case OPT_fgnu_intrinsics_hide:
464 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateHIDDEN);
465 break;
467 case OPT_fgnu_intrinsics_disable:
468 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDISABLED);
469 break;
471 case OPT_fgnu_intrinsics_enable:
472 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateENABLED);
473 break;
475 case OPT_ff2c_intrinsics_delete:
476 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDELETED);
477 break;
479 case OPT_ff2c_intrinsics_hide:
480 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateHIDDEN);
481 break;
483 case OPT_ff2c_intrinsics_disable:
484 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDISABLED);
485 break;
487 case OPT_ff2c_intrinsics_enable:
488 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateENABLED);
489 break;
491 case OPT_ff90_intrinsics_delete:
492 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDELETED);
493 break;
495 case OPT_ff90_intrinsics_hide:
496 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateHIDDEN);
497 break;
499 case OPT_ff90_intrinsics_disable:
500 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDISABLED);
501 break;
503 case OPT_ff90_intrinsics_enable:
504 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateENABLED);
505 break;
507 case OPT_fmil_intrinsics_delete:
508 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDELETED);
509 break;
511 case OPT_fmil_intrinsics_hide:
512 ffe_set_intrinsic_state_mil (FFE_intrinsicstateHIDDEN);
513 break;
515 case OPT_fmil_intrinsics_disable:
516 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDISABLED);
517 break;
519 case OPT_fmil_intrinsics_enable:
520 ffe_set_intrinsic_state_mil (FFE_intrinsicstateENABLED);
521 break;
523 case OPT_funix_intrinsics_delete:
524 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDELETED);
525 break;
527 case OPT_funix_intrinsics_hide:
528 ffe_set_intrinsic_state_unix (FFE_intrinsicstateHIDDEN);
529 break;
531 case OPT_funix_intrinsics_disable:
532 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDISABLED);
533 break;
535 case OPT_funix_intrinsics_enable:
536 ffe_set_intrinsic_state_unix (FFE_intrinsicstateENABLED);
537 break;
539 case OPT_fvxt_intrinsics_delete:
540 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDELETED);
541 break;
543 case OPT_fvxt_intrinsics_hide:
544 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateHIDDEN);
545 break;
547 case OPT_fvxt_intrinsics_disable:
548 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDISABLED);
549 break;
551 case OPT_fvxt_intrinsics_enable:
552 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED);
553 break;
555 case OPT_ffixed_line_length_:
556 if (strcmp (arg, "none") == 0)
557 ffe_set_fixed_line_length (0);
558 else if (ffe_is_digit_string_ (arg))
559 ffe_set_fixed_line_length (atol (arg));
560 else
561 return 0;
562 break;
564 case OPT_Wcomment:
565 case OPT_Wcomments:
566 case OPT_Wimport:
567 case OPT_Wtrigraphs:
568 case OPT_fpreprocessed:
569 /* These are for cpp. */
570 break;
572 case OPT_Wglobals:
573 ffe_set_is_warn_globals (value);
574 break;
576 case OPT_Wimplicit:
577 ffe_set_is_warn_implicit (value);
578 break;
580 case OPT_Wsurprising:
581 ffe_set_is_warn_surprising (value);
582 break;
584 case OPT_Wall:
585 set_Wunused (value);
586 /* We save the value of warn_uninitialized, since if they put
587 -Wuninitialized on the command line, we need to generate a
588 warning about not using it without also specifying -O. */
589 if (value)
591 if (warn_uninitialized != 1)
592 warn_uninitialized = 2;
594 else
595 warn_uninitialized = 0;
596 break;
598 case OPT_I:
599 ffecom_decode_include_option (arg);
600 break;
603 return 1;
606 /* Run the FFE on a source file (not an INCLUDEd file).
608 Runs the whole shebang.
610 Prepare and invoke the appropriate lexer. */
612 void
613 ffe_file (ffewhereFile wf, FILE *f)
615 ffe_init_1 ();
616 ffelex_set_handler ((ffelexHandler) ffest_first);
617 ffewhere_file_set (wf, TRUE, 0);
618 if (ffe_is_free_form_)
619 ffelex_file_free (wf, f);
620 else
621 ffelex_file_fixed (wf, f);
622 ffest_eof ();
623 ffe_terminate_1 ();
626 /* ffe_init_0 -- Initialize the FFE per image invocation
628 ffe_init_0();
630 Performs per-image invocation. */
632 void
633 ffe_init_0 (void)
635 ++ffe_count_0;
636 ffe_in_0 = TRUE;
638 ffebad_init_0 ();
639 ffebit_init_0 ();
640 ffebld_init_0 ();
641 ffecom_init_0 ();
642 ffedata_init_0 ();
643 ffeequiv_init_0 ();
644 ffeexpr_init_0 ();
645 ffeglobal_init_0 ();
646 ffeimplic_init_0 ();
647 ffeinfo_init_0 ();
648 ffeintrin_init_0 ();
649 ffelab_init_0 ();
650 ffelex_init_0 ();
651 ffename_init_0 ();
652 ffesrc_init_0 ();
653 ffest_init_0 ();
654 ffestorag_init_0 ();
655 ffesymbol_init_0 ();
656 ffetarget_init_0 ();
657 ffetype_init_0 ();
658 ffewhere_init_0 ();
661 /* ffe_init_1 -- Initialize the FFE per source file
663 ffe_init_1();
665 Performs per-source-file invocation (not including INCLUDEd files). */
667 void
668 ffe_init_1 (void)
670 ++ffe_count_1;
671 ffe_in_1 = TRUE;
673 assert (ffe_file_pool_ == NULL);
674 ffe_file_pool_ = malloc_pool_new ("File", malloc_pool_image (), 1024);
676 ffebad_init_1 ();
677 ffebit_init_1 ();
678 ffebld_init_1 ();
679 ffecom_init_1 ();
680 ffedata_init_1 ();
681 ffeequiv_init_1 ();
682 ffeexpr_init_1 ();
683 ffeglobal_init_1 ();
684 ffeimplic_init_1 ();
685 ffeinfo_init_1 ();
686 ffeintrin_init_1 ();
687 ffelab_init_1 ();
688 ffelex_init_1 ();
689 ffename_init_1 ();
690 ffesrc_init_1 ();
691 ffest_init_1 ();
692 ffestorag_init_1 ();
693 ffesymbol_init_1 ();
694 ffetarget_init_1 ();
695 ffetype_init_1 ();
696 ffewhere_init_1 ();
698 ffe_init_2 ();
701 /* ffe_init_2 -- Initialize the FFE per outer program unit
703 ffe_init_2();
705 Performs per-program-unit invocation. */
707 void
708 ffe_init_2 (void)
710 ++ffe_count_2;
711 ffe_in_2 = TRUE;
713 assert (ffe_program_unit_pool_ == NULL);
714 ffe_program_unit_pool_ = malloc_pool_new ("Program unit", ffe_file_pool_, 1024);
715 ffe_is_mainprog_ = FALSE;
716 ffe_is_saveall_ = !ffe_is_automatic_;
718 ffebad_init_2 ();
719 ffebit_init_2 ();
720 ffebld_init_2 ();
721 ffecom_init_2 ();
722 ffedata_init_2 ();
723 ffeequiv_init_2 ();
724 ffeexpr_init_2 ();
725 ffeglobal_init_2 ();
726 ffeimplic_init_2 ();
727 ffeinfo_init_2 ();
728 ffeintrin_init_2 ();
729 ffelab_init_2 ();
730 ffelex_init_2 ();
731 ffename_init_2 ();
732 ffesrc_init_2 ();
733 ffest_init_2 ();
734 ffestorag_init_2 ();
735 ffesymbol_init_2 ();
736 ffetarget_init_2 ();
737 ffetype_init_2 ();
738 ffewhere_init_2 ();
740 ffe_init_3 ();
743 /* ffe_init_3 -- Initialize the FFE per any program unit
745 ffe_init_3();
747 Performs per-any-unit initialization; does NOT do
748 per-statement-function-definition initialization (i.e. the chain
749 of inits, from 0-3, breaks here; level 4 must be invoked independently). */
751 void
752 ffe_init_3 (void)
754 ++ffe_count_3;
755 ffe_in_3 = TRUE;
757 assert (ffe_any_unit_pool_ == NULL);
758 ffe_any_unit_pool_ = malloc_pool_new ("Any unit", ffe_program_unit_pool_, 1024);
760 ffebad_init_3 ();
761 ffebit_init_3 ();
762 ffebld_init_3 ();
763 ffecom_init_3 ();
764 ffedata_init_3 ();
765 ffeequiv_init_3 ();
766 ffeexpr_init_3 ();
767 ffeglobal_init_3 ();
768 ffeimplic_init_3 ();
769 ffeinfo_init_3 ();
770 ffeintrin_init_3 ();
771 ffelab_init_3 ();
772 ffelex_init_3 ();
773 ffename_init_3 ();
774 ffesrc_init_3 ();
775 ffest_init_3 ();
776 ffestorag_init_3 ();
777 ffesymbol_init_3 ();
778 ffetarget_init_3 ();
779 ffetype_init_3 ();
780 ffewhere_init_3 ();
783 /* ffe_init_4 -- Initialize the FFE per statement function definition
785 ffe_init_4(); */
787 void
788 ffe_init_4 (void)
790 ++ffe_count_4;
791 ffe_in_4 = TRUE;
793 ffebad_init_4 ();
794 ffebit_init_4 ();
795 ffebld_init_4 ();
796 ffecom_init_4 ();
797 ffedata_init_4 ();
798 ffeequiv_init_4 ();
799 ffeexpr_init_4 ();
800 ffeglobal_init_4 ();
801 ffeimplic_init_4 ();
802 ffeinfo_init_4 ();
803 ffeintrin_init_4 ();
804 ffelab_init_4 ();
805 ffelex_init_4 ();
806 ffename_init_4 ();
807 ffesrc_init_4 ();
808 ffest_init_4 ();
809 ffestorag_init_4 ();
810 ffesymbol_init_4 ();
811 ffetarget_init_4 ();
812 ffetype_init_4 ();
813 ffewhere_init_4 ();
816 /* ffe_terminate_0 -- Terminate the FFE prior to image termination
818 ffe_terminate_0(); */
820 void
821 ffe_terminate_0 (void)
823 ffe_count_1 = 0;
824 ffe_in_0 = FALSE;
826 ffebad_terminate_0 ();
827 ffebit_terminate_0 ();
828 ffebld_terminate_0 ();
829 ffecom_terminate_0 ();
830 ffedata_terminate_0 ();
831 ffeequiv_terminate_0 ();
832 ffeexpr_terminate_0 ();
833 ffeglobal_terminate_0 ();
834 ffeimplic_terminate_0 ();
835 ffeinfo_terminate_0 ();
836 ffeintrin_terminate_0 ();
837 ffelab_terminate_0 ();
838 ffelex_terminate_0 ();
839 ffename_terminate_0 ();
840 ffesrc_terminate_0 ();
841 ffest_terminate_0 ();
842 ffestorag_terminate_0 ();
843 ffesymbol_terminate_0 ();
844 ffetarget_terminate_0 ();
845 ffetype_terminate_0 ();
846 ffewhere_terminate_0 ();
849 /* ffe_terminate_1 -- Terminate the FFE after seeing source file EOF
851 ffe_terminate_1(); */
853 void
854 ffe_terminate_1 (void)
856 ffe_count_2 = 0;
857 ffe_in_1 = FALSE;
859 ffe_terminate_2 ();
861 ffebad_terminate_1 ();
862 ffebit_terminate_1 ();
863 ffebld_terminate_1 ();
864 ffecom_terminate_1 ();
865 ffedata_terminate_1 ();
866 ffeequiv_terminate_1 ();
867 ffeexpr_terminate_1 ();
868 ffeglobal_terminate_1 ();
869 ffeimplic_terminate_1 ();
870 ffeinfo_terminate_1 ();
871 ffeintrin_terminate_1 ();
872 ffelab_terminate_1 ();
873 ffelex_terminate_1 ();
874 ffename_terminate_1 ();
875 ffesrc_terminate_1 ();
876 ffest_terminate_1 ();
877 ffestorag_terminate_1 ();
878 ffesymbol_terminate_1 ();
879 ffetarget_terminate_1 ();
880 ffetype_terminate_1 ();
881 ffewhere_terminate_1 ();
883 assert (ffe_file_pool_ != NULL);
884 malloc_pool_kill (ffe_file_pool_);
885 ffe_file_pool_ = NULL;
888 /* ffe_terminate_2 -- Terminate the FFE after seeing outer program unit END
890 ffe_terminate_2(); */
892 void
893 ffe_terminate_2 (void)
895 ffe_count_3 = 0;
896 ffe_in_2 = FALSE;
898 ffe_terminate_3 ();
900 ffebad_terminate_2 ();
901 ffebit_terminate_2 ();
902 ffebld_terminate_2 ();
903 ffecom_terminate_2 ();
904 ffedata_terminate_2 ();
905 ffeequiv_terminate_2 ();
906 ffeexpr_terminate_2 ();
907 ffeglobal_terminate_2 ();
908 ffeimplic_terminate_2 ();
909 ffeinfo_terminate_2 ();
910 ffeintrin_terminate_2 ();
911 ffelab_terminate_2 ();
912 ffelex_terminate_2 ();
913 ffename_terminate_2 ();
914 ffesrc_terminate_2 ();
915 ffest_terminate_2 ();
916 ffestorag_terminate_2 ();
917 ffesymbol_terminate_2 ();
918 ffetarget_terminate_2 ();
919 ffetype_terminate_2 ();
920 ffewhere_terminate_2 ();
922 assert (ffe_program_unit_pool_ != NULL);
923 malloc_pool_kill (ffe_program_unit_pool_);
924 ffe_program_unit_pool_ = NULL;
927 /* ffe_terminate_3 -- Terminate the FFE after seeing any program unit END
929 ffe_terminate_3(); */
931 void
932 ffe_terminate_3 (void)
934 ffe_count_4 = 0;
935 ffe_in_3 = FALSE;
937 ffebad_terminate_3 ();
938 ffebit_terminate_3 ();
939 ffebld_terminate_3 ();
940 ffecom_terminate_3 ();
941 ffedata_terminate_3 ();
942 ffeequiv_terminate_3 ();
943 ffeexpr_terminate_3 ();
944 ffeglobal_terminate_3 ();
945 ffeimplic_terminate_3 ();
946 ffeinfo_terminate_3 ();
947 ffeintrin_terminate_3 ();
948 ffelab_terminate_3 ();
949 ffelex_terminate_3 ();
950 ffename_terminate_3 ();
951 ffesrc_terminate_3 ();
952 ffest_terminate_3 ();
953 ffestorag_terminate_3 ();
954 ffesymbol_terminate_3 ();
955 ffetarget_terminate_3 ();
956 ffetype_terminate_3 ();
957 ffewhere_terminate_3 ();
959 assert (ffe_any_unit_pool_ != NULL);
960 malloc_pool_kill (ffe_any_unit_pool_);
961 ffe_any_unit_pool_ = NULL;
964 /* ffe_terminate_4 -- Terminate the FFE after seeing sfunc def expression
966 ffe_terminate_4(); */
968 void
969 ffe_terminate_4 (void)
971 ffe_in_4 = FALSE;
973 ffebad_terminate_4 ();
974 ffebit_terminate_4 ();
975 ffebld_terminate_4 ();
976 ffecom_terminate_4 ();
977 ffedata_terminate_4 ();
978 ffeequiv_terminate_4 ();
979 ffeexpr_terminate_4 ();
980 ffeglobal_terminate_4 ();
981 ffeimplic_terminate_4 ();
982 ffeinfo_terminate_4 ();
983 ffeintrin_terminate_4 ();
984 ffelab_terminate_4 ();
985 ffelex_terminate_4 ();
986 ffename_terminate_4 ();
987 ffesrc_terminate_4 ();
988 ffest_terminate_4 ();
989 ffestorag_terminate_4 ();
990 ffesymbol_terminate_4 ();
991 ffetarget_terminate_4 ();
992 ffetype_terminate_4 ();
993 ffewhere_terminate_4 ();