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)
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
26 The GNU Fortran Front End.
59 /* Externals defined here. */
61 bool ffe_is_do_internal_checks_ = FALSE;
62 bool ffe_is_90_ = FFETARGET_defaultIS_90;
63 bool ffe_is_automatic_ = FFETARGET_defaultIS_AUTOMATIC;
64 bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH;
65 bool ffe_is_emulate_complex_ = FALSE;
66 bool ffe_is_underscoring_ = FFETARGET_defaultEXTERNAL_UNDERSCORED
67 || FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
68 bool ffe_is_second_underscore_ = FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
69 bool ffe_is_debug_kludge_ = FALSE;
70 bool ffe_is_dollar_ok_ = FFETARGET_defaultIS_DOLLAR_OK;
71 bool ffe_is_f2c_ = FFETARGET_defaultIS_F2C;
72 bool ffe_is_f2c_library_ = FFETARGET_defaultIS_F2C_LIBRARY;
73 bool ffe_is_ffedebug_ = FALSE;
74 bool ffe_is_flatten_arrays_ = FALSE;
75 bool ffe_is_free_form_ = FFETARGET_defaultIS_FREE_FORM;
76 bool ffe_is_globals_ = TRUE;
77 bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
78 bool ffe_is_mainprog_; /* TRUE if current prog unit known to be
80 bool ffe_is_onetrip_ = FALSE;
81 bool ffe_is_silent_ = TRUE;
82 bool ffe_is_typeless_boz_ = FALSE;
83 bool ffe_is_pedantic_ = FFETARGET_defaultIS_PEDANTIC;
84 bool ffe_is_saveall_; /* TRUE if mainprog or SAVE (no args) seen. */
85 bool ffe_is_ugly_args_ = TRUE;
86 bool ffe_is_ugly_assign_ = FALSE; /* Try and store pointer to ASSIGN labels in INTEGER vars. */
87 bool ffe_is_ugly_assumed_ = FALSE; /* DIMENSION X([...,]1) => DIMENSION X([...,]*) */
88 bool ffe_is_ugly_comma_ = FALSE;
89 bool ffe_is_ugly_complex_ = FALSE;
90 bool ffe_is_ugly_init_ = TRUE;
91 bool ffe_is_ugly_logint_ = FALSE;
92 bool ffe_is_version_ = FALSE;
93 bool ffe_is_vxt_ = FALSE;
94 bool ffe_is_warn_globals_ = TRUE;
95 bool ffe_is_warn_implicit_ = FALSE;
96 bool ffe_is_warn_surprising_ = FALSE;
97 bool ffe_is_zeros_ = FALSE;
98 ffeCase ffe_case_intrin_ = FFETARGET_defaultCASE_INTRIN;
99 ffeCase ffe_case_match_ = FFETARGET_defaultCASE_MATCH;
100 ffeCase ffe_case_source_ = FFETARGET_defaultCASE_SOURCE;
101 ffeCase ffe_case_symbol_ = FFETARGET_defaultCASE_SYMBOL;
102 ffeIntrinsicState ffe_intrinsic_state_badu77_ = FFE_intrinsicstateENABLED;
103 ffeIntrinsicState ffe_intrinsic_state_gnu_ = FFE_intrinsicstateENABLED;
104 ffeIntrinsicState ffe_intrinsic_state_f2c_ = FFE_intrinsicstateENABLED;
105 ffeIntrinsicState ffe_intrinsic_state_f90_ = FFE_intrinsicstateENABLED;
106 ffeIntrinsicState ffe_intrinsic_state_mil_ = FFE_intrinsicstateENABLED;
107 ffeIntrinsicState ffe_intrinsic_state_unix_ = FFE_intrinsicstateENABLED;
108 ffeIntrinsicState ffe_intrinsic_state_vxt_ = FFE_intrinsicstateENABLED;
109 int ffe_fixed_line_length_ = FFETARGET_defaultFIXED_LINE_LENGTH;
110 mallocPool ffe_file_pool_ = NULL;
111 mallocPool ffe_any_unit_pool_ = NULL;
112 mallocPool ffe_program_unit_pool_ = NULL;
113 ffeCounter ffe_count_0 = 0;
114 ffeCounter ffe_count_1 = 0;
115 ffeCounter ffe_count_2 = 0;
116 ffeCounter ffe_count_3 = 0;
117 ffeCounter ffe_count_4 = 0;
118 bool ffe_in_0 = FALSE;
119 bool ffe_in_1 = FALSE;
120 bool ffe_in_2 = FALSE;
121 bool ffe_in_3 = FALSE;
122 bool ffe_in_4 = FALSE;
124 /* Simple definitions and enumerations. */
127 /* Internal typedefs. */
130 /* Private include files. */
133 /* Internal structure definitions. */
136 /* Static objects accessed by functions in this module. */
139 /* Static functions (internal). */
141 static bool ffe_is_digit_string_ (char *s);
143 /* Internal macros. */
146 ffe_is_digit_string_ (char *s)
150 for (p = s; ISDIGIT (*p); ++p)
153 return (p != s) && (*p == '\0');
156 /* Handle command-line options. Returns 0 if unrecognized, 1 if
157 recognized and handled. */
160 ffe_decode_option (argc, argv)
161 int argc ATTRIBUTE_UNUSED;
169 if (strcmp (&opt[2], "version") == 0)
171 ffe_set_is_version (TRUE);
172 ffe_set_is_do_internal_checks (TRUE);
174 else if (strcmp (&opt[2], "f66") == 0)
176 ffe_set_is_onetrip (TRUE);
177 ffe_set_is_ugly_assumed (TRUE);
179 else if (strcmp (&opt[2], "no-f66") == 0)
181 ffe_set_is_onetrip (FALSE);
182 ffe_set_is_ugly_assumed (FALSE);
184 else if (strcmp (&opt[2], "f77") == 0)
186 ffe_set_is_backslash (TRUE);
187 ffe_set_is_typeless_boz (FALSE);
189 else if (strcmp (&opt[2], "no-f77") == 0)
191 ffe_set_is_backslash (FALSE);
193 else if (strcmp (&opt[2], "f90") == 0)
194 ffe_set_is_90 (TRUE);
195 else if (strcmp (&opt[2], "no-f90") == 0)
196 ffe_set_is_90 (FALSE);
197 else if (strcmp (&opt[2], "automatic") == 0)
198 ffe_set_is_automatic (TRUE);
199 else if (strcmp (&opt[2], "no-automatic") == 0)
200 ffe_set_is_automatic (FALSE);
201 else if (strcmp (&opt[2], "dollar-ok") == 0)
202 ffe_set_is_dollar_ok (TRUE);
203 else if (strcmp (&opt[2], "no-dollar-ok") == 0)
204 ffe_set_is_dollar_ok (FALSE);
205 else if (strcmp (&opt[2], "f2c") == 0)
206 ffe_set_is_f2c (TRUE);
207 else if (strcmp (&opt[2], "no-f2c") == 0)
208 ffe_set_is_f2c (FALSE);
209 else if (strcmp (&opt[2], "f2c-library") == 0)
210 ffe_set_is_f2c_library (TRUE);
211 else if (strcmp (&opt[2], "no-f2c-library") == 0)
212 ffe_set_is_f2c_library (FALSE);
213 else if (strcmp (&opt[2], "flatten-arrays") == 0)
214 ffe_set_is_flatten_arrays (TRUE);
215 else if (strcmp (&opt[2], "no-flatten-arrays") == 0)
216 ffe_set_is_flatten_arrays (FALSE);
217 else if (strcmp (&opt[2], "free-form") == 0)
218 ffe_set_is_free_form (TRUE);
219 else if (strcmp (&opt[2], "no-free-form") == 0)
220 ffe_set_is_free_form (FALSE);
221 else if (strcmp (&opt[2], "fixed-form") == 0)
223 ffe_set_is_free_form (FALSE);
226 else if (strcmp (&opt[2], "no-fixed-form") == 0)
227 ffe_set_is_free_form (TRUE);
228 else if (strcmp (&opt[2], "pedantic") == 0)
229 ffe_set_is_pedantic (TRUE);
230 else if (strcmp (&opt[2], "no-pedantic") == 0)
231 ffe_set_is_pedantic (FALSE);
232 else if (strcmp (&opt[2], "vxt") == 0)
233 ffe_set_is_vxt (TRUE);
234 else if (strcmp (&opt[2], "not-vxt") == 0)
235 ffe_set_is_vxt (FALSE);
236 else if (strcmp (&opt[2], "vxt-not-f90") == 0)
237 warning ("%s no longer supported -- try -fvxt", opt);
238 else if (strcmp (&opt[2], "f90-not-vxt") == 0)
239 warning ("%s no longer supported -- try -fno-vxt -ff90", opt);
240 else if (strcmp (&opt[2], "no-ugly") == 0)
242 ffe_set_is_ugly_args (FALSE);
243 ffe_set_is_ugly_assign (FALSE);
244 ffe_set_is_ugly_assumed (FALSE);
245 ffe_set_is_ugly_comma (FALSE);
246 ffe_set_is_ugly_complex (FALSE);
247 ffe_set_is_ugly_init (FALSE);
248 ffe_set_is_ugly_logint (FALSE);
250 else if (strcmp (&opt[2], "ugly-args") == 0)
251 ffe_set_is_ugly_args (TRUE);
252 else if (strcmp (&opt[2], "no-ugly-args") == 0)
253 ffe_set_is_ugly_args (FALSE);
254 else if (strcmp (&opt[2], "ugly-assign") == 0)
255 ffe_set_is_ugly_assign (TRUE);
256 else if (strcmp (&opt[2], "no-ugly-assign") == 0)
257 ffe_set_is_ugly_assign (FALSE);
258 else if (strcmp (&opt[2], "ugly-assumed") == 0)
259 ffe_set_is_ugly_assumed (TRUE);
260 else if (strcmp (&opt[2], "no-ugly-assumed") == 0)
261 ffe_set_is_ugly_assumed (FALSE);
262 else if (strcmp (&opt[2], "ugly-comma") == 0)
263 ffe_set_is_ugly_comma (TRUE);
264 else if (strcmp (&opt[2], "no-ugly-comma") == 0)
265 ffe_set_is_ugly_comma (FALSE);
266 else if (strcmp (&opt[2], "ugly-complex") == 0)
267 ffe_set_is_ugly_complex (TRUE);
268 else if (strcmp (&opt[2], "no-ugly-complex") == 0)
269 ffe_set_is_ugly_complex (FALSE);
270 else if (strcmp (&opt[2], "ugly-init") == 0)
271 ffe_set_is_ugly_init (TRUE);
272 else if (strcmp (&opt[2], "no-ugly-init") == 0)
273 ffe_set_is_ugly_init (FALSE);
274 else if (strcmp (&opt[2], "ugly-logint") == 0)
275 ffe_set_is_ugly_logint (TRUE);
276 else if (strcmp (&opt[2], "no-ugly-logint") == 0)
277 ffe_set_is_ugly_logint (FALSE);
278 else if (strcmp (&opt[2], "xyzzy") == 0)
279 ffe_set_is_ffedebug (TRUE);
280 else if (strcmp (&opt[2], "no-xyzzy") == 0)
281 ffe_set_is_ffedebug (FALSE);
282 else if (strcmp (&opt[2], "init-local-zero") == 0)
283 ffe_set_is_init_local_zero (TRUE);
284 else if (strcmp (&opt[2], "no-init-local-zero") == 0)
285 ffe_set_is_init_local_zero (FALSE);
286 else if (strcmp (&opt[2], "emulate-complex") == 0)
287 ffe_set_is_emulate_complex (TRUE);
288 else if (strcmp (&opt[2], "no-emulate-complex") == 0)
289 ffe_set_is_emulate_complex (FALSE);
290 else if (strcmp (&opt[2], "backslash") == 0)
291 ffe_set_is_backslash (TRUE);
292 else if (strcmp (&opt[2], "no-backslash") == 0)
293 ffe_set_is_backslash (FALSE);
294 else if (strcmp (&opt[2], "underscoring") == 0)
295 ffe_set_is_underscoring (TRUE);
296 else if (strcmp (&opt[2], "no-underscoring") == 0)
297 ffe_set_is_underscoring (FALSE);
298 else if (strcmp (&opt[2], "second-underscore") == 0)
299 ffe_set_is_second_underscore (TRUE);
300 else if (strcmp (&opt[2], "no-second-underscore") == 0)
301 ffe_set_is_second_underscore (FALSE);
302 else if (strcmp (&opt[2], "zeros") == 0)
303 ffe_set_is_zeros (TRUE);
304 else if (strcmp (&opt[2], "no-zeros") == 0)
305 ffe_set_is_zeros (FALSE);
306 else if (strcmp (&opt[2], "debug-kludge") == 0)
307 warning ("%s disabled, use normal debugging flags", opt);
308 else if (strcmp (&opt[2], "no-debug-kludge") == 0)
309 warning ("%s disabled, use normal debugging flags", opt);
310 else if (strcmp (&opt[2], "onetrip") == 0)
311 ffe_set_is_onetrip (TRUE);
312 else if (strcmp (&opt[2], "no-onetrip") == 0)
313 ffe_set_is_onetrip (FALSE);
314 else if (strcmp (&opt[2], "silent") == 0)
315 ffe_set_is_silent (TRUE);
316 else if (strcmp (&opt[2], "no-silent") == 0)
317 ffe_set_is_silent (FALSE);
318 else if (strcmp (&opt[2], "globals") == 0)
319 ffe_set_is_globals (TRUE);
320 else if (strcmp (&opt[2], "no-globals") == 0)
321 ffe_set_is_globals (FALSE);
322 else if (strcmp (&opt[2], "fortran-bounds-check") == 0)
323 flag_bounds_check = TRUE;
324 else if (strcmp (&opt[2], "no-fortran-bounds-check") == 0)
325 flag_bounds_check = FALSE;
326 else if (strcmp (&opt[2], "typeless-boz") == 0)
327 ffe_set_is_typeless_boz (TRUE);
328 else if (strcmp (&opt[2], "no-typeless-boz") == 0)
329 ffe_set_is_typeless_boz (FALSE);
330 else if (strcmp (&opt[2], "intrin-case-initcap") == 0)
331 ffe_set_case_intrin (FFE_caseINITCAP);
332 else if (strcmp (&opt[2], "intrin-case-upper") == 0)
333 ffe_set_case_intrin (FFE_caseUPPER);
334 else if (strcmp (&opt[2], "intrin-case-lower") == 0)
335 ffe_set_case_intrin (FFE_caseLOWER);
336 else if (strcmp (&opt[2], "intrin-case-any") == 0)
337 ffe_set_case_intrin (FFE_caseNONE);
338 else if (strcmp (&opt[2], "match-case-initcap") == 0)
339 ffe_set_case_match (FFE_caseINITCAP);
340 else if (strcmp (&opt[2], "match-case-upper") == 0)
341 ffe_set_case_match (FFE_caseUPPER);
342 else if (strcmp (&opt[2], "match-case-lower") == 0)
343 ffe_set_case_match (FFE_caseLOWER);
344 else if (strcmp (&opt[2], "match-case-any") == 0)
345 ffe_set_case_match (FFE_caseNONE);
346 else if (strcmp (&opt[2], "source-case-upper") == 0)
347 ffe_set_case_source (FFE_caseUPPER);
348 else if (strcmp (&opt[2], "source-case-lower") == 0)
349 ffe_set_case_source (FFE_caseLOWER);
350 else if (strcmp (&opt[2], "source-case-preserve") == 0)
351 ffe_set_case_source (FFE_caseNONE);
352 else if (strcmp (&opt[2], "symbol-case-initcap") == 0)
353 ffe_set_case_symbol (FFE_caseINITCAP);
354 else if (strcmp (&opt[2], "symbol-case-upper") == 0)
355 ffe_set_case_symbol (FFE_caseUPPER);
356 else if (strcmp (&opt[2], "symbol-case-lower") == 0)
357 ffe_set_case_symbol (FFE_caseLOWER);
358 else if (strcmp (&opt[2], "symbol-case-any") == 0)
359 ffe_set_case_symbol (FFE_caseNONE);
360 else if (strcmp (&opt[2], "case-strict-upper") == 0)
362 ffe_set_case_intrin (FFE_caseUPPER);
363 ffe_set_case_match (FFE_caseUPPER);
364 ffe_set_case_source (FFE_caseNONE);
365 ffe_set_case_symbol (FFE_caseUPPER);
367 else if (strcmp (&opt[2], "case-strict-lower") == 0)
369 ffe_set_case_intrin (FFE_caseLOWER);
370 ffe_set_case_match (FFE_caseLOWER);
371 ffe_set_case_source (FFE_caseNONE);
372 ffe_set_case_symbol (FFE_caseLOWER);
374 else if (strcmp (&opt[2], "case-initcap") == 0)
376 ffe_set_case_intrin (FFE_caseINITCAP);
377 ffe_set_case_match (FFE_caseINITCAP);
378 ffe_set_case_source (FFE_caseNONE);
379 ffe_set_case_symbol (FFE_caseINITCAP);
381 else if (strcmp (&opt[2], "case-upper") == 0)
383 ffe_set_case_intrin (FFE_caseNONE);
384 ffe_set_case_match (FFE_caseNONE);
385 ffe_set_case_source (FFE_caseUPPER);
386 ffe_set_case_symbol (FFE_caseNONE);
388 else if (strcmp (&opt[2], "case-lower") == 0)
390 ffe_set_case_intrin (FFE_caseNONE);
391 ffe_set_case_match (FFE_caseNONE);
392 ffe_set_case_source (FFE_caseLOWER);
393 ffe_set_case_symbol (FFE_caseNONE);
395 else if (strcmp (&opt[2], "case-preserve") == 0)
397 ffe_set_case_intrin (FFE_caseNONE);
398 ffe_set_case_match (FFE_caseNONE);
399 ffe_set_case_source (FFE_caseNONE);
400 ffe_set_case_symbol (FFE_caseNONE);
402 else if (strcmp (&opt[2], "badu77-intrinsics-delete") == 0)
403 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDELETED);
404 else if (strcmp (&opt[2], "badu77-intrinsics-hide") == 0)
405 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateHIDDEN);
406 else if (strcmp (&opt[2], "badu77-intrinsics-disable") == 0)
407 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDISABLED);
408 else if (strcmp (&opt[2], "badu77-intrinsics-enable") == 0)
409 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateENABLED);
410 else if (strcmp (&opt[2], "gnu-intrinsics-delete") == 0)
411 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDELETED);
412 else if (strcmp (&opt[2], "gnu-intrinsics-hide") == 0)
413 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateHIDDEN);
414 else if (strcmp (&opt[2], "gnu-intrinsics-disable") == 0)
415 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDISABLED);
416 else if (strcmp (&opt[2], "gnu-intrinsics-enable") == 0)
417 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateENABLED);
418 else if (strcmp (&opt[2], "f2c-intrinsics-delete") == 0)
419 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDELETED);
420 else if (strcmp (&opt[2], "f2c-intrinsics-hide") == 0)
421 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateHIDDEN);
422 else if (strcmp (&opt[2], "f2c-intrinsics-disable") == 0)
423 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDISABLED);
424 else if (strcmp (&opt[2], "f2c-intrinsics-enable") == 0)
425 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateENABLED);
426 else if (strcmp (&opt[2], "f90-intrinsics-delete") == 0)
427 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDELETED);
428 else if (strcmp (&opt[2], "f90-intrinsics-hide") == 0)
429 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateHIDDEN);
430 else if (strcmp (&opt[2], "f90-intrinsics-disable") == 0)
431 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDISABLED);
432 else if (strcmp (&opt[2], "f90-intrinsics-enable") == 0)
433 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateENABLED);
434 else if (strcmp (&opt[2], "mil-intrinsics-delete") == 0)
435 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDELETED);
436 else if (strcmp (&opt[2], "mil-intrinsics-hide") == 0)
437 ffe_set_intrinsic_state_mil (FFE_intrinsicstateHIDDEN);
438 else if (strcmp (&opt[2], "mil-intrinsics-disable") == 0)
439 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDISABLED);
440 else if (strcmp (&opt[2], "mil-intrinsics-enable") == 0)
441 ffe_set_intrinsic_state_mil (FFE_intrinsicstateENABLED);
442 else if (strcmp (&opt[2], "unix-intrinsics-delete") == 0)
443 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDELETED);
444 else if (strcmp (&opt[2], "unix-intrinsics-hide") == 0)
445 ffe_set_intrinsic_state_unix (FFE_intrinsicstateHIDDEN);
446 else if (strcmp (&opt[2], "unix-intrinsics-disable") == 0)
447 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDISABLED);
448 else if (strcmp (&opt[2], "unix-intrinsics-enable") == 0)
449 ffe_set_intrinsic_state_unix (FFE_intrinsicstateENABLED);
450 else if (strcmp (&opt[2], "vxt-intrinsics-delete") == 0)
451 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDELETED);
452 else if (strcmp (&opt[2], "vxt-intrinsics-hide") == 0)
453 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateHIDDEN);
454 else if (strcmp (&opt[2], "vxt-intrinsics-disable") == 0)
455 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDISABLED);
456 else if (strcmp (&opt[2], "vxt-intrinsics-enable") == 0)
457 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED);
458 else if (strncmp (&opt[2], "fixed-line-length-",
459 strlen ("fixed-line-length-")) == 0)
461 char *len = &opt[2] + strlen ("fixed-line-length-");
463 if (strcmp (len, "none") == 0)
465 ffe_set_fixed_line_length (0);
468 else if (ffe_is_digit_string_ (len))
470 ffe_set_fixed_line_length (atol (len));
479 else if (opt[1] == 'W')
481 if (!strcmp (&opt[2], "comment"))
482 ; /* cpp handles this one. */
483 else if (!strcmp (&opt[2], "no-comment"))
484 ; /* cpp handles this one. */
485 else if (!strcmp (&opt[2], "comments"))
486 ; /* cpp handles this one. */
487 else if (!strcmp (&opt[2], "no-comments"))
488 ; /* cpp handles this one. */
489 else if (!strcmp (&opt[2], "trigraphs"))
490 ; /* cpp handles this one. */
491 else if (!strcmp (&opt[2], "no-trigraphs"))
492 ; /* cpp handles this one. */
493 else if (!strcmp (&opt[2], "import"))
494 ; /* cpp handles this one. */
495 else if (!strcmp (&opt[2], "no-import"))
496 ; /* cpp handles this one. */
497 else if (!strcmp (&opt[2], "globals"))
498 ffe_set_is_warn_globals (TRUE);
499 else if (!strcmp (&opt[2], "no-globals"))
500 ffe_set_is_warn_globals (FALSE);
501 else if (!strcmp (&opt[2], "implicit"))
502 ffe_set_is_warn_implicit (TRUE);
503 else if (!strcmp (&opt[2], "no-implicit"))
504 ffe_set_is_warn_implicit (FALSE);
505 else if (!strcmp (&opt[2], "surprising"))
506 ffe_set_is_warn_surprising (TRUE);
507 else if (!strcmp (&opt[2], "no-surprising"))
508 ffe_set_is_warn_surprising (FALSE);
509 else if (!strcmp (&opt[2], "all"))
511 /* We save the value of warn_uninitialized, since if they put
512 -Wuninitialized on the command line, we need to generate a
513 warning about not using it without also specifying -O. */
514 if (warn_uninitialized != 1)
515 warn_uninitialized = 2;
521 else if (opt[1] == 'I')
522 return ffecom_decode_include_option (&opt[2]);
529 /* Run the FFE on a source file (not an INCLUDEd file).
531 Runs the whole shebang.
533 Prepare and invoke the appropriate lexer. */
536 ffe_file (ffewhereFile wf, FILE *f)
539 ffelex_set_handler ((ffelexHandler) ffest_first);
540 ffewhere_file_set (wf, TRUE, 0);
541 if (ffe_is_free_form_)
542 ffelex_file_free (wf, f);
544 ffelex_file_fixed (wf, f);
549 /* ffe_init_0 -- Initialize the FFE per image invocation
553 Performs per-image invocation. */
584 /* ffe_init_1 -- Initialize the FFE per source file
588 Performs per-source-file invocation (not including INCLUDEd files). */
596 assert (ffe_file_pool_ == NULL);
597 ffe_file_pool_ = malloc_pool_new ("File", malloc_pool_image (), 1024);
624 /* ffe_init_2 -- Initialize the FFE per outer program unit
628 Performs per-program-unit invocation. */
636 assert (ffe_program_unit_pool_ == NULL);
637 ffe_program_unit_pool_ = malloc_pool_new ("Program unit", ffe_file_pool_, 1024);
638 ffe_is_mainprog_ = FALSE;
639 ffe_is_saveall_ = !ffe_is_automatic_;
666 /* ffe_init_3 -- Initialize the FFE per any program unit
670 Performs per-any-unit initialization; does NOT do
671 per-statement-function-definition initialization (i.e. the chain
672 of inits, from 0-3, breaks here; level 4 must be invoked independently). */
680 assert (ffe_any_unit_pool_ == NULL);
681 ffe_any_unit_pool_ = malloc_pool_new ("Any unit", ffe_program_unit_pool_, 1024);
706 /* ffe_init_4 -- Initialize the FFE per statement function definition
739 /* ffe_terminate_0 -- Terminate the FFE prior to image termination
741 ffe_terminate_0(); */
749 ffebad_terminate_0 ();
750 ffebit_terminate_0 ();
751 ffebld_terminate_0 ();
752 ffecom_terminate_0 ();
753 ffedata_terminate_0 ();
754 ffeequiv_terminate_0 ();
755 ffeexpr_terminate_0 ();
756 ffeglobal_terminate_0 ();
757 ffeimplic_terminate_0 ();
758 ffeinfo_terminate_0 ();
759 ffeintrin_terminate_0 ();
760 ffelab_terminate_0 ();
761 ffelex_terminate_0 ();
762 ffename_terminate_0 ();
763 ffesrc_terminate_0 ();
764 ffest_terminate_0 ();
765 ffestorag_terminate_0 ();
766 ffesymbol_terminate_0 ();
767 ffetarget_terminate_0 ();
768 ffetype_terminate_0 ();
769 ffewhere_terminate_0 ();
772 /* ffe_terminate_1 -- Terminate the FFE after seeing source file EOF
774 ffe_terminate_1(); */
784 ffebad_terminate_1 ();
785 ffebit_terminate_1 ();
786 ffebld_terminate_1 ();
787 ffecom_terminate_1 ();
788 ffedata_terminate_1 ();
789 ffeequiv_terminate_1 ();
790 ffeexpr_terminate_1 ();
791 ffeglobal_terminate_1 ();
792 ffeimplic_terminate_1 ();
793 ffeinfo_terminate_1 ();
794 ffeintrin_terminate_1 ();
795 ffelab_terminate_1 ();
796 ffelex_terminate_1 ();
797 ffename_terminate_1 ();
798 ffesrc_terminate_1 ();
799 ffest_terminate_1 ();
800 ffestorag_terminate_1 ();
801 ffesymbol_terminate_1 ();
802 ffetarget_terminate_1 ();
803 ffetype_terminate_1 ();
804 ffewhere_terminate_1 ();
806 assert (ffe_file_pool_ != NULL);
807 malloc_pool_kill (ffe_file_pool_);
808 ffe_file_pool_ = NULL;
811 /* ffe_terminate_2 -- Terminate the FFE after seeing outer program unit END
813 ffe_terminate_2(); */
823 ffebad_terminate_2 ();
824 ffebit_terminate_2 ();
825 ffebld_terminate_2 ();
826 ffecom_terminate_2 ();
827 ffedata_terminate_2 ();
828 ffeequiv_terminate_2 ();
829 ffeexpr_terminate_2 ();
830 ffeglobal_terminate_2 ();
831 ffeimplic_terminate_2 ();
832 ffeinfo_terminate_2 ();
833 ffeintrin_terminate_2 ();
834 ffelab_terminate_2 ();
835 ffelex_terminate_2 ();
836 ffename_terminate_2 ();
837 ffesrc_terminate_2 ();
838 ffest_terminate_2 ();
839 ffestorag_terminate_2 ();
840 ffesymbol_terminate_2 ();
841 ffetarget_terminate_2 ();
842 ffetype_terminate_2 ();
843 ffewhere_terminate_2 ();
845 assert (ffe_program_unit_pool_ != NULL);
846 malloc_pool_kill (ffe_program_unit_pool_);
847 ffe_program_unit_pool_ = NULL;
850 /* ffe_terminate_3 -- Terminate the FFE after seeing any program unit END
852 ffe_terminate_3(); */
860 ffebad_terminate_3 ();
861 ffebit_terminate_3 ();
862 ffebld_terminate_3 ();
863 ffecom_terminate_3 ();
864 ffedata_terminate_3 ();
865 ffeequiv_terminate_3 ();
866 ffeexpr_terminate_3 ();
867 ffeglobal_terminate_3 ();
868 ffeimplic_terminate_3 ();
869 ffeinfo_terminate_3 ();
870 ffeintrin_terminate_3 ();
871 ffelab_terminate_3 ();
872 ffelex_terminate_3 ();
873 ffename_terminate_3 ();
874 ffesrc_terminate_3 ();
875 ffest_terminate_3 ();
876 ffestorag_terminate_3 ();
877 ffesymbol_terminate_3 ();
878 ffetarget_terminate_3 ();
879 ffetype_terminate_3 ();
880 ffewhere_terminate_3 ();
882 assert (ffe_any_unit_pool_ != NULL);
883 malloc_pool_kill (ffe_any_unit_pool_);
884 ffe_any_unit_pool_ = NULL;
887 /* ffe_terminate_4 -- Terminate the FFE after seeing sfunc def expression
889 ffe_terminate_4(); */
896 ffebad_terminate_4 ();
897 ffebit_terminate_4 ();
898 ffebld_terminate_4 ();
899 ffecom_terminate_4 ();
900 ffedata_terminate_4 ();
901 ffeequiv_terminate_4 ();
902 ffeexpr_terminate_4 ();
903 ffeglobal_terminate_4 ();
904 ffeimplic_terminate_4 ();
905 ffeinfo_terminate_4 ();
906 ffeintrin_terminate_4 ();
907 ffelab_terminate_4 ();
908 ffelex_terminate_4 ();
909 ffename_terminate_4 ();
910 ffesrc_terminate_4 ();
911 ffest_terminate_4 ();
912 ffestorag_terminate_4 ();
913 ffesymbol_terminate_4 ();
914 ffetarget_terminate_4 ();
915 ffetype_terminate_4 ();
916 ffewhere_terminate_4 ();