1 /* top.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995-1997 Free Software Foundation, Inc.
3 Contributed by James Craig Burley (burley@gnu.org).
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_ = TRUE;
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_free_form_ = FFETARGET_defaultIS_FREE_FORM;
78 bool ffe_is_globals_ = TRUE;
79 bool ffe_is_ident_ = 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)
173 if (strcmp (&opt[2], "version") == 0)
175 ffe_set_is_version (TRUE);
176 ffe_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], "ident") == 0)
181 ffe_set_is_ident (TRUE);
182 else if (strcmp (&opt[2], "no-ident") == 0)
183 ffe_set_is_ident (FALSE);
184 else if (strcmp (&opt[2], "f66") == 0)
186 ffe_set_is_onetrip (TRUE);
187 ffe_set_is_ugly_assumed (TRUE);
189 else if (strcmp (&opt[2], "no-f66") == 0)
191 ffe_set_is_onetrip (FALSE);
192 ffe_set_is_ugly_assumed (FALSE);
194 else if (strcmp (&opt[2], "f77") == 0)
196 ffe_set_is_backslash (TRUE);
197 ffe_set_is_typeless_boz (FALSE);
199 else if (strcmp (&opt[2], "no-f77") == 0)
201 ffe_set_is_backslash (FALSE);
203 else if (strcmp (&opt[2], "f90") == 0)
204 ffe_set_is_90 (TRUE);
205 else if (strcmp (&opt[2], "no-f90") == 0)
206 ffe_set_is_90 (FALSE);
207 else if (strcmp (&opt[2], "automatic") == 0)
208 ffe_set_is_automatic (TRUE);
209 else if (strcmp (&opt[2], "no-automatic") == 0)
210 ffe_set_is_automatic (FALSE);
211 else if (strcmp (&opt[2], "dollar-ok") == 0)
212 ffe_set_is_dollar_ok (TRUE);
213 else if (strcmp (&opt[2], "no-dollar-ok") == 0)
214 ffe_set_is_dollar_ok (FALSE);
215 else if (strcmp (&opt[2], "f2c") == 0)
216 ffe_set_is_f2c (TRUE);
217 else if (strcmp (&opt[2], "no-f2c") == 0)
218 ffe_set_is_f2c (FALSE);
219 else if (strcmp (&opt[2], "f2c-library") == 0)
220 ffe_set_is_f2c_library (TRUE);
221 else if (strcmp (&opt[2], "no-f2c-library") == 0)
222 ffe_set_is_f2c_library (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], "ugly") == 0)
245 warning ("%s is overloaded with meanings and likely to be removed;", opt);
246 warning ("use only the specific -fugly-* options you need");
247 ffe_set_is_ugly_args (TRUE);
248 ffe_set_is_ugly_assign (TRUE);
249 ffe_set_is_ugly_assumed (TRUE);
250 ffe_set_is_ugly_comma (TRUE);
251 ffe_set_is_ugly_complex (TRUE);
252 ffe_set_is_ugly_init (TRUE);
253 ffe_set_is_ugly_logint (TRUE);
255 else if (strcmp (&opt[2], "no-ugly") == 0)
257 ffe_set_is_ugly_args (FALSE);
258 ffe_set_is_ugly_assign (FALSE);
259 ffe_set_is_ugly_assumed (FALSE);
260 ffe_set_is_ugly_comma (FALSE);
261 ffe_set_is_ugly_complex (FALSE);
262 ffe_set_is_ugly_init (FALSE);
263 ffe_set_is_ugly_logint (FALSE);
265 else if (strcmp (&opt[2], "ugly-args") == 0)
266 ffe_set_is_ugly_args (TRUE);
267 else if (strcmp (&opt[2], "no-ugly-args") == 0)
268 ffe_set_is_ugly_args (FALSE);
269 else if (strcmp (&opt[2], "ugly-assign") == 0)
270 ffe_set_is_ugly_assign (TRUE);
271 else if (strcmp (&opt[2], "no-ugly-assign") == 0)
272 ffe_set_is_ugly_assign (FALSE);
273 else if (strcmp (&opt[2], "ugly-assumed") == 0)
274 ffe_set_is_ugly_assumed (TRUE);
275 else if (strcmp (&opt[2], "no-ugly-assumed") == 0)
276 ffe_set_is_ugly_assumed (FALSE);
277 else if (strcmp (&opt[2], "ugly-comma") == 0)
278 ffe_set_is_ugly_comma (TRUE);
279 else if (strcmp (&opt[2], "no-ugly-comma") == 0)
280 ffe_set_is_ugly_comma (FALSE);
281 else if (strcmp (&opt[2], "ugly-complex") == 0)
282 ffe_set_is_ugly_complex (TRUE);
283 else if (strcmp (&opt[2], "no-ugly-complex") == 0)
284 ffe_set_is_ugly_complex (FALSE);
285 else if (strcmp (&opt[2], "ugly-init") == 0)
286 ffe_set_is_ugly_init (TRUE);
287 else if (strcmp (&opt[2], "no-ugly-init") == 0)
288 ffe_set_is_ugly_init (FALSE);
289 else if (strcmp (&opt[2], "ugly-logint") == 0)
290 ffe_set_is_ugly_logint (TRUE);
291 else if (strcmp (&opt[2], "no-ugly-logint") == 0)
292 ffe_set_is_ugly_logint (FALSE);
293 else if (strcmp (&opt[2], "xyzzy") == 0)
294 ffe_set_is_ffedebug (TRUE);
295 else if (strcmp (&opt[2], "no-xyzzy") == 0)
296 ffe_set_is_ffedebug (FALSE);
297 else if (strcmp (&opt[2], "init-local-zero") == 0)
298 ffe_set_is_init_local_zero (TRUE);
299 else if (strcmp (&opt[2], "no-init-local-zero") == 0)
300 ffe_set_is_init_local_zero (FALSE);
301 else if (strcmp (&opt[2], "emulate-complex") == 0)
302 ffe_set_is_emulate_complex (TRUE);
303 else if (strcmp (&opt[2], "no-emulate-complex") == 0)
304 ffe_set_is_emulate_complex (FALSE);
305 else if (strcmp (&opt[2], "backslash") == 0)
306 ffe_set_is_backslash (TRUE);
307 else if (strcmp (&opt[2], "no-backslash") == 0)
308 ffe_set_is_backslash (FALSE);
309 else if (strcmp (&opt[2], "underscoring") == 0)
310 ffe_set_is_underscoring (TRUE);
311 else if (strcmp (&opt[2], "no-underscoring") == 0)
312 ffe_set_is_underscoring (FALSE);
313 else if (strcmp (&opt[2], "second-underscore") == 0)
314 ffe_set_is_second_underscore (TRUE);
315 else if (strcmp (&opt[2], "no-second-underscore") == 0)
316 ffe_set_is_second_underscore (FALSE);
317 else if (strcmp (&opt[2], "zeros") == 0)
318 ffe_set_is_zeros (TRUE);
319 else if (strcmp (&opt[2], "no-zeros") == 0)
320 ffe_set_is_zeros (FALSE);
321 else if (strcmp (&opt[2], "debug-kludge") == 0)
322 ffe_set_is_debug_kludge (TRUE);
323 else if (strcmp (&opt[2], "no-debug-kludge") == 0)
324 ffe_set_is_debug_kludge (FALSE);
325 else if (strcmp (&opt[2], "onetrip") == 0)
326 ffe_set_is_onetrip (TRUE);
327 else if (strcmp (&opt[2], "no-onetrip") == 0)
328 ffe_set_is_onetrip (FALSE);
329 else if (strcmp (&opt[2], "silent") == 0)
330 ffe_set_is_silent (TRUE);
331 else if (strcmp (&opt[2], "no-silent") == 0)
332 ffe_set_is_silent (FALSE);
333 else if (strcmp (&opt[2], "globals") == 0)
334 ffe_set_is_globals (TRUE);
335 else if (strcmp (&opt[2], "no-globals") == 0)
336 ffe_set_is_globals (FALSE);
337 else if (strcmp (&opt[2], "typeless-boz") == 0)
338 ffe_set_is_typeless_boz (TRUE);
339 else if (strcmp (&opt[2], "no-typeless-boz") == 0)
340 ffe_set_is_typeless_boz (FALSE);
341 else if (strcmp (&opt[2], "intrin-case-initcap") == 0)
342 ffe_set_case_intrin (FFE_caseINITCAP);
343 else if (strcmp (&opt[2], "intrin-case-upper") == 0)
344 ffe_set_case_intrin (FFE_caseUPPER);
345 else if (strcmp (&opt[2], "intrin-case-lower") == 0)
346 ffe_set_case_intrin (FFE_caseLOWER);
347 else if (strcmp (&opt[2], "intrin-case-any") == 0)
348 ffe_set_case_intrin (FFE_caseNONE);
349 else if (strcmp (&opt[2], "match-case-initcap") == 0)
350 ffe_set_case_match (FFE_caseINITCAP);
351 else if (strcmp (&opt[2], "match-case-upper") == 0)
352 ffe_set_case_match (FFE_caseUPPER);
353 else if (strcmp (&opt[2], "match-case-lower") == 0)
354 ffe_set_case_match (FFE_caseLOWER);
355 else if (strcmp (&opt[2], "match-case-any") == 0)
356 ffe_set_case_match (FFE_caseNONE);
357 else if (strcmp (&opt[2], "source-case-upper") == 0)
358 ffe_set_case_source (FFE_caseUPPER);
359 else if (strcmp (&opt[2], "source-case-lower") == 0)
360 ffe_set_case_source (FFE_caseLOWER);
361 else if (strcmp (&opt[2], "source-case-preserve") == 0)
362 ffe_set_case_source (FFE_caseNONE);
363 else if (strcmp (&opt[2], "symbol-case-initcap") == 0)
364 ffe_set_case_symbol (FFE_caseINITCAP);
365 else if (strcmp (&opt[2], "symbol-case-upper") == 0)
366 ffe_set_case_symbol (FFE_caseUPPER);
367 else if (strcmp (&opt[2], "symbol-case-lower") == 0)
368 ffe_set_case_symbol (FFE_caseLOWER);
369 else if (strcmp (&opt[2], "symbol-case-any") == 0)
370 ffe_set_case_symbol (FFE_caseNONE);
371 else if (strcmp (&opt[2], "case-strict-upper") == 0)
373 ffe_set_case_intrin (FFE_caseUPPER);
374 ffe_set_case_match (FFE_caseUPPER);
375 ffe_set_case_source (FFE_caseNONE);
376 ffe_set_case_symbol (FFE_caseUPPER);
378 else if (strcmp (&opt[2], "case-strict-lower") == 0)
380 ffe_set_case_intrin (FFE_caseLOWER);
381 ffe_set_case_match (FFE_caseLOWER);
382 ffe_set_case_source (FFE_caseNONE);
383 ffe_set_case_symbol (FFE_caseLOWER);
385 else if (strcmp (&opt[2], "case-initcap") == 0)
387 ffe_set_case_intrin (FFE_caseINITCAP);
388 ffe_set_case_match (FFE_caseINITCAP);
389 ffe_set_case_source (FFE_caseNONE);
390 ffe_set_case_symbol (FFE_caseINITCAP);
392 else if (strcmp (&opt[2], "case-upper") == 0)
394 ffe_set_case_intrin (FFE_caseNONE);
395 ffe_set_case_match (FFE_caseNONE);
396 ffe_set_case_source (FFE_caseUPPER);
397 ffe_set_case_symbol (FFE_caseNONE);
399 else if (strcmp (&opt[2], "case-lower") == 0)
401 ffe_set_case_intrin (FFE_caseNONE);
402 ffe_set_case_match (FFE_caseNONE);
403 ffe_set_case_source (FFE_caseLOWER);
404 ffe_set_case_symbol (FFE_caseNONE);
406 else if (strcmp (&opt[2], "case-preserve") == 0)
408 ffe_set_case_intrin (FFE_caseNONE);
409 ffe_set_case_match (FFE_caseNONE);
410 ffe_set_case_source (FFE_caseNONE);
411 ffe_set_case_symbol (FFE_caseNONE);
413 else if (strcmp (&opt[2], "badu77-intrinsics-delete") == 0)
414 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDELETED);
415 else if (strcmp (&opt[2], "badu77-intrinsics-hide") == 0)
416 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateHIDDEN);
417 else if (strcmp (&opt[2], "badu77-intrinsics-disable") == 0)
418 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateDISABLED);
419 else if (strcmp (&opt[2], "badu77-intrinsics-enable") == 0)
420 ffe_set_intrinsic_state_badu77 (FFE_intrinsicstateENABLED);
421 else if (strcmp (&opt[2], "gnu-intrinsics-delete") == 0)
422 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDELETED);
423 else if (strcmp (&opt[2], "gnu-intrinsics-hide") == 0)
424 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateHIDDEN);
425 else if (strcmp (&opt[2], "gnu-intrinsics-disable") == 0)
426 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateDISABLED);
427 else if (strcmp (&opt[2], "gnu-intrinsics-enable") == 0)
428 ffe_set_intrinsic_state_gnu (FFE_intrinsicstateENABLED);
429 else if (strcmp (&opt[2], "f2c-intrinsics-delete") == 0)
430 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDELETED);
431 else if (strcmp (&opt[2], "f2c-intrinsics-hide") == 0)
432 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateHIDDEN);
433 else if (strcmp (&opt[2], "f2c-intrinsics-disable") == 0)
434 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateDISABLED);
435 else if (strcmp (&opt[2], "f2c-intrinsics-enable") == 0)
436 ffe_set_intrinsic_state_f2c (FFE_intrinsicstateENABLED);
437 else if (strcmp (&opt[2], "f90-intrinsics-delete") == 0)
438 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDELETED);
439 else if (strcmp (&opt[2], "f90-intrinsics-hide") == 0)
440 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateHIDDEN);
441 else if (strcmp (&opt[2], "f90-intrinsics-disable") == 0)
442 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateDISABLED);
443 else if (strcmp (&opt[2], "f90-intrinsics-enable") == 0)
444 ffe_set_intrinsic_state_f90 (FFE_intrinsicstateENABLED);
445 else if (strcmp (&opt[2], "mil-intrinsics-delete") == 0)
446 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDELETED);
447 else if (strcmp (&opt[2], "mil-intrinsics-hide") == 0)
448 ffe_set_intrinsic_state_mil (FFE_intrinsicstateHIDDEN);
449 else if (strcmp (&opt[2], "mil-intrinsics-disable") == 0)
450 ffe_set_intrinsic_state_mil (FFE_intrinsicstateDISABLED);
451 else if (strcmp (&opt[2], "mil-intrinsics-enable") == 0)
452 ffe_set_intrinsic_state_mil (FFE_intrinsicstateENABLED);
453 else if (strcmp (&opt[2], "unix-intrinsics-delete") == 0)
454 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDELETED);
455 else if (strcmp (&opt[2], "unix-intrinsics-hide") == 0)
456 ffe_set_intrinsic_state_unix (FFE_intrinsicstateHIDDEN);
457 else if (strcmp (&opt[2], "unix-intrinsics-disable") == 0)
458 ffe_set_intrinsic_state_unix (FFE_intrinsicstateDISABLED);
459 else if (strcmp (&opt[2], "unix-intrinsics-enable") == 0)
460 ffe_set_intrinsic_state_unix (FFE_intrinsicstateENABLED);
461 else if (strcmp (&opt[2], "vxt-intrinsics-delete") == 0)
462 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDELETED);
463 else if (strcmp (&opt[2], "vxt-intrinsics-hide") == 0)
464 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateHIDDEN);
465 else if (strcmp (&opt[2], "vxt-intrinsics-disable") == 0)
466 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateDISABLED);
467 else if (strcmp (&opt[2], "vxt-intrinsics-enable") == 0)
468 ffe_set_intrinsic_state_vxt (FFE_intrinsicstateENABLED);
469 else if (strncmp (&opt[2], "fixed-line-length-",
470 strlen ("fixed-line-length-")) == 0)
472 char *len = &opt[2] + strlen ("fixed-line-length-");
474 if (strcmp (len, "none") == 0)
475 ffe_set_fixed_line_length (0);
476 else if (ffe_is_digit_string_ (len))
477 ffe_set_fixed_line_length (atol (len));
484 else if (opt[1] == 'W')
486 if (!strcmp (&opt[2], "comment"))
487 ; /* cpp handles this one. */
488 else if (!strcmp (&opt[2], "no-comment"))
489 ; /* cpp handles this one. */
490 else if (!strcmp (&opt[2], "comments"))
491 ; /* cpp handles this one. */
492 else if (!strcmp (&opt[2], "no-comments"))
493 ; /* cpp handles this one. */
494 else if (!strcmp (&opt[2], "trigraphs"))
495 ; /* cpp handles this one. */
496 else if (!strcmp (&opt[2], "no-trigraphs"))
497 ; /* cpp handles this one. */
498 else if (!strcmp (&opt[2], "import"))
499 ; /* cpp handles this one. */
500 else if (!strcmp (&opt[2], "no-import"))
501 ; /* cpp handles this one. */
502 else if (!strcmp (&opt[2], "globals"))
503 ffe_set_is_warn_globals (TRUE);
504 else if (!strcmp (&opt[2], "no-globals"))
505 ffe_set_is_warn_globals (FALSE);
506 else if (!strcmp (&opt[2], "implicit"))
507 ffe_set_is_warn_implicit (TRUE);
508 else if (!strcmp (&opt[2], "no-implicit"))
509 ffe_set_is_warn_implicit (FALSE);
510 else if (!strcmp (&opt[2], "surprising"))
511 ffe_set_is_warn_surprising (TRUE);
512 else if (!strcmp (&opt[2], "no-surprising"))
513 ffe_set_is_warn_surprising (FALSE);
514 else if (!strcmp (&opt[2], "all"))
516 /* We save the value of warn_uninitialized, since if they put
517 -Wuninitialized on the command line, we need to generate a
518 warning about not using it without also specifying -O. */
519 if (warn_uninitialized != 1)
520 warn_uninitialized = 2;
526 else if (opt[1] == 'I')
527 return ffecom_decode_include_option (&opt[2]);
534 /* Run the FFE on a source file (not an INCLUDEd file).
536 Runs the whole shebang.
538 Prepare and invoke the appropriate lexer. */
541 ffe_file (ffewhereFile wf, FILE *f)
544 ffelex_set_handler ((ffelexHandler) ffest_first);
545 ffewhere_file_set (wf, TRUE, 0);
546 if (ffe_is_free_form_)
547 ffelex_file_free (wf, f);
549 ffelex_file_fixed (wf, f);
554 /* ffe_init_0 -- Initialize the FFE per image invocation
558 Performs per-image invocation. */
589 /* ffe_init_1 -- Initialize the FFE per source file
593 Performs per-source-file invocation (not including INCLUDEd files). */
601 assert (ffe_file_pool_ == NULL);
602 ffe_file_pool_ = malloc_pool_new ("File", malloc_pool_image (), 1024);
629 /* ffe_init_2 -- Initialize the FFE per outer program unit
633 Performs per-program-unit invocation. */
641 assert (ffe_program_unit_pool_ == NULL);
642 ffe_program_unit_pool_ = malloc_pool_new ("Program unit", ffe_file_pool_, 1024);
643 ffe_is_mainprog_ = FALSE;
644 ffe_is_saveall_ = !ffe_is_automatic_;
671 /* ffe_init_3 -- Initialize the FFE per any program unit
675 Performs per-any-unit initialization; does NOT do
676 per-statement-function-definition initialization (i.e. the chain
677 of inits, from 0-3, breaks here; level 4 must be invoked independently). */
685 assert (ffe_any_unit_pool_ == NULL);
686 ffe_any_unit_pool_ = malloc_pool_new ("Any unit", ffe_program_unit_pool_, 1024);
711 /* ffe_init_4 -- Initialize the FFE per statement function definition
744 /* ffe_terminate_0 -- Terminate the FFE prior to image termination
746 ffe_terminate_0(); */
754 ffebad_terminate_0 ();
755 ffebit_terminate_0 ();
756 ffebld_terminate_0 ();
757 ffecom_terminate_0 ();
758 ffedata_terminate_0 ();
759 ffeequiv_terminate_0 ();
760 ffeexpr_terminate_0 ();
761 ffeglobal_terminate_0 ();
762 ffeimplic_terminate_0 ();
763 ffeinfo_terminate_0 ();
764 ffeintrin_terminate_0 ();
765 ffelab_terminate_0 ();
766 ffelex_terminate_0 ();
767 ffename_terminate_0 ();
768 ffesrc_terminate_0 ();
769 ffest_terminate_0 ();
770 ffestorag_terminate_0 ();
771 ffesymbol_terminate_0 ();
772 ffetarget_terminate_0 ();
773 ffetype_terminate_0 ();
774 ffewhere_terminate_0 ();
777 /* ffe_terminate_1 -- Terminate the FFE after seeing source file EOF
779 ffe_terminate_1(); */
789 ffebad_terminate_1 ();
790 ffebit_terminate_1 ();
791 ffebld_terminate_1 ();
792 ffecom_terminate_1 ();
793 ffedata_terminate_1 ();
794 ffeequiv_terminate_1 ();
795 ffeexpr_terminate_1 ();
796 ffeglobal_terminate_1 ();
797 ffeimplic_terminate_1 ();
798 ffeinfo_terminate_1 ();
799 ffeintrin_terminate_1 ();
800 ffelab_terminate_1 ();
801 ffelex_terminate_1 ();
802 ffename_terminate_1 ();
803 ffesrc_terminate_1 ();
804 ffest_terminate_1 ();
805 ffestorag_terminate_1 ();
806 ffesymbol_terminate_1 ();
807 ffetarget_terminate_1 ();
808 ffetype_terminate_1 ();
809 ffewhere_terminate_1 ();
811 assert (ffe_file_pool_ != NULL);
812 malloc_pool_kill (ffe_file_pool_);
813 ffe_file_pool_ = NULL;
816 /* ffe_terminate_2 -- Terminate the FFE after seeing outer program unit END
818 ffe_terminate_2(); */
828 ffebad_terminate_2 ();
829 ffebit_terminate_2 ();
830 ffebld_terminate_2 ();
831 ffecom_terminate_2 ();
832 ffedata_terminate_2 ();
833 ffeequiv_terminate_2 ();
834 ffeexpr_terminate_2 ();
835 ffeglobal_terminate_2 ();
836 ffeimplic_terminate_2 ();
837 ffeinfo_terminate_2 ();
838 ffeintrin_terminate_2 ();
839 ffelab_terminate_2 ();
840 ffelex_terminate_2 ();
841 ffename_terminate_2 ();
842 ffesrc_terminate_2 ();
843 ffest_terminate_2 ();
844 ffestorag_terminate_2 ();
845 ffesymbol_terminate_2 ();
846 ffetarget_terminate_2 ();
847 ffetype_terminate_2 ();
848 ffewhere_terminate_2 ();
850 assert (ffe_program_unit_pool_ != NULL);
851 malloc_pool_kill (ffe_program_unit_pool_);
852 ffe_program_unit_pool_ = NULL;
855 /* ffe_terminate_3 -- Terminate the FFE after seeing any program unit END
857 ffe_terminate_3(); */
865 ffebad_terminate_3 ();
866 ffebit_terminate_3 ();
867 ffebld_terminate_3 ();
868 ffecom_terminate_3 ();
869 ffedata_terminate_3 ();
870 ffeequiv_terminate_3 ();
871 ffeexpr_terminate_3 ();
872 ffeglobal_terminate_3 ();
873 ffeimplic_terminate_3 ();
874 ffeinfo_terminate_3 ();
875 ffeintrin_terminate_3 ();
876 ffelab_terminate_3 ();
877 ffelex_terminate_3 ();
878 ffename_terminate_3 ();
879 ffesrc_terminate_3 ();
880 ffest_terminate_3 ();
881 ffestorag_terminate_3 ();
882 ffesymbol_terminate_3 ();
883 ffetarget_terminate_3 ();
884 ffetype_terminate_3 ();
885 ffewhere_terminate_3 ();
887 assert (ffe_any_unit_pool_ != NULL);
888 malloc_pool_kill (ffe_any_unit_pool_);
889 ffe_any_unit_pool_ = NULL;
892 /* ffe_terminate_4 -- Terminate the FFE after seeing sfunc def expression
894 ffe_terminate_4(); */
901 ffebad_terminate_4 ();
902 ffebit_terminate_4 ();
903 ffebld_terminate_4 ();
904 ffecom_terminate_4 ();
905 ffedata_terminate_4 ();
906 ffeequiv_terminate_4 ();
907 ffeexpr_terminate_4 ();
908 ffeglobal_terminate_4 ();
909 ffeimplic_terminate_4 ();
910 ffeinfo_terminate_4 ();
911 ffeintrin_terminate_4 ();
912 ffelab_terminate_4 ();
913 ffelex_terminate_4 ();
914 ffename_terminate_4 ();
915 ffesrc_terminate_4 ();
916 ffest_terminate_4 ();
917 ffestorag_terminate_4 ();
918 ffesymbol_terminate_4 ();
919 ffetarget_terminate_4 ();
920 ffetype_terminate_4 ();
921 ffewhere_terminate_4 ();