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.
56 #if FFECOM_targetCURRENT == FFECOM_targetGCC
61 /* Externals defined here. */
63 int flag_traditional; /* Shouldn't need this (C front end only)! */
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
83 bool ffe_is_null_version_ = FALSE;
84 bool ffe_is_onetrip_ = FALSE;
85 bool ffe_is_silent_ = TRUE;
86 bool ffe_is_typeless_boz_ = FALSE;
87 bool ffe_is_pedantic_ = FFETARGET_defaultIS_PEDANTIC;
88 bool ffe_is_saveall_; /* TRUE if mainprog or SAVE (no args) seen. */
89 bool ffe_is_ugly_args_ = TRUE;
90 bool ffe_is_ugly_assign_ = FALSE; /* Try and store pointer to ASSIGN labels in INTEGER vars. */
91 bool ffe_is_ugly_assumed_ = FALSE; /* DIMENSION X([...,]1) => DIMENSION X([...,]*) */
92 bool ffe_is_ugly_comma_ = FALSE;
93 bool ffe_is_ugly_complex_ = FALSE;
94 bool ffe_is_ugly_init_ = TRUE;
95 bool ffe_is_ugly_logint_ = FALSE;
96 bool ffe_is_version_ = FALSE;
97 bool ffe_is_vxt_ = FALSE;
98 bool ffe_is_warn_globals_ = TRUE;
99 bool ffe_is_warn_implicit_ = FALSE;
100 bool ffe_is_warn_surprising_ = FALSE;
101 bool ffe_is_zeros_ = FALSE;
102 ffeCase ffe_case_intrin_ = FFETARGET_defaultCASE_INTRIN;
103 ffeCase ffe_case_match_ = FFETARGET_defaultCASE_MATCH;
104 ffeCase ffe_case_source_ = FFETARGET_defaultCASE_SOURCE;
105 ffeCase ffe_case_symbol_ = FFETARGET_defaultCASE_SYMBOL;
106 ffeIntrinsicState ffe_intrinsic_state_badu77_ = FFE_intrinsicstateENABLED;
107 ffeIntrinsicState ffe_intrinsic_state_gnu_ = FFE_intrinsicstateENABLED;
108 ffeIntrinsicState ffe_intrinsic_state_f2c_ = FFE_intrinsicstateENABLED;
109 ffeIntrinsicState ffe_intrinsic_state_f90_ = FFE_intrinsicstateENABLED;
110 ffeIntrinsicState ffe_intrinsic_state_mil_ = FFE_intrinsicstateENABLED;
111 ffeIntrinsicState ffe_intrinsic_state_unix_ = FFE_intrinsicstateENABLED;
112 ffeIntrinsicState ffe_intrinsic_state_vxt_ = FFE_intrinsicstateENABLED;
113 int ffe_fixed_line_length_ = FFETARGET_defaultFIXED_LINE_LENGTH;
114 mallocPool ffe_file_pool_ = NULL;
115 mallocPool ffe_any_unit_pool_ = NULL;
116 mallocPool ffe_program_unit_pool_ = NULL;
117 ffeCounter ffe_count_0 = 0;
118 ffeCounter ffe_count_1 = 0;
119 ffeCounter ffe_count_2 = 0;
120 ffeCounter ffe_count_3 = 0;
121 ffeCounter ffe_count_4 = 0;
122 bool ffe_in_0 = FALSE;
123 bool ffe_in_1 = FALSE;
124 bool ffe_in_2 = FALSE;
125 bool ffe_in_3 = FALSE;
126 bool ffe_in_4 = FALSE;
128 /* Simple definitions and enumerations. */
131 /* Internal typedefs. */
134 /* Private include files. */
137 /* Internal structure definitions. */
140 /* Static objects accessed by functions in this module. */
143 /* Static functions (internal). */
145 static bool ffe_is_digit_string_ (char *s);
147 /* Internal macros. */
150 ffe_is_digit_string_ (char *s)
154 for (p = s; ISDIGIT (*p); ++p)
157 return (p != s) && (*p == '\0');
160 /* Handle command-line options. Returns 0 if unrecognized, 1 if
161 recognized and handled. */
164 ffe_decode_option (argc, argv)
165 int argc ATTRIBUTE_UNUSED;
173 if (strcmp (&opt[2], "version") == 0)
175 ffe_set_is_version (TRUE);
176 ffe_set_is_do_internal_checks (TRUE);
178 else if (strcmp (&opt[2], "null-version") == 0)
179 ffe_set_is_null_version (TRUE);
180 else if (strcmp (&opt[2], "f66") == 0)
182 ffe_set_is_onetrip (TRUE);
183 ffe_set_is_ugly_assumed (TRUE);
185 else if (strcmp (&opt[2], "no-f66") == 0)
187 ffe_set_is_onetrip (FALSE);
188 ffe_set_is_ugly_assumed (FALSE);
190 else if (strcmp (&opt[2], "f77") == 0)
192 ffe_set_is_backslash (TRUE);
193 ffe_set_is_typeless_boz (FALSE);
195 else if (strcmp (&opt[2], "no-f77") == 0)
197 ffe_set_is_backslash (FALSE);
199 else if (strcmp (&opt[2], "f90") == 0)
200 ffe_set_is_90 (TRUE);
201 else if (strcmp (&opt[2], "no-f90") == 0)
202 ffe_set_is_90 (FALSE);
203 else if (strcmp (&opt[2], "automatic") == 0)
204 ffe_set_is_automatic (TRUE);
205 else if (strcmp (&opt[2], "no-automatic") == 0)
206 ffe_set_is_automatic (FALSE);
207 else if (strcmp (&opt[2], "dollar-ok") == 0)
208 ffe_set_is_dollar_ok (TRUE);
209 else if (strcmp (&opt[2], "no-dollar-ok") == 0)
210 ffe_set_is_dollar_ok (FALSE);
211 else if (strcmp (&opt[2], "f2c") == 0)
212 ffe_set_is_f2c (TRUE);
213 else if (strcmp (&opt[2], "no-f2c") == 0)
214 ffe_set_is_f2c (FALSE);
215 else if (strcmp (&opt[2], "f2c-library") == 0)
216 ffe_set_is_f2c_library (TRUE);
217 else if (strcmp (&opt[2], "no-f2c-library") == 0)
218 ffe_set_is_f2c_library (FALSE);
219 else if (strcmp (&opt[2], "flatten-arrays") == 0)
220 ffe_set_is_flatten_arrays (TRUE);
221 else if (strcmp (&opt[2], "no-flatten-arrays") == 0)
222 ffe_set_is_flatten_arrays (FALSE);
223 else if (strcmp (&opt[2], "free-form") == 0)
224 ffe_set_is_free_form (TRUE);
225 else if (strcmp (&opt[2], "no-free-form") == 0)
226 ffe_set_is_free_form (FALSE);
227 else if (strcmp (&opt[2], "fixed-form") == 0)
228 ffe_set_is_free_form (FALSE);
229 else if (strcmp (&opt[2], "no-fixed-form") == 0)
230 ffe_set_is_free_form (TRUE);
231 else if (strcmp (&opt[2], "pedantic") == 0)
232 ffe_set_is_pedantic (TRUE);
233 else if (strcmp (&opt[2], "no-pedantic") == 0)
234 ffe_set_is_pedantic (FALSE);
235 else if (strcmp (&opt[2], "vxt") == 0)
236 ffe_set_is_vxt (TRUE);
237 else if (strcmp (&opt[2], "not-vxt") == 0)
238 ffe_set_is_vxt (FALSE);
239 else if (strcmp (&opt[2], "vxt-not-f90") == 0)
240 warning ("%s no longer supported -- try -fvxt", opt);
241 else if (strcmp (&opt[2], "f90-not-vxt") == 0)
242 warning ("%s no longer supported -- try -fno-vxt -ff90", opt);
243 else if (strcmp (&opt[2], "no-ugly") == 0)
245 ffe_set_is_ugly_args (FALSE);
246 ffe_set_is_ugly_assign (FALSE);
247 ffe_set_is_ugly_assumed (FALSE);
248 ffe_set_is_ugly_comma (FALSE);
249 ffe_set_is_ugly_complex (FALSE);
250 ffe_set_is_ugly_init (FALSE);
251 ffe_set_is_ugly_logint (FALSE);
253 else if (strcmp (&opt[2], "ugly-args") == 0)
254 ffe_set_is_ugly_args (TRUE);
255 else if (strcmp (&opt[2], "no-ugly-args") == 0)
256 ffe_set_is_ugly_args (FALSE);
257 else if (strcmp (&opt[2], "ugly-assign") == 0)
258 ffe_set_is_ugly_assign (TRUE);
259 else if (strcmp (&opt[2], "no-ugly-assign") == 0)
260 ffe_set_is_ugly_assign (FALSE);
261 else if (strcmp (&opt[2], "ugly-assumed") == 0)
262 ffe_set_is_ugly_assumed (TRUE);
263 else if (strcmp (&opt[2], "no-ugly-assumed") == 0)
264 ffe_set_is_ugly_assumed (FALSE);
265 else if (strcmp (&opt[2], "ugly-comma") == 0)
266 ffe_set_is_ugly_comma (TRUE);
267 else if (strcmp (&opt[2], "no-ugly-comma") == 0)
268 ffe_set_is_ugly_comma (FALSE);
269 else if (strcmp (&opt[2], "ugly-complex") == 0)
270 ffe_set_is_ugly_complex (TRUE);
271 else if (strcmp (&opt[2], "no-ugly-complex") == 0)
272 ffe_set_is_ugly_complex (FALSE);
273 else if (strcmp (&opt[2], "ugly-init") == 0)
274 ffe_set_is_ugly_init (TRUE);
275 else if (strcmp (&opt[2], "no-ugly-init") == 0)
276 ffe_set_is_ugly_init (FALSE);
277 else if (strcmp (&opt[2], "ugly-logint") == 0)
278 ffe_set_is_ugly_logint (TRUE);
279 else if (strcmp (&opt[2], "no-ugly-logint") == 0)
280 ffe_set_is_ugly_logint (FALSE);
281 else if (strcmp (&opt[2], "xyzzy") == 0)
282 ffe_set_is_ffedebug (TRUE);
283 else if (strcmp (&opt[2], "no-xyzzy") == 0)
284 ffe_set_is_ffedebug (FALSE);
285 else if (strcmp (&opt[2], "init-local-zero") == 0)
286 ffe_set_is_init_local_zero (TRUE);
287 else if (strcmp (&opt[2], "no-init-local-zero") == 0)
288 ffe_set_is_init_local_zero (FALSE);
289 else if (strcmp (&opt[2], "emulate-complex") == 0)
290 ffe_set_is_emulate_complex (TRUE);
291 else if (strcmp (&opt[2], "no-emulate-complex") == 0)
292 ffe_set_is_emulate_complex (FALSE);
293 else if (strcmp (&opt[2], "backslash") == 0)
294 ffe_set_is_backslash (TRUE);
295 else if (strcmp (&opt[2], "no-backslash") == 0)
296 ffe_set_is_backslash (FALSE);
297 else if (strcmp (&opt[2], "underscoring") == 0)
298 ffe_set_is_underscoring (TRUE);
299 else if (strcmp (&opt[2], "no-underscoring") == 0)
300 ffe_set_is_underscoring (FALSE);
301 else if (strcmp (&opt[2], "second-underscore") == 0)
302 ffe_set_is_second_underscore (TRUE);
303 else if (strcmp (&opt[2], "no-second-underscore") == 0)
304 ffe_set_is_second_underscore (FALSE);
305 else if (strcmp (&opt[2], "zeros") == 0)
306 ffe_set_is_zeros (TRUE);
307 else if (strcmp (&opt[2], "no-zeros") == 0)
308 ffe_set_is_zeros (FALSE);
309 else if (strcmp (&opt[2], "debug-kludge") == 0)
310 warning ("%s disabled, use normal debugging flags", opt);
311 else if (strcmp (&opt[2], "no-debug-kludge") == 0)
312 warning ("%s disabled, use normal debugging flags", opt);
313 else if (strcmp (&opt[2], "onetrip") == 0)
314 ffe_set_is_onetrip (TRUE);
315 else if (strcmp (&opt[2], "no-onetrip") == 0)
316 ffe_set_is_onetrip (FALSE);
317 else if (strcmp (&opt[2], "silent") == 0)
318 ffe_set_is_silent (TRUE);
319 else if (strcmp (&opt[2], "no-silent") == 0)
320 ffe_set_is_silent (FALSE);
321 else if (strcmp (&opt[2], "globals") == 0)
322 ffe_set_is_globals (TRUE);
323 else if (strcmp (&opt[2], "no-globals") == 0)
324 ffe_set_is_globals (FALSE);
325 else if (strcmp (&opt[2], "fortran-bounds-check") == 0)
326 flag_bounds_check = TRUE;
327 else if (strcmp (&opt[2], "no-fortran-bounds-check") == 0)
328 flag_bounds_check = FALSE;
329 else if (strcmp (&opt[2], "typeless-boz") == 0)
330 ffe_set_is_typeless_boz (TRUE);
331 else if (strcmp (&opt[2], "no-typeless-boz") == 0)
332 ffe_set_is_typeless_boz (FALSE);
333 else if (strcmp (&opt[2], "intrin-case-initcap") == 0)
334 ffe_set_case_intrin (FFE_caseINITCAP);
335 else if (strcmp (&opt[2], "intrin-case-upper") == 0)
336 ffe_set_case_intrin (FFE_caseUPPER);
337 else if (strcmp (&opt[2], "intrin-case-lower") == 0)
338 ffe_set_case_intrin (FFE_caseLOWER);
339 else if (strcmp (&opt[2], "intrin-case-any") == 0)
340 ffe_set_case_intrin (FFE_caseNONE);
341 else if (strcmp (&opt[2], "match-case-initcap") == 0)
342 ffe_set_case_match (FFE_caseINITCAP);
343 else if (strcmp (&opt[2], "match-case-upper") == 0)
344 ffe_set_case_match (FFE_caseUPPER);
345 else if (strcmp (&opt[2], "match-case-lower") == 0)
346 ffe_set_case_match (FFE_caseLOWER);
347 else if (strcmp (&opt[2], "match-case-any") == 0)
348 ffe_set_case_match (FFE_caseNONE);
349 else if (strcmp (&opt[2], "source-case-upper") == 0)
350 ffe_set_case_source (FFE_caseUPPER);
351 else if (strcmp (&opt[2], "source-case-lower") == 0)
352 ffe_set_case_source (FFE_caseLOWER);
353 else if (strcmp (&opt[2], "source-case-preserve") == 0)
354 ffe_set_case_source (FFE_caseNONE);
355 else if (strcmp (&opt[2], "symbol-case-initcap") == 0)
356 ffe_set_case_symbol (FFE_caseINITCAP);
357 else if (strcmp (&opt[2], "symbol-case-upper") == 0)
358 ffe_set_case_symbol (FFE_caseUPPER);
359 else if (strcmp (&opt[2], "symbol-case-lower") == 0)
360 ffe_set_case_symbol (FFE_caseLOWER);
361 else if (strcmp (&opt[2], "symbol-case-any") == 0)
362 ffe_set_case_symbol (FFE_caseNONE);
363 else if (strcmp (&opt[2], "case-strict-upper") == 0)
365 ffe_set_case_intrin (FFE_caseUPPER);
366 ffe_set_case_match (FFE_caseUPPER);
367 ffe_set_case_source (FFE_caseNONE);
368 ffe_set_case_symbol (FFE_caseUPPER);
370 else if (strcmp (&opt[2], "case-strict-lower") == 0)
372 ffe_set_case_intrin (FFE_caseLOWER);
373 ffe_set_case_match (FFE_caseLOWER);
374 ffe_set_case_source (FFE_caseNONE);
375 ffe_set_case_symbol (FFE_caseLOWER);
377 else if (strcmp (&opt[2], "case-initcap") == 0)
379 ffe_set_case_intrin (FFE_caseINITCAP);
380 ffe_set_case_match (FFE_caseINITCAP);
381 ffe_set_case_source (FFE_caseNONE);
382 ffe_set_case_symbol (FFE_caseINITCAP);
384 else if (strcmp (&opt[2], "case-upper") == 0)
386 ffe_set_case_intrin (FFE_caseNONE);
387 ffe_set_case_match (FFE_caseNONE);
388 ffe_set_case_source (FFE_caseUPPER);
389 ffe_set_case_symbol (FFE_caseNONE);
391 else if (strcmp (&opt[2], "case-lower") == 0)
393 ffe_set_case_intrin (FFE_caseNONE);
394 ffe_set_case_match (FFE_caseNONE);
395 ffe_set_case_source (FFE_caseLOWER);
396 ffe_set_case_symbol (FFE_caseNONE);
398 else if (strcmp (&opt[2], "case-preserve") == 0)
400 ffe_set_case_intrin (FFE_caseNONE);
401 ffe_set_case_match (FFE_caseNONE);
402 ffe_set_case_source (FFE_caseNONE);
403 ffe_set_case_symbol (FFE_caseNONE);
405 else if (strcmp (&opt[2], "badu77-intrinsics-delete") == 0)
406 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDELETED);
407 else if (strcmp (&opt[2], "badu77-intrinsics-hide") == 0)
408 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateHIDDEN);
409 else if (strcmp (&opt[2], "badu77-intrinsics-disable") == 0)
410 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDISABLED);
411 else if (strcmp (&opt[2], "badu77-intrinsics-enable") == 0)
412 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateENABLED);
413 else if (strcmp (&opt[2], "gnu-intrinsics-delete") == 0)
414 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDELETED);
415 else if (strcmp (&opt[2], "gnu-intrinsics-hide") == 0)
416 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateHIDDEN);
417 else if (strcmp (&opt[2], "gnu-intrinsics-disable") == 0)
418 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDISABLED);
419 else if (strcmp (&opt[2], "gnu-intrinsics-enable") == 0)
420 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateENABLED);
421 else if (strcmp (&opt[2], "f2c-intrinsics-delete") == 0)
422 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDELETED);
423 else if (strcmp (&opt[2], "f2c-intrinsics-hide") == 0)
424 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateHIDDEN);
425 else if (strcmp (&opt[2], "f2c-intrinsics-disable") == 0)
426 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDISABLED);
427 else if (strcmp (&opt[2], "f2c-intrinsics-enable") == 0)
428 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateENABLED);
429 else if (strcmp (&opt[2], "f90-intrinsics-delete") == 0)
430 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDELETED);
431 else if (strcmp (&opt[2], "f90-intrinsics-hide") == 0)
432 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateHIDDEN);
433 else if (strcmp (&opt[2], "f90-intrinsics-disable") == 0)
434 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDISABLED);
435 else if (strcmp (&opt[2], "f90-intrinsics-enable") == 0)
436 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateENABLED);
437 else if (strcmp (&opt[2], "mil-intrinsics-delete") == 0)
438 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDELETED);
439 else if (strcmp (&opt[2], "mil-intrinsics-hide") == 0)
440 ffe_set_intrinsic_state_mil (FFE_intrinsicstateHIDDEN);
441 else if (strcmp (&opt[2], "mil-intrinsics-disable") == 0)
442 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDISABLED);
443 else if (strcmp (&opt[2], "mil-intrinsics-enable") == 0)
444 ffe_set_intrinsic_state_mil (FFE_intrinsicstateENABLED);
445 else if (strcmp (&opt[2], "unix-intrinsics-delete") == 0)
446 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDELETED);
447 else if (strcmp (&opt[2], "unix-intrinsics-hide") == 0)
448 ffe_set_intrinsic_state_unix (FFE_intrinsicstateHIDDEN);
449 else if (strcmp (&opt[2], "unix-intrinsics-disable") == 0)
450 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDISABLED);
451 else if (strcmp (&opt[2], "unix-intrinsics-enable") == 0)
452 ffe_set_intrinsic_state_unix (FFE_intrinsicstateENABLED);
453 else if (strcmp (&opt[2], "vxt-intrinsics-delete") == 0)
454 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDELETED);
455 else if (strcmp (&opt[2], "vxt-intrinsics-hide") == 0)
456 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateHIDDEN);
457 else if (strcmp (&opt[2], "vxt-intrinsics-disable") == 0)
458 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDISABLED);
459 else if (strcmp (&opt[2], "vxt-intrinsics-enable") == 0)
460 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED);
461 else if (strncmp (&opt[2], "fixed-line-length-",
462 strlen ("fixed-line-length-")) == 0)
464 char *len = &opt[2] + strlen ("fixed-line-length-");
466 if (strcmp (len, "none") == 0)
468 ffe_set_fixed_line_length (0);
471 else if (ffe_is_digit_string_ (len))
473 ffe_set_fixed_line_length (atol (len));
482 else if (opt[1] == 'W')
484 if (!strcmp (&opt[2], "comment"))
485 ; /* cpp handles this one. */
486 else if (!strcmp (&opt[2], "no-comment"))
487 ; /* cpp handles this one. */
488 else if (!strcmp (&opt[2], "comments"))
489 ; /* cpp handles this one. */
490 else if (!strcmp (&opt[2], "no-comments"))
491 ; /* cpp handles this one. */
492 else if (!strcmp (&opt[2], "trigraphs"))
493 ; /* cpp handles this one. */
494 else if (!strcmp (&opt[2], "no-trigraphs"))
495 ; /* cpp handles this one. */
496 else if (!strcmp (&opt[2], "import"))
497 ; /* cpp handles this one. */
498 else if (!strcmp (&opt[2], "no-import"))
499 ; /* cpp handles this one. */
500 else if (!strcmp (&opt[2], "globals"))
501 ffe_set_is_warn_globals (TRUE);
502 else if (!strcmp (&opt[2], "no-globals"))
503 ffe_set_is_warn_globals (FALSE);
504 else if (!strcmp (&opt[2], "implicit"))
505 ffe_set_is_warn_implicit (TRUE);
506 else if (!strcmp (&opt[2], "no-implicit"))
507 ffe_set_is_warn_implicit (FALSE);
508 else if (!strcmp (&opt[2], "surprising"))
509 ffe_set_is_warn_surprising (TRUE);
510 else if (!strcmp (&opt[2], "no-surprising"))
511 ffe_set_is_warn_surprising (FALSE);
512 else if (!strcmp (&opt[2], "all"))
514 /* We save the value of warn_uninitialized, since if they put
515 -Wuninitialized on the command line, we need to generate a
516 warning about not using it without also specifying -O. */
517 if (warn_uninitialized != 1)
518 warn_uninitialized = 2;
524 else if (opt[1] == 'I')
525 return ffecom_decode_include_option (&opt[2]);
532 /* Run the FFE on a source file (not an INCLUDEd file).
534 Runs the whole shebang.
536 Prepare and invoke the appropriate lexer. */
539 ffe_file (ffewhereFile wf, FILE *f)
542 ffelex_set_handler ((ffelexHandler) ffest_first);
543 ffewhere_file_set (wf, TRUE, 0);
544 if (ffe_is_free_form_)
545 ffelex_file_free (wf, f);
547 ffelex_file_fixed (wf, f);
552 /* ffe_init_0 -- Initialize the FFE per image invocation
556 Performs per-image invocation. */
587 /* ffe_init_1 -- Initialize the FFE per source file
591 Performs per-source-file invocation (not including INCLUDEd files). */
599 assert (ffe_file_pool_ == NULL);
600 ffe_file_pool_ = malloc_pool_new ("File", malloc_pool_image (), 1024);
627 /* ffe_init_2 -- Initialize the FFE per outer program unit
631 Performs per-program-unit invocation. */
639 assert (ffe_program_unit_pool_ == NULL);
640 ffe_program_unit_pool_ = malloc_pool_new ("Program unit", ffe_file_pool_, 1024);
641 ffe_is_mainprog_ = FALSE;
642 ffe_is_saveall_ = !ffe_is_automatic_;
669 /* ffe_init_3 -- Initialize the FFE per any program unit
673 Performs per-any-unit initialization; does NOT do
674 per-statement-function-definition initialization (i.e. the chain
675 of inits, from 0-3, breaks here; level 4 must be invoked independently). */
683 assert (ffe_any_unit_pool_ == NULL);
684 ffe_any_unit_pool_ = malloc_pool_new ("Any unit", ffe_program_unit_pool_, 1024);
709 /* ffe_init_4 -- Initialize the FFE per statement function definition
742 /* ffe_terminate_0 -- Terminate the FFE prior to image termination
744 ffe_terminate_0(); */
752 ffebad_terminate_0 ();
753 ffebit_terminate_0 ();
754 ffebld_terminate_0 ();
755 ffecom_terminate_0 ();
756 ffedata_terminate_0 ();
757 ffeequiv_terminate_0 ();
758 ffeexpr_terminate_0 ();
759 ffeglobal_terminate_0 ();
760 ffeimplic_terminate_0 ();
761 ffeinfo_terminate_0 ();
762 ffeintrin_terminate_0 ();
763 ffelab_terminate_0 ();
764 ffelex_terminate_0 ();
765 ffename_terminate_0 ();
766 ffesrc_terminate_0 ();
767 ffest_terminate_0 ();
768 ffestorag_terminate_0 ();
769 ffesymbol_terminate_0 ();
770 ffetarget_terminate_0 ();
771 ffetype_terminate_0 ();
772 ffewhere_terminate_0 ();
775 /* ffe_terminate_1 -- Terminate the FFE after seeing source file EOF
777 ffe_terminate_1(); */
787 ffebad_terminate_1 ();
788 ffebit_terminate_1 ();
789 ffebld_terminate_1 ();
790 ffecom_terminate_1 ();
791 ffedata_terminate_1 ();
792 ffeequiv_terminate_1 ();
793 ffeexpr_terminate_1 ();
794 ffeglobal_terminate_1 ();
795 ffeimplic_terminate_1 ();
796 ffeinfo_terminate_1 ();
797 ffeintrin_terminate_1 ();
798 ffelab_terminate_1 ();
799 ffelex_terminate_1 ();
800 ffename_terminate_1 ();
801 ffesrc_terminate_1 ();
802 ffest_terminate_1 ();
803 ffestorag_terminate_1 ();
804 ffesymbol_terminate_1 ();
805 ffetarget_terminate_1 ();
806 ffetype_terminate_1 ();
807 ffewhere_terminate_1 ();
809 assert (ffe_file_pool_ != NULL);
810 malloc_pool_kill (ffe_file_pool_);
811 ffe_file_pool_ = NULL;
814 /* ffe_terminate_2 -- Terminate the FFE after seeing outer program unit END
816 ffe_terminate_2(); */
826 ffebad_terminate_2 ();
827 ffebit_terminate_2 ();
828 ffebld_terminate_2 ();
829 ffecom_terminate_2 ();
830 ffedata_terminate_2 ();
831 ffeequiv_terminate_2 ();
832 ffeexpr_terminate_2 ();
833 ffeglobal_terminate_2 ();
834 ffeimplic_terminate_2 ();
835 ffeinfo_terminate_2 ();
836 ffeintrin_terminate_2 ();
837 ffelab_terminate_2 ();
838 ffelex_terminate_2 ();
839 ffename_terminate_2 ();
840 ffesrc_terminate_2 ();
841 ffest_terminate_2 ();
842 ffestorag_terminate_2 ();
843 ffesymbol_terminate_2 ();
844 ffetarget_terminate_2 ();
845 ffetype_terminate_2 ();
846 ffewhere_terminate_2 ();
848 assert (ffe_program_unit_pool_ != NULL);
849 malloc_pool_kill (ffe_program_unit_pool_);
850 ffe_program_unit_pool_ = NULL;
853 /* ffe_terminate_3 -- Terminate the FFE after seeing any program unit END
855 ffe_terminate_3(); */
863 ffebad_terminate_3 ();
864 ffebit_terminate_3 ();
865 ffebld_terminate_3 ();
866 ffecom_terminate_3 ();
867 ffedata_terminate_3 ();
868 ffeequiv_terminate_3 ();
869 ffeexpr_terminate_3 ();
870 ffeglobal_terminate_3 ();
871 ffeimplic_terminate_3 ();
872 ffeinfo_terminate_3 ();
873 ffeintrin_terminate_3 ();
874 ffelab_terminate_3 ();
875 ffelex_terminate_3 ();
876 ffename_terminate_3 ();
877 ffesrc_terminate_3 ();
878 ffest_terminate_3 ();
879 ffestorag_terminate_3 ();
880 ffesymbol_terminate_3 ();
881 ffetarget_terminate_3 ();
882 ffetype_terminate_3 ();
883 ffewhere_terminate_3 ();
885 assert (ffe_any_unit_pool_ != NULL);
886 malloc_pool_kill (ffe_any_unit_pool_);
887 ffe_any_unit_pool_ = NULL;
890 /* ffe_terminate_4 -- Terminate the FFE after seeing sfunc def expression
892 ffe_terminate_4(); */
899 ffebad_terminate_4 ();
900 ffebit_terminate_4 ();
901 ffebld_terminate_4 ();
902 ffecom_terminate_4 ();
903 ffedata_terminate_4 ();
904 ffeequiv_terminate_4 ();
905 ffeexpr_terminate_4 ();
906 ffeglobal_terminate_4 ();
907 ffeimplic_terminate_4 ();
908 ffeinfo_terminate_4 ();
909 ffeintrin_terminate_4 ();
910 ffelab_terminate_4 ();
911 ffelex_terminate_4 ();
912 ffename_terminate_4 ();
913 ffesrc_terminate_4 ();
914 ffest_terminate_4 ();
915 ffestorag_terminate_4 ();
916 ffesymbol_terminate_4 ();
917 ffetarget_terminate_4 ();
918 ffetype_terminate_4 ();
919 ffewhere_terminate_4 ();