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