Line data Source code
1 : /* do not edit automatically generated by mc from M2Options. */
2 : /* M2Options.mod initializes the user options.
3 :
4 : Copyright (C) 2001-2026 Free Software Foundation, Inc.
5 : Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 :
7 : This file is part of GNU Modula-2.
8 :
9 : GNU Modula-2 is free software; you can redistribute it and/or modify
10 : it under the terms of the GNU General Public License as published by
11 : the Free Software Foundation; either version 3, or (at your option)
12 : any later version.
13 :
14 : GNU Modula-2 is distributed in the hope that it will be useful, but
15 : WITHOUT ANY WARRANTY; without even the implied warranty of
16 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : General Public License for more details.
18 :
19 : You should have received a copy of the GNU General Public License
20 : along with GNU Modula-2; see the file COPYING3. If not see
21 : <http://www.gnu.org/licenses/>. */
22 :
23 : #include "config.h"
24 : #include "system.h"
25 : #include "gcc-consolidation.h"
26 :
27 : #include <stdbool.h>
28 : # if !defined (PROC_D)
29 : # define PROC_D
30 : typedef void (*PROC_t) (void);
31 : typedef struct { PROC_t proc; } PROC;
32 : # endif
33 :
34 : # if !defined (TRUE)
35 : # define TRUE (1==1)
36 : # endif
37 :
38 : # if !defined (FALSE)
39 : # define FALSE (1==0)
40 : # endif
41 :
42 : #if defined(__cplusplus)
43 : # undef NULL
44 : # define NULL 0
45 : #endif
46 : #define _M2Options_C
47 :
48 : #include "GM2Options.h"
49 : # include "GCmdArgs.h"
50 : # include "GSArgs.h"
51 : # include "GM2Search.h"
52 : # include "GPathName.h"
53 : # include "GM2Printf.h"
54 : # include "GFIO.h"
55 : # include "Glibc.h"
56 : # include "GDebug.h"
57 : # include "Ggcctypes.h"
58 : # include "Gm2configure.h"
59 : # include "GM2Error.h"
60 : # include "GFormatStrings.h"
61 : # include "Gm2misc.h"
62 : # include "GDynamicStrings.h"
63 :
64 : # define Debugging false
65 : # define DefaultRuntimeModuleOverride "m2iso:RTentity,m2iso:Storage,m2iso:SYSTEM,m2iso:M2RTS,m2iso:RTExceptions,m2iso:IOLink"
66 : static DynamicStrings_String DumpDeclFilename;
67 : static DynamicStrings_String DumpQuadFilename;
68 : static DynamicStrings_String DumpGimpleFilename;
69 : static DynamicStrings_String M2Dump;
70 : static DynamicStrings_String M2DumpFilter;
71 : static DynamicStrings_String M2Prefix;
72 : static DynamicStrings_String M2PathName;
73 : static DynamicStrings_String Barg;
74 : static DynamicStrings_String MFarg;
75 : static DynamicStrings_String MTFlag;
76 : static DynamicStrings_String MQFlag;
77 : static DynamicStrings_String DepTarget;
78 : static DynamicStrings_String CmdLineObj;
79 : static DynamicStrings_String SaveTempsDir;
80 : static DynamicStrings_String DumpDir;
81 : static DynamicStrings_String GenModuleListFilename;
82 : static DynamicStrings_String UselistFilename;
83 : static DynamicStrings_String RuntimeModuleOverride;
84 : static DynamicStrings_String CppArgs;
85 : static bool DumpBuiltinsFlag;
86 : static bool EnableForward;
87 : static bool DebugFunctionLineNumbers;
88 : static bool DebugTraceQuad;
89 : static bool DebugTraceLine;
90 : static bool DebugTraceToken;
91 : static bool DebugTraceTree;
92 : static bool DumpDecl;
93 : static bool DumpGimple;
94 : static bool DumpQuad;
95 : static bool WidesetFlag;
96 : static bool MFlag;
97 : static bool MMFlag;
98 : static bool MPFlag;
99 : static bool MDFlag;
100 : static bool MMDFlag;
101 : static bool IBMLongDouble;
102 : static bool IEEELongDouble;
103 : static bool UselistFlag;
104 : static bool CC1Quiet;
105 : static bool SeenSources;
106 : static unsigned int OffTBits;
107 : static location_t ForcedLocationValue;
108 :
109 : /*
110 : SetM - set the MFlag.
111 : */
112 :
113 : extern "C" void M2Options_SetM (bool value);
114 :
115 : /*
116 : GetM - set the MFlag.
117 : */
118 :
119 : extern "C" bool M2Options_GetM (void);
120 :
121 : /*
122 : SetMM - set the MMFlag.
123 : */
124 :
125 : extern "C" void M2Options_SetMM (bool value);
126 :
127 : /*
128 : GetMM - set the MMFlag.
129 : */
130 :
131 : extern "C" bool M2Options_GetMM (void);
132 :
133 : /*
134 : SetMF - assigns MFarg to the filename from arg.
135 : */
136 :
137 : extern "C" void M2Options_SetMF (void * arg);
138 :
139 : /*
140 : GetMF - returns MFarg or NIL if never set.
141 : */
142 :
143 : extern "C" void * M2Options_GetMF (void);
144 :
145 : /*
146 : SetM2Prefix - assign arg to M2Prefix.
147 : */
148 :
149 : extern "C" void M2Options_SetM2Prefix (void * arg);
150 :
151 : /*
152 : GetM2Prefix - return M2Prefix as a C string.
153 : */
154 :
155 : extern "C" void * M2Options_GetM2Prefix (void);
156 :
157 : /*
158 : SetM2PathName - assign arg to M2PathName.
159 : */
160 :
161 : extern "C" void M2Options_SetM2PathName (void * arg);
162 :
163 : /*
164 : GetM2PathName - return M2PathName as a C string.
165 : */
166 :
167 : extern "C" void * M2Options_GetM2PathName (void);
168 :
169 : /*
170 : SetPPOnly - set the PPonly (preprocess only) to value.
171 : */
172 :
173 : extern "C" void M2Options_SetPPOnly (bool value);
174 :
175 : /*
176 : GetPPOnly - get the PPonly (preprocess only).
177 : */
178 :
179 : extern "C" bool M2Options_GetPPOnly (void);
180 :
181 : /*
182 : Setc - set the cflag (compile only flag -c) to value.
183 : */
184 :
185 : extern "C" void M2Options_Setc (bool value);
186 :
187 : /*
188 : Getc - get the cflag (compile only flag -c).
189 : */
190 :
191 : extern "C" bool M2Options_Getc (void);
192 :
193 : /*
194 : SetB - assigns Barg to arg.
195 : */
196 :
197 : extern "C" void M2Options_SetB (void * arg);
198 :
199 : /*
200 : GetB - returns Barg value as a C string or NIL if it was never set.
201 : */
202 :
203 : extern "C" void * M2Options_GetB (void);
204 :
205 : /*
206 : SetMD - set the MDFlag to value.
207 : */
208 :
209 : extern "C" void M2Options_SetMD (bool value);
210 :
211 : /*
212 : GetMD - return the MDFlag.
213 : */
214 :
215 : extern "C" bool M2Options_GetMD (void);
216 :
217 : /*
218 : SetMMD - set the MMDFlag to value.
219 : */
220 :
221 : extern "C" void M2Options_SetMMD (bool value);
222 :
223 : /*
224 : GetMMD - return the MMDFlag.
225 : */
226 :
227 : extern "C" bool M2Options_GetMMD (void);
228 :
229 : /*
230 : SetMQ - adds a quoted target arg to the DepTarget sentence.
231 : */
232 :
233 : extern "C" void M2Options_SetMQ (void * arg);
234 :
235 : /*
236 : GetMQ - returns a C string containing all the -MQ arg values.
237 : */
238 :
239 : extern "C" void * M2Options_GetMQ (void);
240 :
241 : /*
242 : SetMT - adds a target arg to the DepTarget sentence.
243 : */
244 :
245 : extern "C" void M2Options_SetMT (void * arg);
246 :
247 : /*
248 : GetMT - returns a C string containing all the -MT arg values.
249 : */
250 :
251 : extern "C" void * M2Options_GetMT (void);
252 :
253 : /*
254 : GetDepTarget - returns the DepTarget as a C string.
255 : */
256 :
257 : extern "C" void * M2Options_GetDepTarget (void);
258 :
259 : /*
260 : SetMP - set the MPflag to value.
261 : */
262 :
263 : extern "C" void M2Options_SetMP (bool value);
264 :
265 : /*
266 : GetMP - get the MPflag.
267 : */
268 :
269 : extern "C" bool M2Options_GetMP (void);
270 :
271 : /*
272 : SetObj - assigns CmdLineObj to the filename from arg.
273 : */
274 :
275 : extern "C" void M2Options_SetObj (void * arg);
276 :
277 : /*
278 : GetObj - returns CmdLineObj filename as a c-string or NIL if it was never set.
279 : */
280 :
281 : extern "C" void * M2Options_GetObj (void);
282 :
283 : /*
284 : SetCpp - enables the source to be preprocessed and enables the
285 : recognition of C preprocessor line directives.
286 : */
287 :
288 : extern "C" bool M2Options_SetCpp (bool value);
289 :
290 : /*
291 : GetCpp - returns TRUE if the C preprocessor was used.
292 : */
293 :
294 : extern "C" bool M2Options_GetCpp (void);
295 :
296 : /*
297 : GetLineDirectives - returns TRUE if line directives are allowed.
298 : */
299 :
300 : extern "C" bool M2Options_GetLineDirectives (void);
301 :
302 : /*
303 : SetScaffoldDynamic - set the -fscaffold-dynamic flag.
304 : */
305 :
306 : extern "C" void M2Options_SetScaffoldDynamic (bool value);
307 :
308 : /*
309 : SetScaffoldStatic - set the -fscaffold-static flag.
310 : */
311 :
312 : extern "C" void M2Options_SetScaffoldStatic (bool value);
313 :
314 : /*
315 : GetScaffoldDynamic - get the -fscaffold-dynamic flag.
316 : */
317 :
318 : extern "C" bool M2Options_GetScaffoldDynamic (void);
319 :
320 : /*
321 : GetScaffoldStatic - get the -fscaffold-static flag.
322 : */
323 :
324 : extern "C" bool M2Options_GetScaffoldStatic (void);
325 :
326 : /*
327 : SetScaffoldMain - set the -fscaffold-main flag.
328 : */
329 :
330 : extern "C" void M2Options_SetScaffoldMain (bool value);
331 :
332 : /*
333 : SetRuntimeModuleOverride - set the override sequence used for module
334 : initialization and finialization.
335 : */
336 :
337 : extern "C" void M2Options_SetRuntimeModuleOverride (void * override);
338 :
339 : /*
340 : GetRuntimeModuleOverride - return a string containing any user override
341 : or the default module initialization override
342 : sequence.
343 : */
344 :
345 : extern "C" void * M2Options_GetRuntimeModuleOverride (void);
346 :
347 : /*
348 : SetUselist - set the uselist flag to value and remember the filename.
349 : */
350 :
351 : extern "C" void M2Options_SetUselist (bool value, void * filename);
352 :
353 : /*
354 : GetUselist - return the uselist flag.
355 : */
356 :
357 : extern "C" bool M2Options_GetUselist (void);
358 :
359 : /*
360 : GetUselistFilename - return the uselist filename as a String.
361 : */
362 :
363 : extern "C" DynamicStrings_String M2Options_GetUselistFilename (void);
364 :
365 : /*
366 : SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
367 : */
368 :
369 : extern "C" void M2Options_SetWholeProgram (bool value);
370 :
371 : /*
372 : SetAutoInit - -fauto-init turns on automatic initialization of pointers to NIL.
373 : TRUE is returned.
374 : */
375 :
376 : extern "C" bool M2Options_SetAutoInit (bool value);
377 :
378 : /*
379 : SetReturnCheck -
380 : */
381 :
382 : extern "C" bool M2Options_SetReturnCheck (bool value);
383 :
384 : /*
385 : SetNilCheck -
386 : */
387 :
388 : extern "C" bool M2Options_SetNilCheck (bool value);
389 :
390 : /*
391 : SetCaseCheck - set else case checking to, value.
392 : */
393 :
394 : extern "C" bool M2Options_SetCaseCheck (bool value);
395 :
396 : /*
397 : SetCheckAll - set all runtime checking to, value.
398 : */
399 :
400 : extern "C" bool M2Options_SetCheckAll (bool value);
401 :
402 : /*
403 : SetVerboseUnbounded - sets the VerboseUnbounded flag to, value.
404 : */
405 :
406 : extern "C" bool M2Options_SetVerboseUnbounded (bool value);
407 :
408 : /*
409 : SetQuiet - sets the quiet flag to, value.
410 : */
411 :
412 : extern "C" bool M2Options_SetQuiet (bool value);
413 :
414 : /*
415 : SetCC1Quiet - sets the cc1quiet flag to, value.
416 : */
417 :
418 : extern "C" void M2Options_SetCC1Quiet (bool value);
419 :
420 : /*
421 : SetM2g - set GenerateStatementNote to value and return value.
422 : Corresponds to the -fm2-g flag.
423 : */
424 :
425 : extern "C" bool M2Options_SetM2g (bool value);
426 :
427 : /*
428 : GetM2g - returns TRUE if the -fm2-g flags was used.
429 : */
430 :
431 : extern "C" bool M2Options_GetM2g (void);
432 :
433 : /*
434 : SetLowerCaseKeywords - set the lower case keyword flag and return the result.
435 : */
436 :
437 : extern "C" bool M2Options_SetLowerCaseKeywords (bool value);
438 :
439 : /*
440 : SetUnboundedByReference -
441 : */
442 :
443 : extern "C" bool M2Options_SetUnboundedByReference (bool value);
444 :
445 : /*
446 : SetSearchPath -
447 : */
448 :
449 : extern "C" void M2Options_SetSearchPath (void * arg);
450 :
451 : /*
452 : SetISO -
453 : */
454 :
455 : extern "C" void M2Options_SetISO (bool value);
456 :
457 : /*
458 : SetPIM -
459 : */
460 :
461 : extern "C" void M2Options_SetPIM (bool value);
462 :
463 : /*
464 : SetPIM2 -
465 : */
466 :
467 : extern "C" void M2Options_SetPIM2 (bool value);
468 :
469 : /*
470 : SetPIM3 -
471 : */
472 :
473 : extern "C" void M2Options_SetPIM3 (bool value);
474 :
475 : /*
476 : SetPIM4 -
477 : */
478 :
479 : extern "C" void M2Options_SetPIM4 (bool value);
480 :
481 : /*
482 : SetPositiveModFloor - sets the positive mod floor option.
483 : */
484 :
485 : extern "C" void M2Options_SetPositiveModFloor (bool value);
486 :
487 : /*
488 : SetWholeDiv - sets the whole division flag.
489 : */
490 :
491 : extern "C" void M2Options_SetWholeDiv (bool value);
492 :
493 : /*
494 : SetIndex - sets the runtime array index checking flag.
495 : */
496 :
497 : extern "C" void M2Options_SetIndex (bool value);
498 :
499 : /*
500 : SetRange - sets the runtime range checking flag.
501 : */
502 :
503 : extern "C" void M2Options_SetRange (bool value);
504 :
505 : /*
506 : SetExceptions - sets the enable runtime exceptions flag.
507 : */
508 :
509 : extern "C" void M2Options_SetExceptions (bool value);
510 :
511 : /*
512 : SetStyle -
513 : */
514 :
515 : extern "C" void M2Options_SetStyle (bool value);
516 :
517 : /*
518 : SetPedantic -
519 : */
520 :
521 : extern "C" void M2Options_SetPedantic (bool value);
522 :
523 : /*
524 : SetPedanticParamNames - sets the pedantic parameter name flag.
525 : */
526 :
527 : extern "C" void M2Options_SetPedanticParamNames (bool value);
528 :
529 : /*
530 : SetPedanticCast - sets the pedantic cast flag.
531 : */
532 :
533 : extern "C" void M2Options_SetPedanticCast (bool value);
534 :
535 : /*
536 : SetExtendedOpaque - sets the ExtendedOpaque flag.
537 : */
538 :
539 : extern "C" void M2Options_SetExtendedOpaque (bool value);
540 :
541 : /*
542 : SetXCode - sets the xcode flag.
543 : */
544 :
545 : extern "C" void M2Options_SetXCode (bool value);
546 :
547 : /*
548 : SetCompilerDebugging - turn on internal compiler debugging.
549 : Enabled via the command line option -fd.
550 : */
551 :
552 : extern "C" void M2Options_SetCompilerDebugging (bool value);
553 :
554 : /*
555 : SetQuadDebugging - display the quadruples (internal debugging).
556 : */
557 :
558 : extern "C" void M2Options_SetQuadDebugging (bool value);
559 :
560 : /*
561 : SetM2DebugTraceFilter - set internal debug flags. The flags should be
562 : specified as a comma separated list. The full
563 : list allowed is quad,line,token,all.
564 : */
565 :
566 : extern "C" void M2Options_SetM2DebugTraceFilter (bool value, void * filter);
567 :
568 : /*
569 : SetDebugFunctionLineNumbers - set DebugFunctionLineNumbers.
570 : */
571 :
572 : extern "C" void M2Options_SetDebugFunctionLineNumbers (bool value);
573 :
574 : /*
575 : SetGenerateStatementNote - turn on generation of nops if necessary
576 : to generate pedalogical single stepping.
577 : */
578 :
579 : extern "C" void M2Options_SetGenerateStatementNote (bool value);
580 :
581 : /*
582 : SetSources -
583 : */
584 :
585 : extern "C" void M2Options_SetSources (bool value);
586 :
587 : /*
588 : SetDumpSystemExports -
589 : */
590 :
591 : extern "C" void M2Options_SetDumpSystemExports (bool value);
592 :
593 : /*
594 : SetDumpBuiltins - set the value of -fdump-builtins.
595 : */
596 :
597 : extern "C" void M2Options_SetDumpBuiltins (bool value);
598 :
599 : /*
600 : GetDumpBuiltins - return the value of -fdump-builtins.
601 : */
602 :
603 : extern "C" bool M2Options_GetDumpBuiltins (void);
604 :
605 : /*
606 : SetSwig -
607 : */
608 :
609 : extern "C" void M2Options_SetSwig (bool value);
610 :
611 : /*
612 : SetOptimizing -
613 : */
614 :
615 : extern "C" void M2Options_SetOptimizing (unsigned int value);
616 :
617 : /*
618 : OverrideLocation - possibly override the location value, depending upon
619 : whether the -flocation= option was used.
620 : */
621 :
622 : extern "C" location_t M2Options_OverrideLocation (location_t location);
623 :
624 : /*
625 : SetForcedLocation - sets the location for the lifetime of this compile to, location.
626 : This is primarily an internal debugging switch.
627 : */
628 :
629 : extern "C" void M2Options_SetForcedLocation (location_t location);
630 :
631 : /*
632 : SetUnusedVariableChecking - assigns the UnusedVariableChecking to value.
633 : */
634 :
635 : extern "C" void M2Options_SetUnusedVariableChecking (bool value);
636 :
637 : /*
638 : SetUnusedParameterChecking - assigns the UnusedParameterChecking to value.
639 : */
640 :
641 : extern "C" void M2Options_SetUnusedParameterChecking (bool value);
642 :
643 : /*
644 : SetStrictTypeChecking - assigns the StrictTypeChecking flag to value.
645 : */
646 :
647 : extern "C" void M2Options_SetStrictTypeChecking (bool value);
648 :
649 : /*
650 : SetStrictTypeAssignment - assigns the StrictTypeAssignment flag to value.
651 : */
652 :
653 : extern "C" void M2Options_SetStrictTypeAssignment (bool value);
654 :
655 : /*
656 : SetStrictTypeReason - assigns the StrictTypeReason flag to value.
657 : */
658 :
659 : extern "C" void M2Options_SetStrictTypeReason (bool value);
660 :
661 : /*
662 : setdefextension - set the source file definition module extension to arg.
663 : This should include the . and by default it is set to .def.
664 : */
665 :
666 : extern "C" void M2Options_setdefextension (void * arg);
667 :
668 : /*
669 : setmodextension - set the source file module extension to arg.
670 : This should include the . and by default it is set to .mod.
671 : */
672 :
673 : extern "C" void M2Options_setmodextension (void * arg);
674 :
675 : /*
676 : SetStatistics - turn on/off generate of compile time statistics.
677 : */
678 :
679 : extern "C" void M2Options_SetStatistics (bool on);
680 :
681 : /*
682 : SetVerbose - set the Verbose flag to, value. It returns TRUE.
683 : */
684 :
685 : extern "C" bool M2Options_SetVerbose (bool value);
686 :
687 : /*
688 : CppArg - sets the option and arg in the cpp command line.
689 : */
690 :
691 : extern "C" void M2Options_CppArg (void * opt, void * arg, bool joined);
692 :
693 : /*
694 : CppCommandLine - returns the Cpp command line and all arguments.
695 : NIL is returned if the -fcpp is absent.
696 : */
697 :
698 : extern "C" DynamicStrings_String M2Options_CppCommandLine (void);
699 :
700 : /*
701 : CppRemember - remember a string, s, as a cpp related argument.
702 : The string, s, is not garbage collected.
703 : */
704 :
705 : extern "C" void M2Options_CppRemember (DynamicStrings_String s);
706 :
707 : /*
708 : GetISO - return TRUE if -fiso was present on the command line.
709 : */
710 :
711 : extern "C" bool M2Options_GetISO (void);
712 :
713 : /*
714 : GetPIM - return TRUE if -fpim was present on the command line.
715 : */
716 :
717 : extern "C" bool M2Options_GetPIM (void);
718 :
719 : /*
720 : GetPIM2 - return TRUE if -fpim2 was present on the command line.
721 : */
722 :
723 : extern "C" bool M2Options_GetPIM2 (void);
724 :
725 : /*
726 : GetPIM3 - return TRUE if -fpim3 was present on the command line.
727 : */
728 :
729 : extern "C" bool M2Options_GetPIM3 (void);
730 :
731 : /*
732 : GetPIM4 - return TRUE if -fpim4 was present on the command line.
733 : */
734 :
735 : extern "C" bool M2Options_GetPIM4 (void);
736 :
737 : /*
738 : GetPositiveModFloor - return TRUE if -fpositive-mod-floor was present
739 : on the command line.
740 : */
741 :
742 : extern "C" bool M2Options_GetPositiveModFloor (void);
743 :
744 : /*
745 : GetFloatValueCheck - return TRUE if -ffloatvalue was present on the
746 : command line.
747 : */
748 :
749 : extern "C" bool M2Options_GetFloatValueCheck (void);
750 :
751 : /*
752 : SetFloatValueCheck - set depending upon the -ffloatvalue.
753 : */
754 :
755 : extern "C" void M2Options_SetFloatValueCheck (bool value);
756 :
757 : /*
758 : GetWholeValueCheck - return TRUE if -fwholevalue was present on the
759 : command line.
760 : */
761 :
762 : extern "C" bool M2Options_GetWholeValueCheck (void);
763 :
764 : /*
765 : SetWholeValueCheck - set depending upon the -fwholevalue.
766 : */
767 :
768 : extern "C" void M2Options_SetWholeValueCheck (bool value);
769 :
770 : /*
771 : SetWall - set all warnings to, value.
772 : */
773 :
774 : extern "C" void M2Options_SetWall (bool value);
775 :
776 : /*
777 : SetSaveTemps - turn on/off -save-temps.
778 : */
779 :
780 : extern "C" void M2Options_SetSaveTemps (bool value);
781 :
782 : /*
783 : SetSaveTempsDir - turn on/off -save-temps and specify the directory.
784 : */
785 :
786 : extern "C" void M2Options_SetSaveTempsDir (void * arg);
787 :
788 : /*
789 : GetSaveTempsDir - return SaveTempsDir or NIL if -save-temps was not used.
790 : */
791 :
792 : extern "C" DynamicStrings_String M2Options_GetSaveTempsDir (void);
793 :
794 : /*
795 : SetDumpDir - Set the dump dir.
796 : */
797 :
798 : extern "C" void M2Options_SetDumpDir (void * arg);
799 :
800 : /*
801 : GetDumpDir - return DumpDir or NIL.
802 : */
803 :
804 : extern "C" DynamicStrings_String M2Options_GetDumpDir (void);
805 :
806 : /*
807 : SetGenModuleList - set the GenModuleList flag to true and pass
808 : set GenModuleListFilename to filename.
809 : */
810 :
811 : extern "C" void M2Options_SetGenModuleList (bool value, void * filename);
812 :
813 : /*
814 : GetGenModuleFilename - returns the filename set by SetGenModuleList.
815 : */
816 :
817 : extern "C" DynamicStrings_String M2Options_GetGenModuleFilename (void);
818 :
819 : /*
820 : SetShared - sets the SharedFlag to value.
821 : */
822 :
823 : extern "C" void M2Options_SetShared (bool value);
824 :
825 : /*
826 : SetUninitVariableChecking - sets the UninitVariableChecking and
827 : UninitVariableConditionalChecking flags to value
828 : depending upon arg string. The arg string
829 : can be: "all", "known,cond", "cond,known", "known"
830 : or "cond".
831 : */
832 :
833 : extern "C" int M2Options_SetUninitVariableChecking (bool value, void * arg);
834 :
835 : /*
836 : SetCaseEnumChecking - sets the CaseEnumChecking to value.
837 : */
838 :
839 : extern "C" void M2Options_SetCaseEnumChecking (bool value);
840 :
841 : /*
842 : SetDebugBuiltins - sets the DebugBuiltins to value.
843 : */
844 :
845 : extern "C" void M2Options_SetDebugBuiltins (bool value);
846 :
847 : /*
848 : SetIBMLongDouble - enable/disable LONGREAL to map onto the
849 : IBM long double 128 bit data type.
850 : (Only available on the ppc).
851 : */
852 :
853 : extern "C" void M2Options_SetIBMLongDouble (bool value);
854 :
855 : /*
856 : GetIBMLongDouble - return the value of IBMLongDouble.
857 : */
858 :
859 : extern "C" bool M2Options_GetIBMLongDouble (void);
860 :
861 : /*
862 : SetIEEELongDouble - enable/disable LONGREAL to map onto the
863 : IEEE long double 128 bit data type.
864 : (Only available on the ppc).
865 : */
866 :
867 : extern "C" void M2Options_SetIEEELongDouble (bool value);
868 :
869 : /*
870 : GetIEEELongDouble - return the value of IEEELongDouble.
871 : */
872 :
873 : extern "C" bool M2Options_GetIEEELongDouble (void);
874 :
875 : /*
876 : GetDumpDeclFilename - returns the DumpDeclFilename.
877 : */
878 :
879 : extern "C" DynamicStrings_String M2Options_GetDumpDeclFilename (void);
880 :
881 : /*
882 : SetDumpDeclFilename -
883 : */
884 :
885 : extern "C" void M2Options_SetDumpDeclFilename (bool value, void * filename);
886 :
887 : /*
888 : GetDumpQuadFilename - returns the DumpQuadFilename.
889 : */
890 :
891 : extern "C" DynamicStrings_String M2Options_GetDumpQuadFilename (void);
892 :
893 : /*
894 : SetDumpQuadFilename -
895 : */
896 :
897 : extern "C" void M2Options_SetDumpQuadFilename (bool value, void * filename);
898 :
899 : /*
900 : GetDumpGimpleFilename - returns the DumpGimpleFilename.
901 : */
902 :
903 : extern "C" DynamicStrings_String M2Options_GetDumpGimpleFilename (void);
904 :
905 : /*
906 : SetDumpGimpleFilename - set DumpGimpleFilename to filename.
907 : */
908 :
909 : extern "C" void M2Options_SetDumpGimpleFilename (bool value, void * filename);
910 :
911 : /*
912 : SetM2DumpFilter - sets the filter to a comma separated list of procedures
913 : and modules. Not to be confused with SetM2Dump below
914 : which enables the class of data structures to be dumped.
915 : */
916 :
917 : extern "C" void M2Options_SetM2DumpFilter (bool value, void * filter);
918 :
919 : /*
920 : GetM2DumpFilter - returns the dump filter.
921 : */
922 :
923 : extern "C" void * M2Options_GetM2DumpFilter (void);
924 :
925 : /*
926 : SetM2Dump - sets the dump via a comma separated list: quad,decl,gimple,all.
927 : It returns TRUE if the comma separated list is valid.
928 : */
929 :
930 : extern "C" bool M2Options_SetM2Dump (bool value, void * filter);
931 :
932 : /*
933 : GetDumpGimple - return TRUE if the dump gimple flag is set from SetM2Dump.
934 : */
935 :
936 : extern "C" bool M2Options_GetDumpGimple (void);
937 :
938 : /*
939 : GetDumpQuad - return TRUE if the dump quad flag is set from SetM2Dump.
940 : */
941 :
942 : extern "C" bool M2Options_GetDumpQuad (void);
943 :
944 : /*
945 : GetDumpDecl - return TRUE if the dump decl flag is set from SetM2Dump.
946 : */
947 :
948 : extern "C" bool M2Options_GetDumpDecl (void);
949 :
950 : /*
951 : GetDebugTraceQuad - return DebugTraceQuad.
952 : */
953 :
954 : extern "C" bool M2Options_GetDebugTraceQuad (void);
955 :
956 : /*
957 : GetDebugTraceTree - return DebugTraceTree.
958 : */
959 :
960 : extern "C" bool M2Options_GetDebugTraceTree (void);
961 :
962 : /*
963 : GetDebugTraceToken - return DebugTraceToken.
964 : */
965 :
966 : extern "C" bool M2Options_GetDebugTraceToken (void);
967 :
968 : /*
969 : GetDebugTraceLine - return DebugTraceLine.
970 : */
971 :
972 : extern "C" bool M2Options_GetDebugTraceLine (void);
973 :
974 : /*
975 : GetDebugFunctionLineNumbers - return DebugFunctionLineNumbers.
976 : */
977 :
978 : extern "C" bool M2Options_GetDebugFunctionLineNumbers (void);
979 :
980 : /*
981 : GetEnableForward - return EnableForward.
982 : */
983 :
984 : extern "C" bool M2Options_GetEnableForward (void);
985 :
986 : /*
987 : SetEnableForward - set EnableForward to value.
988 : */
989 :
990 : extern "C" void M2Options_SetEnableForward (bool value);
991 :
992 : /*
993 : SetFileOffsetBits - create SYSTEM.COFF_T as a signed integer of size bits.
994 : */
995 :
996 : extern "C" bool M2Options_SetFileOffsetBits (bool value, unsigned int bits);
997 :
998 : /*
999 : GetFileOffsetBits - return the number of bits used to create SYSTEM.COFF_T.
1000 : */
1001 :
1002 : extern "C" unsigned int M2Options_GetFileOffsetBits (void);
1003 :
1004 : /*
1005 : SetMemReport - set MemReport to value.
1006 : */
1007 :
1008 : extern "C" void M2Options_SetMemReport (bool value);
1009 :
1010 : /*
1011 : SetTimeReport - set TimeReport to value.
1012 : */
1013 :
1014 : extern "C" void M2Options_SetTimeReport (bool value);
1015 :
1016 : /*
1017 : SetWideset - set the Wideset flag to value.
1018 : */
1019 :
1020 : extern "C" void M2Options_SetWideset (bool value);
1021 :
1022 : /*
1023 : GetWideset - return the Wideset flag value.
1024 : */
1025 :
1026 : extern "C" bool M2Options_GetWideset (void);
1027 :
1028 : /*
1029 : FinaliseOptions - once all options have been parsed we set any inferred
1030 : values.
1031 : */
1032 :
1033 : extern "C" void M2Options_FinaliseOptions (void);
1034 :
1035 : /*
1036 : errors1 -
1037 : */
1038 :
1039 : static void errors1 (const char *format_, unsigned int _format_high, DynamicStrings_String arg);
1040 :
1041 : /*
1042 : AddWord - concats a word to sentence inserting a space if necessary.
1043 : sentence is returned. sentence will be created if it is NIL.
1044 : */
1045 :
1046 : static DynamicStrings_String AddWord (DynamicStrings_String sentence, DynamicStrings_String word);
1047 :
1048 : /*
1049 : QuoteTarget - quote the '$' character.
1050 : */
1051 :
1052 : static DynamicStrings_String QuoteTarget (DynamicStrings_String target);
1053 :
1054 : /*
1055 : SetM2DebugTrace -
1056 : */
1057 :
1058 : static void SetM2DebugTrace (DynamicStrings_String word, bool value);
1059 :
1060 : /*
1061 : InitializeLongDoubleFlags - initialize the long double related flags
1062 : with default values given during gcc configure.
1063 : */
1064 :
1065 : static void InitializeLongDoubleFlags (void);
1066 :
1067 : /*
1068 : MatchDump - enable/disable dump using value. It returns TRUE if dump
1069 : is valid.
1070 : */
1071 :
1072 : static bool MatchDump (DynamicStrings_String dump, bool value);
1073 :
1074 :
1075 : /*
1076 : errors1 -
1077 : */
1078 :
1079 0 : static void errors1 (const char *format_, unsigned int _format_high, DynamicStrings_String arg)
1080 : {
1081 0 : DynamicStrings_String message;
1082 0 : void * cstr;
1083 0 : char format[_format_high+1];
1084 :
1085 : /* make a local copy of each unbounded array. */
1086 0 : memcpy (format, format_, _format_high+1);
1087 :
1088 0 : message = FormatStrings_Sprintf1 (DynamicStrings_InitString ((const char *) format, _format_high), (const unsigned char *) &arg, (sizeof (arg)-1));
1089 0 : cstr = DynamicStrings_string (message);
1090 0 : m2misc_cerror (cstr);
1091 0 : libc_exit (1);
1092 : }
1093 :
1094 :
1095 : /*
1096 : AddWord - concats a word to sentence inserting a space if necessary.
1097 : sentence is returned. sentence will be created if it is NIL.
1098 : */
1099 :
1100 0 : static DynamicStrings_String AddWord (DynamicStrings_String sentence, DynamicStrings_String word)
1101 : {
1102 0 : if (word != NULL)
1103 : {
1104 : /* avoid gcc warning by using compound statement even if not strictly necessary. */
1105 0 : if (sentence == NULL)
1106 : {
1107 0 : sentence = DynamicStrings_Dup (word);
1108 : }
1109 : else
1110 : {
1111 0 : sentence = DynamicStrings_ConCatChar (sentence, ' ');
1112 0 : sentence = DynamicStrings_ConCat (sentence, word);
1113 : }
1114 : }
1115 0 : return sentence;
1116 : /* static analysis guarentees a RETURN statement will be used before here. */
1117 : __builtin_unreachable ();
1118 : }
1119 :
1120 :
1121 : /*
1122 : QuoteTarget - quote the '$' character.
1123 : */
1124 :
1125 0 : static DynamicStrings_String QuoteTarget (DynamicStrings_String target)
1126 : {
1127 0 : DynamicStrings_String quoted;
1128 0 : unsigned int i;
1129 0 : unsigned int n;
1130 :
1131 0 : quoted = DynamicStrings_InitString ((const char *) "", 0);
1132 0 : i = 0;
1133 0 : n = DynamicStrings_Length (target);
1134 0 : while (i < n)
1135 : {
1136 0 : switch (DynamicStrings_char (target, static_cast<int> (i)))
1137 : {
1138 0 : case '$':
1139 0 : quoted = DynamicStrings_ConCat (quoted, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "$$", 2)));
1140 0 : break;
1141 :
1142 :
1143 0 : default:
1144 0 : quoted = DynamicStrings_ConCatChar (quoted, DynamicStrings_char (target, static_cast<int> (i)));
1145 0 : break;
1146 : }
1147 0 : i += 1;
1148 : }
1149 0 : return quoted;
1150 : /* static analysis guarentees a RETURN statement will be used before here. */
1151 : __builtin_unreachable ();
1152 : }
1153 :
1154 :
1155 : /*
1156 : SetM2DebugTrace -
1157 : */
1158 :
1159 0 : static void SetM2DebugTrace (DynamicStrings_String word, bool value)
1160 : {
1161 0 : if (DynamicStrings_EqualArray (word, (const char *) "all", 3))
1162 : {
1163 : /* DebugTraceTree := value ; */
1164 0 : DebugTraceQuad = value;
1165 0 : DebugTraceToken = value;
1166 0 : DebugTraceLine = value;
1167 : }
1168 0 : else if (DynamicStrings_EqualArray (word, (const char *) "quad", 4))
1169 : {
1170 : /* avoid dangling else. */
1171 0 : DebugTraceQuad = value;
1172 : }
1173 0 : else if (DynamicStrings_EqualArray (word, (const char *) "token", 5))
1174 : {
1175 : /* avoid dangling else. */
1176 0 : DebugTraceToken = value;
1177 : }
1178 0 : else if (DynamicStrings_EqualArray (word, (const char *) "line", 4))
1179 : {
1180 : /* avoid dangling else. */
1181 0 : DebugTraceLine = value;
1182 : }
1183 : else
1184 : {
1185 : /* avoid dangling else. */
1186 0 : errors1 ((const char *) "unrecognized filter %s seen in -fm2-debug-trace= option\\n", 57, word);
1187 : }
1188 0 : }
1189 :
1190 :
1191 : /*
1192 : InitializeLongDoubleFlags - initialize the long double related flags
1193 : with default values given during gcc configure.
1194 : */
1195 :
1196 16892 : static void InitializeLongDoubleFlags (void)
1197 : {
1198 16892 : IBMLongDouble = false;
1199 16892 : IEEELongDouble = false;
1200 16892 : switch (m2configure_TargetIEEEQuadDefault ())
1201 : {
1202 : case -1:
1203 : break;
1204 :
1205 0 : case 0:
1206 0 : IBMLongDouble = true;
1207 0 : break;
1208 :
1209 0 : case 1:
1210 0 : IEEELongDouble = true;
1211 0 : break;
1212 :
1213 :
1214 0 : default:
1215 0 : M2Error_InternalError ((const char *) "unexpected value returned from TargetIEEEQuadDefault ()", 55);
1216 16892 : break;
1217 : }
1218 16892 : }
1219 :
1220 :
1221 : /*
1222 : MatchDump - enable/disable dump using value. It returns TRUE if dump
1223 : is valid.
1224 : */
1225 :
1226 0 : static bool MatchDump (DynamicStrings_String dump, bool value)
1227 : {
1228 0 : if (DynamicStrings_EqualArray (dump, (const char *) "all", 3))
1229 : {
1230 0 : DumpDecl = value;
1231 0 : DumpQuad = value;
1232 0 : DumpGimple = value;
1233 0 : return true;
1234 : }
1235 0 : else if (DynamicStrings_EqualArray (dump, (const char *) "decl", 4))
1236 : {
1237 : /* avoid dangling else. */
1238 0 : DumpDecl = value;
1239 0 : return true;
1240 : }
1241 0 : else if (DynamicStrings_EqualArray (dump, (const char *) "gimple", 6))
1242 : {
1243 : /* avoid dangling else. */
1244 0 : DumpGimple = value;
1245 0 : return true;
1246 : }
1247 0 : else if (DynamicStrings_EqualArray (dump, (const char *) "quad", 4))
1248 : {
1249 : /* avoid dangling else. */
1250 0 : DumpQuad = value;
1251 0 : return true;
1252 : }
1253 : return false;
1254 : /* static analysis guarentees a RETURN statement will be used before here. */
1255 : __builtin_unreachable ();
1256 : }
1257 :
1258 :
1259 : /*
1260 : SetM - set the MFlag.
1261 : */
1262 :
1263 0 : extern "C" void M2Options_SetM (bool value)
1264 : {
1265 0 : MFlag = value;
1266 0 : }
1267 :
1268 :
1269 : /*
1270 : GetM - set the MFlag.
1271 : */
1272 :
1273 36490 : extern "C" bool M2Options_GetM (void)
1274 : {
1275 36490 : return MFlag;
1276 : /* static analysis guarentees a RETURN statement will be used before here. */
1277 : __builtin_unreachable ();
1278 : }
1279 :
1280 :
1281 : /*
1282 : SetMM - set the MMFlag.
1283 : */
1284 :
1285 0 : extern "C" void M2Options_SetMM (bool value)
1286 : {
1287 0 : MMFlag = value;
1288 0 : }
1289 :
1290 :
1291 : /*
1292 : GetMM - set the MMFlag.
1293 : */
1294 :
1295 36490 : extern "C" bool M2Options_GetMM (void)
1296 : {
1297 36490 : return MMFlag;
1298 : /* static analysis guarentees a RETURN statement will be used before here. */
1299 : __builtin_unreachable ();
1300 : }
1301 :
1302 :
1303 : /*
1304 : SetMF - assigns MFarg to the filename from arg.
1305 : */
1306 :
1307 0 : extern "C" void M2Options_SetMF (void * arg)
1308 : {
1309 0 : MFarg = DynamicStrings_KillString (MFarg);
1310 0 : MFarg = DynamicStrings_InitStringCharStar (arg);
1311 0 : }
1312 :
1313 :
1314 : /*
1315 : GetMF - returns MFarg or NIL if never set.
1316 : */
1317 :
1318 16892 : extern "C" void * M2Options_GetMF (void)
1319 : {
1320 16892 : return DynamicStrings_string (MFarg);
1321 : /* static analysis guarentees a RETURN statement will be used before here. */
1322 : __builtin_unreachable ();
1323 : }
1324 :
1325 :
1326 : /*
1327 : SetM2Prefix - assign arg to M2Prefix.
1328 : */
1329 :
1330 624 : extern "C" void M2Options_SetM2Prefix (void * arg)
1331 : {
1332 624 : M2Prefix = DynamicStrings_KillString (M2Prefix);
1333 624 : M2Prefix = DynamicStrings_InitStringCharStar (arg);
1334 624 : }
1335 :
1336 :
1337 : /*
1338 : GetM2Prefix - return M2Prefix as a C string.
1339 : */
1340 :
1341 16881 : extern "C" void * M2Options_GetM2Prefix (void)
1342 : {
1343 16881 : return DynamicStrings_string (M2Prefix);
1344 : /* static analysis guarentees a RETURN statement will be used before here. */
1345 : __builtin_unreachable ();
1346 : }
1347 :
1348 :
1349 : /*
1350 : SetM2PathName - assign arg to M2PathName.
1351 : */
1352 :
1353 335554 : extern "C" void M2Options_SetM2PathName (void * arg)
1354 : {
1355 335554 : M2PathName = DynamicStrings_KillString (M2PathName);
1356 335554 : M2PathName = DynamicStrings_InitStringCharStar (arg);
1357 335554 : }
1358 :
1359 :
1360 : /*
1361 : GetM2PathName - return M2PathName as a C string.
1362 : */
1363 :
1364 386718 : extern "C" void * M2Options_GetM2PathName (void)
1365 : {
1366 386718 : return DynamicStrings_string (M2PathName);
1367 : /* static analysis guarentees a RETURN statement will be used before here. */
1368 : __builtin_unreachable ();
1369 : }
1370 :
1371 :
1372 : /*
1373 : SetPPOnly - set the PPonly (preprocess only) to value.
1374 : */
1375 :
1376 0 : extern "C" void M2Options_SetPPOnly (bool value)
1377 : {
1378 0 : M2Options_PPonly = value;
1379 0 : }
1380 :
1381 :
1382 : /*
1383 : GetPPOnly - get the PPonly (preprocess only).
1384 : */
1385 :
1386 66026 : extern "C" bool M2Options_GetPPOnly (void)
1387 : {
1388 66026 : return M2Options_PPonly;
1389 : /* static analysis guarentees a RETURN statement will be used before here. */
1390 : __builtin_unreachable ();
1391 : }
1392 :
1393 :
1394 : /*
1395 : Setc - set the cflag (compile only flag -c) to value.
1396 : */
1397 :
1398 14081 : extern "C" void M2Options_Setc (bool value)
1399 : {
1400 14081 : M2Options_cflag = value;
1401 14081 : }
1402 :
1403 :
1404 : /*
1405 : Getc - get the cflag (compile only flag -c).
1406 : */
1407 :
1408 0 : extern "C" bool M2Options_Getc (void)
1409 : {
1410 0 : return M2Options_cflag;
1411 : /* static analysis guarentees a RETURN statement will be used before here. */
1412 : __builtin_unreachable ();
1413 : }
1414 :
1415 :
1416 : /*
1417 : SetB - assigns Barg to arg.
1418 : */
1419 :
1420 16892 : extern "C" void M2Options_SetB (void * arg)
1421 : {
1422 16892 : Barg = DynamicStrings_KillString (Barg);
1423 16892 : Barg = DynamicStrings_InitStringCharStar (arg);
1424 16892 : }
1425 :
1426 :
1427 : /*
1428 : GetB - returns Barg value as a C string or NIL if it was never set.
1429 : */
1430 :
1431 2868 : extern "C" void * M2Options_GetB (void)
1432 : {
1433 2868 : return DynamicStrings_string (Barg);
1434 : /* static analysis guarentees a RETURN statement will be used before here. */
1435 : __builtin_unreachable ();
1436 : }
1437 :
1438 :
1439 : /*
1440 : SetMD - set the MDFlag to value.
1441 : */
1442 :
1443 0 : extern "C" void M2Options_SetMD (bool value)
1444 : {
1445 0 : MDFlag = value;
1446 0 : }
1447 :
1448 :
1449 : /*
1450 : GetMD - return the MDFlag.
1451 : */
1452 :
1453 528 : extern "C" bool M2Options_GetMD (void)
1454 : {
1455 528 : return MDFlag;
1456 : /* static analysis guarentees a RETURN statement will be used before here. */
1457 : __builtin_unreachable ();
1458 : }
1459 :
1460 :
1461 : /*
1462 : SetMMD - set the MMDFlag to value.
1463 : */
1464 :
1465 0 : extern "C" void M2Options_SetMMD (bool value)
1466 : {
1467 0 : MMDFlag = value;
1468 0 : }
1469 :
1470 :
1471 : /*
1472 : GetMMD - return the MMDFlag.
1473 : */
1474 :
1475 528 : extern "C" bool M2Options_GetMMD (void)
1476 : {
1477 528 : return MMDFlag;
1478 : /* static analysis guarentees a RETURN statement will be used before here. */
1479 : __builtin_unreachable ();
1480 : }
1481 :
1482 :
1483 : /*
1484 : SetMQ - adds a quoted target arg to the DepTarget sentence.
1485 : */
1486 :
1487 0 : extern "C" void M2Options_SetMQ (void * arg)
1488 : {
1489 0 : DepTarget = AddWord (DepTarget, QuoteTarget (DynamicStrings_InitStringCharStar (arg)));
1490 0 : MQFlag = AddWord (MQFlag, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "-MQ", 3)));
1491 0 : MQFlag = AddWord (MQFlag, DynamicStrings_Mark (DynamicStrings_InitStringCharStar (arg)));
1492 0 : }
1493 :
1494 :
1495 : /*
1496 : GetMQ - returns a C string containing all the -MQ arg values.
1497 : */
1498 :
1499 0 : extern "C" void * M2Options_GetMQ (void)
1500 : {
1501 0 : return DynamicStrings_string (MQFlag);
1502 : /* static analysis guarentees a RETURN statement will be used before here. */
1503 : __builtin_unreachable ();
1504 : }
1505 :
1506 :
1507 : /*
1508 : SetMT - adds a target arg to the DepTarget sentence.
1509 : */
1510 :
1511 0 : extern "C" void M2Options_SetMT (void * arg)
1512 : {
1513 0 : DepTarget = AddWord (DepTarget, DynamicStrings_InitStringCharStar (arg));
1514 0 : MTFlag = AddWord (MTFlag, DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "-MT", 3)));
1515 0 : MTFlag = AddWord (MTFlag, DynamicStrings_Mark (DynamicStrings_InitStringCharStar (arg)));
1516 0 : }
1517 :
1518 :
1519 : /*
1520 : GetMT - returns a C string containing all the -MT arg values.
1521 : */
1522 :
1523 0 : extern "C" void * M2Options_GetMT (void)
1524 : {
1525 0 : return DynamicStrings_string (MTFlag);
1526 : /* static analysis guarentees a RETURN statement will be used before here. */
1527 : __builtin_unreachable ();
1528 : }
1529 :
1530 :
1531 : /*
1532 : GetDepTarget - returns the DepTarget as a C string.
1533 : */
1534 :
1535 0 : extern "C" void * M2Options_GetDepTarget (void)
1536 : {
1537 0 : return DynamicStrings_string (DepTarget);
1538 : /* static analysis guarentees a RETURN statement will be used before here. */
1539 : __builtin_unreachable ();
1540 : }
1541 :
1542 :
1543 : /*
1544 : SetMP - set the MPflag to value.
1545 : */
1546 :
1547 0 : extern "C" void M2Options_SetMP (bool value)
1548 : {
1549 0 : MPFlag = value;
1550 0 : }
1551 :
1552 :
1553 : /*
1554 : GetMP - get the MPflag.
1555 : */
1556 :
1557 0 : extern "C" bool M2Options_GetMP (void)
1558 : {
1559 0 : return MPFlag;
1560 : /* static analysis guarentees a RETURN statement will be used before here. */
1561 : __builtin_unreachable ();
1562 : }
1563 :
1564 :
1565 : /*
1566 : SetObj - assigns CmdLineObj to the filename from arg.
1567 : */
1568 :
1569 16892 : extern "C" void M2Options_SetObj (void * arg)
1570 : {
1571 16892 : CmdLineObj = DynamicStrings_KillString (CmdLineObj);
1572 16892 : CmdLineObj = DynamicStrings_InitStringCharStar (arg);
1573 16892 : }
1574 :
1575 :
1576 : /*
1577 : GetObj - returns CmdLineObj filename as a c-string or NIL if it was never set.
1578 : */
1579 :
1580 0 : extern "C" void * M2Options_GetObj (void)
1581 : {
1582 0 : return DynamicStrings_string (CmdLineObj);
1583 : /* static analysis guarentees a RETURN statement will be used before here. */
1584 : __builtin_unreachable ();
1585 : }
1586 :
1587 :
1588 : /*
1589 : SetCpp - enables the source to be preprocessed and enables the
1590 : recognition of C preprocessor line directives.
1591 : */
1592 :
1593 528 : extern "C" bool M2Options_SetCpp (bool value)
1594 : {
1595 528 : M2Options_CPreProcessor = value;
1596 528 : M2Options_LineDirectives = value;
1597 528 : return true;
1598 : /* static analysis guarentees a RETURN statement will be used before here. */
1599 : __builtin_unreachable ();
1600 : }
1601 :
1602 :
1603 : /*
1604 : GetCpp - returns TRUE if the C preprocessor was used.
1605 : */
1606 :
1607 26239511 : extern "C" bool M2Options_GetCpp (void)
1608 : {
1609 26239511 : return M2Options_CPreProcessor;
1610 : /* static analysis guarentees a RETURN statement will be used before here. */
1611 : __builtin_unreachable ();
1612 : }
1613 :
1614 :
1615 : /*
1616 : GetLineDirectives - returns TRUE if line directives are allowed.
1617 : */
1618 :
1619 32854 : extern "C" bool M2Options_GetLineDirectives (void)
1620 : {
1621 32854 : return M2Options_LineDirectives;
1622 : /* static analysis guarentees a RETURN statement will be used before here. */
1623 : __builtin_unreachable ();
1624 : }
1625 :
1626 :
1627 : /*
1628 : SetScaffoldDynamic - set the -fscaffold-dynamic flag.
1629 : */
1630 :
1631 16892 : extern "C" void M2Options_SetScaffoldDynamic (bool value)
1632 : {
1633 16892 : M2Options_ScaffoldDynamic = value;
1634 16892 : if (M2Options_ScaffoldDynamic)
1635 : {
1636 16816 : M2Options_ScaffoldStatic = false;
1637 : }
1638 16892 : }
1639 :
1640 :
1641 : /*
1642 : SetScaffoldStatic - set the -fscaffold-static flag.
1643 : */
1644 :
1645 54 : extern "C" void M2Options_SetScaffoldStatic (bool value)
1646 : {
1647 54 : M2Options_ScaffoldStatic = value;
1648 54 : if (M2Options_ScaffoldStatic)
1649 : {
1650 0 : M2Options_ScaffoldDynamic = false;
1651 : }
1652 54 : }
1653 :
1654 :
1655 : /*
1656 : GetScaffoldDynamic - get the -fscaffold-dynamic flag.
1657 : */
1658 :
1659 0 : extern "C" bool M2Options_GetScaffoldDynamic (void)
1660 : {
1661 0 : return M2Options_ScaffoldDynamic;
1662 : /* static analysis guarentees a RETURN statement will be used before here. */
1663 : __builtin_unreachable ();
1664 : }
1665 :
1666 :
1667 : /*
1668 : GetScaffoldStatic - get the -fscaffold-static flag.
1669 : */
1670 :
1671 0 : extern "C" bool M2Options_GetScaffoldStatic (void)
1672 : {
1673 0 : return M2Options_ScaffoldStatic;
1674 : /* static analysis guarentees a RETURN statement will be used before here. */
1675 : __builtin_unreachable ();
1676 : }
1677 :
1678 :
1679 : /*
1680 : SetScaffoldMain - set the -fscaffold-main flag.
1681 : */
1682 :
1683 2812 : extern "C" void M2Options_SetScaffoldMain (bool value)
1684 : {
1685 2812 : M2Options_ScaffoldMain = value;
1686 2812 : }
1687 :
1688 :
1689 : /*
1690 : SetRuntimeModuleOverride - set the override sequence used for module
1691 : initialization and finialization.
1692 : */
1693 :
1694 0 : extern "C" void M2Options_SetRuntimeModuleOverride (void * override)
1695 : {
1696 0 : RuntimeModuleOverride = DynamicStrings_KillString (RuntimeModuleOverride);
1697 0 : RuntimeModuleOverride = DynamicStrings_InitStringCharStar (override);
1698 0 : }
1699 :
1700 :
1701 : /*
1702 : GetRuntimeModuleOverride - return a string containing any user override
1703 : or the default module initialization override
1704 : sequence.
1705 : */
1706 :
1707 2749 : extern "C" void * M2Options_GetRuntimeModuleOverride (void)
1708 : {
1709 2749 : return DynamicStrings_string (RuntimeModuleOverride);
1710 : /* static analysis guarentees a RETURN statement will be used before here. */
1711 : __builtin_unreachable ();
1712 : }
1713 :
1714 :
1715 : /*
1716 : SetUselist - set the uselist flag to value and remember the filename.
1717 : */
1718 :
1719 0 : extern "C" void M2Options_SetUselist (bool value, void * filename)
1720 : {
1721 0 : UselistFlag = value;
1722 0 : UselistFilename = DynamicStrings_KillString (UselistFilename);
1723 0 : if (filename != NULL)
1724 : {
1725 0 : UselistFilename = DynamicStrings_InitStringCharStar (filename);
1726 : }
1727 0 : }
1728 :
1729 :
1730 : /*
1731 : GetUselist - return the uselist flag.
1732 : */
1733 :
1734 16517 : extern "C" bool M2Options_GetUselist (void)
1735 : {
1736 16517 : return UselistFlag;
1737 : /* static analysis guarentees a RETURN statement will be used before here. */
1738 : __builtin_unreachable ();
1739 : }
1740 :
1741 :
1742 : /*
1743 : GetUselistFilename - return the uselist filename as a String.
1744 : */
1745 :
1746 0 : extern "C" DynamicStrings_String M2Options_GetUselistFilename (void)
1747 : {
1748 0 : return UselistFilename;
1749 : /* static analysis guarentees a RETURN statement will be used before here. */
1750 : __builtin_unreachable ();
1751 : }
1752 :
1753 :
1754 : /*
1755 : SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
1756 : */
1757 :
1758 24 : extern "C" void M2Options_SetWholeProgram (bool value)
1759 : {
1760 24 : M2Options_WholeProgram = value;
1761 24 : }
1762 :
1763 :
1764 : /*
1765 : SetAutoInit - -fauto-init turns on automatic initialization of pointers to NIL.
1766 : TRUE is returned.
1767 : */
1768 :
1769 12 : extern "C" bool M2Options_SetAutoInit (bool value)
1770 : {
1771 12 : M2Options_AutoInit = value;
1772 12 : return true;
1773 : /* static analysis guarentees a RETURN statement will be used before here. */
1774 : __builtin_unreachable ();
1775 : }
1776 :
1777 :
1778 : /*
1779 : SetReturnCheck -
1780 : */
1781 :
1782 0 : extern "C" bool M2Options_SetReturnCheck (bool value)
1783 : {
1784 0 : M2Options_ReturnChecking = value;
1785 0 : return true;
1786 : /* static analysis guarentees a RETURN statement will be used before here. */
1787 : __builtin_unreachable ();
1788 : }
1789 :
1790 :
1791 : /*
1792 : SetNilCheck -
1793 : */
1794 :
1795 0 : extern "C" bool M2Options_SetNilCheck (bool value)
1796 : {
1797 0 : M2Options_NilChecking = value;
1798 0 : return true;
1799 : /* static analysis guarentees a RETURN statement will be used before here. */
1800 : __builtin_unreachable ();
1801 : }
1802 :
1803 :
1804 : /*
1805 : SetCaseCheck - set else case checking to, value.
1806 : */
1807 :
1808 616 : extern "C" bool M2Options_SetCaseCheck (bool value)
1809 : {
1810 616 : M2Options_CaseElseChecking = value;
1811 616 : return true;
1812 : /* static analysis guarentees a RETURN statement will be used before here. */
1813 : __builtin_unreachable ();
1814 : }
1815 :
1816 :
1817 : /*
1818 : SetCheckAll - set all runtime checking to, value.
1819 : */
1820 :
1821 2063 : extern "C" bool M2Options_SetCheckAll (bool value)
1822 : {
1823 2063 : M2Options_NilChecking = value;
1824 2063 : M2Options_WholeDivChecking = value;
1825 2063 : M2Options_IndexChecking = value;
1826 2063 : M2Options_RangeChecking = value;
1827 2063 : M2Options_ReturnChecking = value;
1828 2063 : M2Options_NilChecking = value;
1829 2063 : M2Options_CaseElseChecking = value;
1830 2063 : M2Options_FloatValueChecking = value;
1831 2063 : M2Options_WholeValueChecking = value;
1832 2063 : return true;
1833 : /* static analysis guarentees a RETURN statement will be used before here. */
1834 : __builtin_unreachable ();
1835 : }
1836 :
1837 :
1838 : /*
1839 : SetVerboseUnbounded - sets the VerboseUnbounded flag to, value.
1840 : */
1841 :
1842 0 : extern "C" bool M2Options_SetVerboseUnbounded (bool value)
1843 : {
1844 0 : M2Options_VerboseUnbounded = value;
1845 0 : return true;
1846 : /* static analysis guarentees a RETURN statement will be used before here. */
1847 : __builtin_unreachable ();
1848 : }
1849 :
1850 :
1851 : /*
1852 : SetQuiet - sets the quiet flag to, value.
1853 : */
1854 :
1855 17420 : extern "C" bool M2Options_SetQuiet (bool value)
1856 : {
1857 17420 : M2Options_Quiet = value;
1858 17420 : return true;
1859 : /* static analysis guarentees a RETURN statement will be used before here. */
1860 : __builtin_unreachable ();
1861 : }
1862 :
1863 :
1864 : /*
1865 : SetCC1Quiet - sets the cc1quiet flag to, value.
1866 : */
1867 :
1868 16892 : extern "C" void M2Options_SetCC1Quiet (bool value)
1869 : {
1870 16892 : CC1Quiet = value;
1871 16892 : }
1872 :
1873 :
1874 : /*
1875 : SetM2g - set GenerateStatementNote to value and return value.
1876 : Corresponds to the -fm2-g flag.
1877 : */
1878 :
1879 520 : extern "C" bool M2Options_SetM2g (bool value)
1880 : {
1881 520 : M2Options_GenerateStatementNote = value;
1882 520 : return M2Options_GenerateStatementNote;
1883 : /* static analysis guarentees a RETURN statement will be used before here. */
1884 : __builtin_unreachable ();
1885 : }
1886 :
1887 :
1888 : /*
1889 : GetM2g - returns TRUE if the -fm2-g flags was used.
1890 : */
1891 :
1892 442949 : extern "C" bool M2Options_GetM2g (void)
1893 : {
1894 442949 : return M2Options_GenerateStatementNote;
1895 : /* static analysis guarentees a RETURN statement will be used before here. */
1896 : __builtin_unreachable ();
1897 : }
1898 :
1899 :
1900 : /*
1901 : SetLowerCaseKeywords - set the lower case keyword flag and return the result.
1902 : */
1903 :
1904 0 : extern "C" bool M2Options_SetLowerCaseKeywords (bool value)
1905 : {
1906 0 : M2Options_LowerCaseKeywords = value;
1907 0 : return M2Options_LowerCaseKeywords;
1908 : /* static analysis guarentees a RETURN statement will be used before here. */
1909 : __builtin_unreachable ();
1910 : }
1911 :
1912 :
1913 : /*
1914 : SetUnboundedByReference -
1915 : */
1916 :
1917 0 : extern "C" bool M2Options_SetUnboundedByReference (bool value)
1918 : {
1919 0 : M2Options_UnboundedByReference = value;
1920 0 : return true;
1921 : /* static analysis guarentees a RETURN statement will be used before here. */
1922 : __builtin_unreachable ();
1923 : }
1924 :
1925 :
1926 : /*
1927 : SetSearchPath -
1928 : */
1929 :
1930 274752 : extern "C" void M2Options_SetSearchPath (void * arg)
1931 : {
1932 274752 : DynamicStrings_String s;
1933 :
1934 274752 : s = DynamicStrings_InitStringCharStar (arg);
1935 274752 : PathName_AddInclude (M2PathName, s);
1936 274752 : if (Debugging)
1937 : {
1938 : PathName_DumpPathName ((const char *) "path name entries: ", 19);
1939 : }
1940 274752 : s = DynamicStrings_KillString (s);
1941 274752 : }
1942 :
1943 :
1944 : /*
1945 : SetISO -
1946 : */
1947 :
1948 4455 : extern "C" void M2Options_SetISO (bool value)
1949 : {
1950 4455 : M2Options_Iso = value;
1951 4455 : M2Options_Pim = ! value;
1952 4455 : M2Options_Pim2 = ! value;
1953 4455 : }
1954 :
1955 :
1956 : /*
1957 : SetPIM -
1958 : */
1959 :
1960 11944 : extern "C" void M2Options_SetPIM (bool value)
1961 : {
1962 11944 : M2Options_Pim = value;
1963 11944 : M2Options_Iso = ! value;
1964 11944 : }
1965 :
1966 :
1967 : /*
1968 : SetPIM2 -
1969 : */
1970 :
1971 86 : extern "C" void M2Options_SetPIM2 (bool value)
1972 : {
1973 86 : M2Options_Pim = value;
1974 86 : M2Options_Pim2 = value;
1975 86 : M2Options_Iso = ! value;
1976 86 : if (value)
1977 : {
1978 : /* Pim4 is the default, turn it off. */
1979 86 : M2Options_Pim4 = false;
1980 : }
1981 86 : }
1982 :
1983 :
1984 : /*
1985 : SetPIM3 -
1986 : */
1987 :
1988 12 : extern "C" void M2Options_SetPIM3 (bool value)
1989 : {
1990 12 : M2Options_Pim = value;
1991 12 : M2Options_Pim3 = value;
1992 12 : M2Options_Iso = ! value;
1993 12 : if (value)
1994 : {
1995 : /* Pim4 is the default, turn it off. */
1996 12 : M2Options_Pim4 = false;
1997 : }
1998 12 : }
1999 :
2000 :
2001 : /*
2002 : SetPIM4 -
2003 : */
2004 :
2005 75 : extern "C" void M2Options_SetPIM4 (bool value)
2006 : {
2007 75 : M2Options_Pim = value;
2008 75 : M2Options_Pim4 = value;
2009 75 : M2Options_Iso = ! value;
2010 75 : }
2011 :
2012 :
2013 : /*
2014 : SetPositiveModFloor - sets the positive mod floor option.
2015 : */
2016 :
2017 0 : extern "C" void M2Options_SetPositiveModFloor (bool value)
2018 : {
2019 0 : M2Options_PositiveModFloorDiv = value;
2020 0 : }
2021 :
2022 :
2023 : /*
2024 : SetWholeDiv - sets the whole division flag.
2025 : */
2026 :
2027 0 : extern "C" void M2Options_SetWholeDiv (bool value)
2028 : {
2029 0 : M2Options_WholeDivChecking = value;
2030 0 : }
2031 :
2032 :
2033 : /*
2034 : SetIndex - sets the runtime array index checking flag.
2035 : */
2036 :
2037 0 : extern "C" void M2Options_SetIndex (bool value)
2038 : {
2039 0 : M2Options_IndexChecking = value;
2040 0 : }
2041 :
2042 :
2043 : /*
2044 : SetRange - sets the runtime range checking flag.
2045 : */
2046 :
2047 6 : extern "C" void M2Options_SetRange (bool value)
2048 : {
2049 6 : M2Options_RangeChecking = value;
2050 6 : }
2051 :
2052 :
2053 : /*
2054 : SetExceptions - sets the enable runtime exceptions flag.
2055 : */
2056 :
2057 18 : extern "C" void M2Options_SetExceptions (bool value)
2058 : {
2059 18 : M2Options_Exceptions = value;
2060 18 : }
2061 :
2062 :
2063 : /*
2064 : SetStyle -
2065 : */
2066 :
2067 1 : extern "C" void M2Options_SetStyle (bool value)
2068 : {
2069 1 : M2Options_StyleChecking = value;
2070 1 : }
2071 :
2072 :
2073 : /*
2074 : SetPedantic -
2075 : */
2076 :
2077 366 : extern "C" void M2Options_SetPedantic (bool value)
2078 : {
2079 366 : M2Options_Pedantic = value;
2080 366 : }
2081 :
2082 :
2083 : /*
2084 : SetPedanticParamNames - sets the pedantic parameter name flag.
2085 : */
2086 :
2087 12 : extern "C" void M2Options_SetPedanticParamNames (bool value)
2088 : {
2089 12 : M2Options_PedanticParamNames = value;
2090 12 : }
2091 :
2092 :
2093 : /*
2094 : SetPedanticCast - sets the pedantic cast flag.
2095 : */
2096 :
2097 0 : extern "C" void M2Options_SetPedanticCast (bool value)
2098 : {
2099 0 : M2Options_PedanticCast = value;
2100 0 : }
2101 :
2102 :
2103 : /*
2104 : SetExtendedOpaque - sets the ExtendedOpaque flag.
2105 : */
2106 :
2107 328 : extern "C" void M2Options_SetExtendedOpaque (bool value)
2108 : {
2109 328 : M2Options_ExtendedOpaque = value;
2110 328 : }
2111 :
2112 :
2113 : /*
2114 : SetXCode - sets the xcode flag.
2115 : */
2116 :
2117 0 : extern "C" void M2Options_SetXCode (bool value)
2118 : {
2119 0 : M2Options_Xcode = value;
2120 0 : }
2121 :
2122 :
2123 : /*
2124 : SetCompilerDebugging - turn on internal compiler debugging.
2125 : Enabled via the command line option -fd.
2126 : */
2127 :
2128 0 : extern "C" void M2Options_SetCompilerDebugging (bool value)
2129 : {
2130 0 : M2Options_CompilerDebugging = value;
2131 0 : }
2132 :
2133 :
2134 : /*
2135 : SetQuadDebugging - display the quadruples (internal debugging).
2136 : */
2137 :
2138 0 : extern "C" void M2Options_SetQuadDebugging (bool value)
2139 : {
2140 0 : DumpQuad = value;
2141 0 : DumpQuadFilename = DynamicStrings_KillString (DumpQuadFilename);
2142 0 : DumpQuadFilename = DynamicStrings_InitString ((const char *) "-", 1);
2143 0 : }
2144 :
2145 :
2146 : /*
2147 : SetM2DebugTraceFilter - set internal debug flags. The flags should be
2148 : specified as a comma separated list. The full
2149 : list allowed is quad,line,token,all.
2150 : */
2151 :
2152 0 : extern "C" void M2Options_SetM2DebugTraceFilter (bool value, void * filter)
2153 : {
2154 0 : DynamicStrings_String word;
2155 0 : DynamicStrings_String full;
2156 0 : int start;
2157 0 : int i;
2158 :
2159 0 : full = DynamicStrings_InitStringCharStar (filter);
2160 0 : start = 0;
2161 0 : do {
2162 0 : i = DynamicStrings_Index (full, ',', static_cast<unsigned int> (start));
2163 0 : if (i == -1)
2164 : {
2165 0 : word = DynamicStrings_Slice (full, start, 0);
2166 : }
2167 : else
2168 : {
2169 0 : word = DynamicStrings_Slice (full, start, i);
2170 : }
2171 0 : SetM2DebugTrace (word, value);
2172 0 : word = DynamicStrings_KillString (word);
2173 0 : start = i+1;
2174 0 : } while (! (i == -1));
2175 0 : full = DynamicStrings_KillString (full);
2176 0 : }
2177 :
2178 :
2179 : /*
2180 : SetDebugFunctionLineNumbers - set DebugFunctionLineNumbers.
2181 : */
2182 :
2183 0 : extern "C" void M2Options_SetDebugFunctionLineNumbers (bool value)
2184 : {
2185 0 : DebugFunctionLineNumbers = value;
2186 0 : }
2187 :
2188 :
2189 : /*
2190 : SetGenerateStatementNote - turn on generation of nops if necessary
2191 : to generate pedalogical single stepping.
2192 : */
2193 :
2194 0 : extern "C" void M2Options_SetGenerateStatementNote (bool value)
2195 : {
2196 0 : M2Options_GenerateStatementNote = value;
2197 0 : }
2198 :
2199 :
2200 : /*
2201 : SetSources -
2202 : */
2203 :
2204 0 : extern "C" void M2Options_SetSources (bool value)
2205 : {
2206 0 : M2Options_Quiet = ! value;
2207 0 : SeenSources = value;
2208 0 : }
2209 :
2210 :
2211 : /*
2212 : SetDumpSystemExports -
2213 : */
2214 :
2215 29 : extern "C" void M2Options_SetDumpSystemExports (bool value)
2216 : {
2217 29 : M2Options_DumpSystemExports = value;
2218 29 : }
2219 :
2220 :
2221 : /*
2222 : SetDumpBuiltins - set the value of -fdump-builtins.
2223 : */
2224 :
2225 25 : extern "C" void M2Options_SetDumpBuiltins (bool value)
2226 : {
2227 25 : DumpBuiltinsFlag = value;
2228 25 : }
2229 :
2230 :
2231 : /*
2232 : GetDumpBuiltins - return the value of -fdump-builtins.
2233 : */
2234 :
2235 2432448 : extern "C" bool M2Options_GetDumpBuiltins (void)
2236 : {
2237 2432448 : return DumpBuiltinsFlag;
2238 : /* static analysis guarentees a RETURN statement will be used before here. */
2239 : __builtin_unreachable ();
2240 : }
2241 :
2242 :
2243 : /*
2244 : SetSwig -
2245 : */
2246 :
2247 0 : extern "C" void M2Options_SetSwig (bool value)
2248 : {
2249 0 : M2Options_GenerateSwig = value;
2250 0 : }
2251 :
2252 :
2253 : /*
2254 : SetOptimizing -
2255 : */
2256 :
2257 7841 : extern "C" void M2Options_SetOptimizing (unsigned int value)
2258 : {
2259 7841 : if (value > 0)
2260 : {
2261 : M2Options_Optimizing = true;
2262 : M2Options_OptimizeBasicBlock = true;
2263 : M2Options_OptimizeUncalledProcedures = true;
2264 : M2Options_OptimizeCommonSubExpressions = true;
2265 : M2Options_OptimizeSets = true;
2266 : }
2267 : else
2268 : {
2269 0 : M2Options_Optimizing = false;
2270 0 : M2Options_OptimizeBasicBlock = false;
2271 0 : M2Options_OptimizeUncalledProcedures = false;
2272 0 : M2Options_OptimizeCommonSubExpressions = false;
2273 0 : M2Options_OptimizeSets = false;
2274 : }
2275 7841 : }
2276 :
2277 :
2278 : /*
2279 : OverrideLocation - possibly override the location value, depending upon
2280 : whether the -flocation= option was used.
2281 : */
2282 :
2283 1012086196 : extern "C" location_t M2Options_OverrideLocation (location_t location)
2284 : {
2285 1012086196 : if (M2Options_ForcedLocation)
2286 : {
2287 0 : return ForcedLocationValue;
2288 : }
2289 : else
2290 : {
2291 : return location;
2292 : }
2293 : /* static analysis guarentees a RETURN statement will be used before here. */
2294 : __builtin_unreachable ();
2295 : }
2296 :
2297 :
2298 : /*
2299 : SetForcedLocation - sets the location for the lifetime of this compile to, location.
2300 : This is primarily an internal debugging switch.
2301 : */
2302 :
2303 0 : extern "C" void M2Options_SetForcedLocation (location_t location)
2304 : {
2305 0 : M2Options_ForcedLocation = true;
2306 0 : ForcedLocationValue = location;
2307 0 : }
2308 :
2309 :
2310 : /*
2311 : SetUnusedVariableChecking - assigns the UnusedVariableChecking to value.
2312 : */
2313 :
2314 354 : extern "C" void M2Options_SetUnusedVariableChecking (bool value)
2315 : {
2316 354 : M2Options_UnusedVariableChecking = value;
2317 354 : }
2318 :
2319 :
2320 : /*
2321 : SetUnusedParameterChecking - assigns the UnusedParameterChecking to value.
2322 : */
2323 :
2324 0 : extern "C" void M2Options_SetUnusedParameterChecking (bool value)
2325 : {
2326 0 : M2Options_UnusedParameterChecking = value;
2327 0 : }
2328 :
2329 :
2330 : /*
2331 : SetStrictTypeChecking - assigns the StrictTypeChecking flag to value.
2332 : */
2333 :
2334 0 : extern "C" void M2Options_SetStrictTypeChecking (bool value)
2335 : {
2336 0 : M2Options_StrictTypeChecking = value;
2337 0 : }
2338 :
2339 :
2340 : /*
2341 : SetStrictTypeAssignment - assigns the StrictTypeAssignment flag to value.
2342 : */
2343 :
2344 0 : extern "C" void M2Options_SetStrictTypeAssignment (bool value)
2345 : {
2346 0 : M2Options_StrictTypeAssignment = value;
2347 0 : }
2348 :
2349 :
2350 : /*
2351 : SetStrictTypeReason - assigns the StrictTypeReason flag to value.
2352 : */
2353 :
2354 0 : extern "C" void M2Options_SetStrictTypeReason (bool value)
2355 : {
2356 0 : M2Options_StrictTypeReason = value;
2357 0 : }
2358 :
2359 :
2360 : /*
2361 : setdefextension - set the source file definition module extension to arg.
2362 : This should include the . and by default it is set to .def.
2363 : */
2364 :
2365 6 : extern "C" void M2Options_setdefextension (void * arg)
2366 : {
2367 6 : DynamicStrings_String s;
2368 :
2369 6 : s = DynamicStrings_InitStringCharStar (arg);
2370 6 : M2Search_SetDefExtension (s);
2371 6 : s = DynamicStrings_KillString (s);
2372 6 : }
2373 :
2374 :
2375 : /*
2376 : setmodextension - set the source file module extension to arg.
2377 : This should include the . and by default it is set to .mod.
2378 : */
2379 :
2380 6 : extern "C" void M2Options_setmodextension (void * arg)
2381 : {
2382 6 : DynamicStrings_String s;
2383 :
2384 6 : s = DynamicStrings_InitStringCharStar (arg);
2385 6 : M2Search_SetModExtension (s);
2386 6 : s = DynamicStrings_KillString (s);
2387 6 : }
2388 :
2389 :
2390 : /*
2391 : SetStatistics - turn on/off generate of compile time statistics.
2392 : */
2393 :
2394 0 : extern "C" void M2Options_SetStatistics (bool on)
2395 : {
2396 0 : M2Options_Statistics = on;
2397 0 : }
2398 :
2399 :
2400 : /*
2401 : SetVerbose - set the Verbose flag to, value. It returns TRUE.
2402 : */
2403 :
2404 0 : extern "C" bool M2Options_SetVerbose (bool value)
2405 : {
2406 0 : M2Options_Verbose = value;
2407 0 : return true;
2408 : /* static analysis guarentees a RETURN statement will be used before here. */
2409 : __builtin_unreachable ();
2410 : }
2411 :
2412 :
2413 : /*
2414 : CppArg - sets the option and arg in the cpp command line.
2415 : */
2416 :
2417 9328 : extern "C" void M2Options_CppArg (void * opt, void * arg, bool joined)
2418 : {
2419 9328 : DynamicStrings_String s;
2420 :
2421 9328 : s = DynamicStrings_InitStringCharStar (opt);
2422 9328 : if ((DynamicStrings_EqualArray (s, (const char *) "-fcpp-begin", 11)) || (DynamicStrings_EqualArray (s, (const char *) "-fcpp-end", 9)))
2423 : {} /* empty. */
2424 : else
2425 : {
2426 : /* do nothing */
2427 9328 : if (! (DynamicStrings_EqualArray (CppArgs, (const char *) "", 0)))
2428 : {
2429 8800 : CppArgs = DynamicStrings_ConCatChar (CppArgs, ' ');
2430 : }
2431 9328 : CppArgs = DynamicStrings_ConCat (CppArgs, DynamicStrings_Mark (s));
2432 9328 : if (arg != NULL)
2433 : {
2434 3696 : s = DynamicStrings_InitStringCharStar (arg);
2435 3696 : if (! joined)
2436 : {
2437 1056 : CppArgs = DynamicStrings_ConCatChar (CppArgs, ' ');
2438 : }
2439 3696 : CppArgs = DynamicStrings_ConCat (CppArgs, s);
2440 : }
2441 : }
2442 9328 : }
2443 :
2444 :
2445 : /*
2446 : CppCommandLine - returns the Cpp command line and all arguments.
2447 : NIL is returned if the -fcpp is absent.
2448 : */
2449 :
2450 2868 : extern "C" DynamicStrings_String M2Options_CppCommandLine (void)
2451 : {
2452 2868 : DynamicStrings_String s;
2453 :
2454 2868 : if (M2Options_CPreProcessor)
2455 : {
2456 2868 : s = DynamicStrings_InitStringCharStar (m2configure_FullPathCPP ());
2457 2868 : s = DynamicStrings_ConCat (DynamicStrings_ConCatChar (s, ' '), CppArgs);
2458 2868 : if (CC1Quiet)
2459 : {
2460 2868 : s = DynamicStrings_ConCat (DynamicStrings_ConCatChar (s, ' '), DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "-quiet", 6)));
2461 : }
2462 : return s;
2463 : }
2464 : else
2465 : {
2466 : return static_cast<DynamicStrings_String> (NULL);
2467 : }
2468 : /* static analysis guarentees a RETURN statement will be used before here. */
2469 : __builtin_unreachable ();
2470 : }
2471 :
2472 :
2473 : /*
2474 : CppRemember - remember a string, s, as a cpp related argument.
2475 : The string, s, is not garbage collected.
2476 : */
2477 :
2478 0 : extern "C" void M2Options_CppRemember (DynamicStrings_String s)
2479 : {
2480 0 : if ((CppArgs == NULL) || (DynamicStrings_EqualArray (CppArgs, (const char *) "", 0)))
2481 : {
2482 0 : CppArgs = DynamicStrings_Dup (s);
2483 : }
2484 : else
2485 : {
2486 0 : CppArgs = DynamicStrings_ConCatChar (CppArgs, ' ');
2487 0 : CppArgs = DynamicStrings_ConCat (CppArgs, s);
2488 : }
2489 0 : }
2490 :
2491 :
2492 : /*
2493 : GetISO - return TRUE if -fiso was present on the command line.
2494 : */
2495 :
2496 2550 : extern "C" bool M2Options_GetISO (void)
2497 : {
2498 2550 : return M2Options_Iso;
2499 : /* static analysis guarentees a RETURN statement will be used before here. */
2500 : __builtin_unreachable ();
2501 : }
2502 :
2503 :
2504 : /*
2505 : GetPIM - return TRUE if -fpim was present on the command line.
2506 : */
2507 :
2508 389255 : extern "C" bool M2Options_GetPIM (void)
2509 : {
2510 389255 : return M2Options_Pim;
2511 : /* static analysis guarentees a RETURN statement will be used before here. */
2512 : __builtin_unreachable ();
2513 : }
2514 :
2515 :
2516 : /*
2517 : GetPIM2 - return TRUE if -fpim2 was present on the command line.
2518 : */
2519 :
2520 0 : extern "C" bool M2Options_GetPIM2 (void)
2521 : {
2522 0 : return M2Options_Pim2;
2523 : /* static analysis guarentees a RETURN statement will be used before here. */
2524 : __builtin_unreachable ();
2525 : }
2526 :
2527 :
2528 : /*
2529 : GetPIM3 - return TRUE if -fpim3 was present on the command line.
2530 : */
2531 :
2532 0 : extern "C" bool M2Options_GetPIM3 (void)
2533 : {
2534 0 : return M2Options_Pim3;
2535 : /* static analysis guarentees a RETURN statement will be used before here. */
2536 : __builtin_unreachable ();
2537 : }
2538 :
2539 :
2540 : /*
2541 : GetPIM4 - return TRUE if -fpim4 was present on the command line.
2542 : */
2543 :
2544 8318 : extern "C" bool M2Options_GetPIM4 (void)
2545 : {
2546 8318 : return M2Options_Pim4;
2547 : /* static analysis guarentees a RETURN statement will be used before here. */
2548 : __builtin_unreachable ();
2549 : }
2550 :
2551 :
2552 : /*
2553 : GetPositiveModFloor - return TRUE if -fpositive-mod-floor was present
2554 : on the command line.
2555 : */
2556 :
2557 136 : extern "C" bool M2Options_GetPositiveModFloor (void)
2558 : {
2559 136 : return M2Options_PositiveModFloorDiv;
2560 : /* static analysis guarentees a RETURN statement will be used before here. */
2561 : __builtin_unreachable ();
2562 : }
2563 :
2564 :
2565 : /*
2566 : GetFloatValueCheck - return TRUE if -ffloatvalue was present on the
2567 : command line.
2568 : */
2569 :
2570 1766 : extern "C" bool M2Options_GetFloatValueCheck (void)
2571 : {
2572 1766 : return M2Options_FloatValueChecking;
2573 : /* static analysis guarentees a RETURN statement will be used before here. */
2574 : __builtin_unreachable ();
2575 : }
2576 :
2577 :
2578 : /*
2579 : SetFloatValueCheck - set depending upon the -ffloatvalue.
2580 : */
2581 :
2582 0 : extern "C" void M2Options_SetFloatValueCheck (bool value)
2583 : {
2584 0 : M2Options_FloatValueChecking = value;
2585 0 : }
2586 :
2587 :
2588 : /*
2589 : GetWholeValueCheck - return TRUE if -fwholevalue was present on the
2590 : command line.
2591 : */
2592 :
2593 53794 : extern "C" bool M2Options_GetWholeValueCheck (void)
2594 : {
2595 53794 : return M2Options_WholeValueChecking;
2596 : /* static analysis guarentees a RETURN statement will be used before here. */
2597 : __builtin_unreachable ();
2598 : }
2599 :
2600 :
2601 : /*
2602 : SetWholeValueCheck - set depending upon the -fwholevalue.
2603 : */
2604 :
2605 0 : extern "C" void M2Options_SetWholeValueCheck (bool value)
2606 : {
2607 0 : M2Options_WholeValueChecking = value;
2608 0 : }
2609 :
2610 :
2611 : /*
2612 : SetWall - set all warnings to, value.
2613 : */
2614 :
2615 612 : extern "C" void M2Options_SetWall (bool value)
2616 : {
2617 612 : M2Options_UnusedVariableChecking = value;
2618 612 : M2Options_UnusedParameterChecking = value;
2619 612 : M2Options_UninitVariableChecking = value;
2620 612 : M2Options_PedanticCast = value;
2621 612 : M2Options_PedanticParamNames = value;
2622 612 : M2Options_StyleChecking = value;
2623 612 : M2Options_CaseEnumChecking = value;
2624 612 : }
2625 :
2626 :
2627 : /*
2628 : SetSaveTemps - turn on/off -save-temps.
2629 : */
2630 :
2631 0 : extern "C" void M2Options_SetSaveTemps (bool value)
2632 : {
2633 0 : M2Options_SaveTemps = value;
2634 0 : }
2635 :
2636 :
2637 : /*
2638 : SetSaveTempsDir - turn on/off -save-temps and specify the directory.
2639 : */
2640 :
2641 0 : extern "C" void M2Options_SetSaveTempsDir (void * arg)
2642 : {
2643 0 : SaveTempsDir = DynamicStrings_InitStringCharStar (arg);
2644 0 : M2Options_SaveTemps = true;
2645 0 : }
2646 :
2647 :
2648 : /*
2649 : GetSaveTempsDir - return SaveTempsDir or NIL if -save-temps was not used.
2650 : */
2651 :
2652 261027 : extern "C" DynamicStrings_String M2Options_GetSaveTempsDir (void)
2653 : {
2654 261027 : return SaveTempsDir;
2655 : /* static analysis guarentees a RETURN statement will be used before here. */
2656 : __builtin_unreachable ();
2657 : }
2658 :
2659 :
2660 : /*
2661 : SetDumpDir - Set the dump dir.
2662 : */
2663 :
2664 12843 : extern "C" void M2Options_SetDumpDir (void * arg)
2665 : {
2666 12843 : DumpDir = DynamicStrings_InitStringCharStar (arg);
2667 12843 : }
2668 :
2669 :
2670 : /*
2671 : GetDumpDir - return DumpDir or NIL.
2672 : */
2673 :
2674 261027 : extern "C" DynamicStrings_String M2Options_GetDumpDir (void)
2675 : {
2676 261027 : return DumpDir;
2677 : /* static analysis guarentees a RETURN statement will be used before here. */
2678 : __builtin_unreachable ();
2679 : }
2680 :
2681 :
2682 : /*
2683 : SetGenModuleList - set the GenModuleList flag to true and pass
2684 : set GenModuleListFilename to filename.
2685 : */
2686 :
2687 2750 : extern "C" void M2Options_SetGenModuleList (bool value, void * filename)
2688 : {
2689 2750 : GenModuleListFilename = DynamicStrings_KillString (GenModuleListFilename);
2690 2750 : if (filename != NULL)
2691 : {
2692 2750 : GenModuleListFilename = DynamicStrings_InitStringCharStar (filename);
2693 : }
2694 2750 : M2Options_GenModuleList = value;
2695 2750 : }
2696 :
2697 :
2698 : /*
2699 : GetGenModuleFilename - returns the filename set by SetGenModuleList.
2700 : */
2701 :
2702 5488 : extern "C" DynamicStrings_String M2Options_GetGenModuleFilename (void)
2703 : {
2704 5488 : return GenModuleListFilename;
2705 : /* static analysis guarentees a RETURN statement will be used before here. */
2706 : __builtin_unreachable ();
2707 : }
2708 :
2709 :
2710 : /*
2711 : SetShared - sets the SharedFlag to value.
2712 : */
2713 :
2714 0 : extern "C" void M2Options_SetShared (bool value)
2715 : {
2716 0 : M2Options_SharedFlag = value;
2717 0 : }
2718 :
2719 :
2720 : /*
2721 : SetUninitVariableChecking - sets the UninitVariableChecking and
2722 : UninitVariableConditionalChecking flags to value
2723 : depending upon arg string. The arg string
2724 : can be: "all", "known,cond", "cond,known", "known"
2725 : or "cond".
2726 : */
2727 :
2728 625 : extern "C" int M2Options_SetUninitVariableChecking (bool value, void * arg)
2729 : {
2730 625 : DynamicStrings_String s;
2731 :
2732 625 : if (Debugging)
2733 : {
2734 : /* avoid gcc warning by using compound statement even if not strictly necessary. */
2735 : if (value)
2736 : {
2737 : libc_printf ((const char *) "SetUninitVariableChecking (TRUE, %s)\\n", 38, arg);
2738 : }
2739 : else
2740 : {
2741 : libc_printf ((const char *) "SetUninitVariableChecking (FALSE, %s)\\n", 39, arg);
2742 : }
2743 : }
2744 625 : s = DynamicStrings_InitStringCharStar (arg);
2745 625 : if (((DynamicStrings_EqualArray (s, (const char *) "all", 3)) || (DynamicStrings_EqualArray (s, (const char *) "known,cond", 10))) || (DynamicStrings_EqualArray (s, (const char *) "cond,known", 10)))
2746 : {
2747 427 : M2Options_UninitVariableChecking = value;
2748 427 : M2Options_UninitVariableConditionalChecking = value;
2749 427 : s = DynamicStrings_KillString (s);
2750 427 : return 1;
2751 : }
2752 198 : else if (DynamicStrings_EqualArray (s, (const char *) "known", 5))
2753 : {
2754 : /* avoid dangling else. */
2755 198 : M2Options_UninitVariableChecking = value;
2756 198 : s = DynamicStrings_KillString (s);
2757 198 : return 1;
2758 : }
2759 0 : else if (DynamicStrings_EqualArray (s, (const char *) "cond", 4))
2760 : {
2761 : /* avoid dangling else. */
2762 0 : M2Options_UninitVariableConditionalChecking = value;
2763 0 : s = DynamicStrings_KillString (s);
2764 0 : return 1;
2765 : }
2766 : else
2767 : {
2768 : /* avoid dangling else. */
2769 0 : s = DynamicStrings_KillString (s);
2770 0 : return 0;
2771 : }
2772 : /* static analysis guarentees a RETURN statement will be used before here. */
2773 : __builtin_unreachable ();
2774 : }
2775 :
2776 :
2777 : /*
2778 : SetCaseEnumChecking - sets the CaseEnumChecking to value.
2779 : */
2780 :
2781 700 : extern "C" void M2Options_SetCaseEnumChecking (bool value)
2782 : {
2783 700 : M2Options_CaseEnumChecking = value;
2784 700 : }
2785 :
2786 :
2787 : /*
2788 : SetDebugBuiltins - sets the DebugBuiltins to value.
2789 : */
2790 :
2791 0 : extern "C" void M2Options_SetDebugBuiltins (bool value)
2792 : {
2793 0 : M2Options_DebugBuiltins = value;
2794 0 : }
2795 :
2796 :
2797 : /*
2798 : SetIBMLongDouble - enable/disable LONGREAL to map onto the
2799 : IBM long double 128 bit data type.
2800 : (Only available on the ppc).
2801 : */
2802 :
2803 0 : extern "C" void M2Options_SetIBMLongDouble (bool value)
2804 : {
2805 0 : IBMLongDouble = value;
2806 0 : if (value)
2807 : {
2808 0 : IEEELongDouble = false;
2809 : }
2810 0 : }
2811 :
2812 :
2813 : /*
2814 : GetIBMLongDouble - return the value of IBMLongDouble.
2815 : */
2816 :
2817 0 : extern "C" bool M2Options_GetIBMLongDouble (void)
2818 : {
2819 0 : return IBMLongDouble;
2820 : /* static analysis guarentees a RETURN statement will be used before here. */
2821 : __builtin_unreachable ();
2822 : }
2823 :
2824 :
2825 : /*
2826 : SetIEEELongDouble - enable/disable LONGREAL to map onto the
2827 : IEEE long double 128 bit data type.
2828 : (Only available on the ppc).
2829 : */
2830 :
2831 0 : extern "C" void M2Options_SetIEEELongDouble (bool value)
2832 : {
2833 0 : IEEELongDouble = value;
2834 0 : if (value)
2835 : {
2836 0 : IBMLongDouble = false;
2837 : }
2838 0 : }
2839 :
2840 :
2841 : /*
2842 : GetIEEELongDouble - return the value of IEEELongDouble.
2843 : */
2844 :
2845 16892 : extern "C" bool M2Options_GetIEEELongDouble (void)
2846 : {
2847 16892 : return IEEELongDouble;
2848 : /* static analysis guarentees a RETURN statement will be used before here. */
2849 : __builtin_unreachable ();
2850 : }
2851 :
2852 :
2853 : /*
2854 : GetDumpDeclFilename - returns the DumpDeclFilename.
2855 : */
2856 :
2857 0 : extern "C" DynamicStrings_String M2Options_GetDumpDeclFilename (void)
2858 : {
2859 0 : return DumpDeclFilename;
2860 : /* static analysis guarentees a RETURN statement will be used before here. */
2861 : __builtin_unreachable ();
2862 : }
2863 :
2864 :
2865 : /*
2866 : SetDumpDeclFilename -
2867 : */
2868 :
2869 0 : extern "C" void M2Options_SetDumpDeclFilename (bool value, void * filename)
2870 : {
2871 0 : DumpDecl = value;
2872 0 : DumpDeclFilename = DynamicStrings_KillString (DumpDeclFilename);
2873 0 : if (filename != NULL)
2874 : {
2875 0 : DumpDeclFilename = DynamicStrings_InitStringCharStar (filename);
2876 : }
2877 0 : }
2878 :
2879 :
2880 : /*
2881 : GetDumpQuadFilename - returns the DumpQuadFilename.
2882 : */
2883 :
2884 0 : extern "C" DynamicStrings_String M2Options_GetDumpQuadFilename (void)
2885 : {
2886 0 : return DumpQuadFilename;
2887 : /* static analysis guarentees a RETURN statement will be used before here. */
2888 : __builtin_unreachable ();
2889 : }
2890 :
2891 :
2892 : /*
2893 : SetDumpQuadFilename -
2894 : */
2895 :
2896 0 : extern "C" void M2Options_SetDumpQuadFilename (bool value, void * filename)
2897 : {
2898 0 : DumpQuad = value;
2899 0 : DumpQuadFilename = DynamicStrings_KillString (DumpQuadFilename);
2900 0 : if (filename != NULL)
2901 : {
2902 0 : DumpQuadFilename = DynamicStrings_InitStringCharStar (filename);
2903 : }
2904 0 : }
2905 :
2906 :
2907 : /*
2908 : GetDumpGimpleFilename - returns the DumpGimpleFilename.
2909 : */
2910 :
2911 0 : extern "C" DynamicStrings_String M2Options_GetDumpGimpleFilename (void)
2912 : {
2913 0 : return DumpGimpleFilename;
2914 : /* static analysis guarentees a RETURN statement will be used before here. */
2915 : __builtin_unreachable ();
2916 : }
2917 :
2918 :
2919 : /*
2920 : SetDumpGimpleFilename - set DumpGimpleFilename to filename.
2921 : */
2922 :
2923 0 : extern "C" void M2Options_SetDumpGimpleFilename (bool value, void * filename)
2924 : {
2925 0 : DumpGimple = value;
2926 0 : DumpGimpleFilename = DynamicStrings_KillString (DumpGimpleFilename);
2927 0 : if (value && (filename != NULL))
2928 : {
2929 0 : DumpGimpleFilename = DynamicStrings_InitStringCharStar (filename);
2930 : }
2931 0 : }
2932 :
2933 :
2934 : /*
2935 : SetM2DumpFilter - sets the filter to a comma separated list of procedures
2936 : and modules. Not to be confused with SetM2Dump below
2937 : which enables the class of data structures to be dumped.
2938 : */
2939 :
2940 0 : extern "C" void M2Options_SetM2DumpFilter (bool value, void * filter)
2941 : {
2942 0 : M2DumpFilter = DynamicStrings_KillString (M2DumpFilter);
2943 0 : if (value && (filter != NULL))
2944 : {
2945 0 : M2DumpFilter = DynamicStrings_InitStringCharStar (filter);
2946 : }
2947 0 : }
2948 :
2949 :
2950 : /*
2951 : GetM2DumpFilter - returns the dump filter.
2952 : */
2953 :
2954 0 : extern "C" void * M2Options_GetM2DumpFilter (void)
2955 : {
2956 0 : if (M2DumpFilter == NULL)
2957 : {
2958 : return NULL;
2959 : }
2960 : else
2961 : {
2962 0 : return DynamicStrings_string (M2DumpFilter);
2963 : }
2964 : /* static analysis guarentees a RETURN statement will be used before here. */
2965 : __builtin_unreachable ();
2966 : }
2967 :
2968 :
2969 : /*
2970 : SetM2Dump - sets the dump via a comma separated list: quad,decl,gimple,all.
2971 : It returns TRUE if the comma separated list is valid.
2972 : */
2973 :
2974 0 : extern "C" bool M2Options_SetM2Dump (bool value, void * filter)
2975 : {
2976 0 : bool result;
2977 0 : DynamicStrings_String dump;
2978 0 : int start;
2979 0 : int i;
2980 :
2981 0 : if (filter == NULL)
2982 : {
2983 : return false;
2984 : }
2985 0 : if (M2Dump != NULL)
2986 : {
2987 0 : M2Dump = DynamicStrings_KillString (M2Dump);
2988 : }
2989 0 : M2Dump = DynamicStrings_InitStringCharStar (filter);
2990 0 : start = 0;
2991 0 : do {
2992 0 : i = DynamicStrings_Index (M2Dump, ',', static_cast<unsigned int> (start));
2993 0 : if (i == -1)
2994 : {
2995 0 : dump = DynamicStrings_Slice (M2Dump, start, 0);
2996 : }
2997 : else
2998 : {
2999 0 : dump = DynamicStrings_Slice (M2Dump, start, i);
3000 : }
3001 0 : result = MatchDump (dump, value);
3002 0 : dump = DynamicStrings_KillString (dump);
3003 0 : if (! result)
3004 : {
3005 : return false;
3006 : }
3007 0 : start = i+1;
3008 0 : } while (! (i == -1));
3009 : return true;
3010 : /* static analysis guarentees a RETURN statement will be used before here. */
3011 : __builtin_unreachable ();
3012 : }
3013 :
3014 :
3015 : /*
3016 : GetDumpGimple - return TRUE if the dump gimple flag is set from SetM2Dump.
3017 : */
3018 :
3019 253404 : extern "C" bool M2Options_GetDumpGimple (void)
3020 : {
3021 253404 : return DumpGimple;
3022 : /* static analysis guarentees a RETURN statement will be used before here. */
3023 : __builtin_unreachable ();
3024 : }
3025 :
3026 :
3027 : /*
3028 : GetDumpQuad - return TRUE if the dump quad flag is set from SetM2Dump.
3029 : */
3030 :
3031 79102 : extern "C" bool M2Options_GetDumpQuad (void)
3032 : {
3033 79102 : return DumpQuad;
3034 : /* static analysis guarentees a RETURN statement will be used before here. */
3035 : __builtin_unreachable ();
3036 : }
3037 :
3038 :
3039 : /*
3040 : GetDumpDecl - return TRUE if the dump decl flag is set from SetM2Dump.
3041 : */
3042 :
3043 31696 : extern "C" bool M2Options_GetDumpDecl (void)
3044 : {
3045 31696 : return DumpDecl;
3046 : /* static analysis guarentees a RETURN statement will be used before here. */
3047 : __builtin_unreachable ();
3048 : }
3049 :
3050 :
3051 : /*
3052 : GetDebugTraceQuad - return DebugTraceQuad.
3053 : */
3054 :
3055 186188950 : extern "C" bool M2Options_GetDebugTraceQuad (void)
3056 : {
3057 186188950 : return DebugTraceQuad;
3058 : /* static analysis guarentees a RETURN statement will be used before here. */
3059 : __builtin_unreachable ();
3060 : }
3061 :
3062 :
3063 : /*
3064 : GetDebugTraceTree - return DebugTraceTree.
3065 : */
3066 :
3067 0 : extern "C" bool M2Options_GetDebugTraceTree (void)
3068 : {
3069 0 : return DebugTraceTree;
3070 : /* static analysis guarentees a RETURN statement will be used before here. */
3071 : __builtin_unreachable ();
3072 : }
3073 :
3074 :
3075 : /*
3076 : GetDebugTraceToken - return DebugTraceToken.
3077 : */
3078 :
3079 994620027 : extern "C" bool M2Options_GetDebugTraceToken (void)
3080 : {
3081 994620027 : return DebugTraceToken;
3082 : /* static analysis guarentees a RETURN statement will be used before here. */
3083 : __builtin_unreachable ();
3084 : }
3085 :
3086 :
3087 : /*
3088 : GetDebugTraceLine - return DebugTraceLine.
3089 : */
3090 :
3091 68928380 : extern "C" bool M2Options_GetDebugTraceLine (void)
3092 : {
3093 68928380 : return DebugTraceLine;
3094 : /* static analysis guarentees a RETURN statement will be used before here. */
3095 : __builtin_unreachable ();
3096 : }
3097 :
3098 :
3099 : /*
3100 : GetDebugFunctionLineNumbers - return DebugFunctionLineNumbers.
3101 : */
3102 :
3103 15590 : extern "C" bool M2Options_GetDebugFunctionLineNumbers (void)
3104 : {
3105 15590 : return DebugFunctionLineNumbers;
3106 : /* static analysis guarentees a RETURN statement will be used before here. */
3107 : __builtin_unreachable ();
3108 : }
3109 :
3110 :
3111 : /*
3112 : GetEnableForward - return EnableForward.
3113 : */
3114 :
3115 60 : extern "C" bool M2Options_GetEnableForward (void)
3116 : {
3117 60 : return EnableForward;
3118 : /* static analysis guarentees a RETURN statement will be used before here. */
3119 : __builtin_unreachable ();
3120 : }
3121 :
3122 :
3123 : /*
3124 : SetEnableForward - set EnableForward to value.
3125 : */
3126 :
3127 0 : extern "C" void M2Options_SetEnableForward (bool value)
3128 : {
3129 0 : EnableForward = value;
3130 0 : }
3131 :
3132 :
3133 : /*
3134 : SetFileOffsetBits - create SYSTEM.COFF_T as a signed integer of size bits.
3135 : */
3136 :
3137 0 : extern "C" bool M2Options_SetFileOffsetBits (bool value, unsigned int bits)
3138 : {
3139 0 : if (value)
3140 : {
3141 0 : OffTBits = bits;
3142 : }
3143 0 : return true;
3144 : /* static analysis guarentees a RETURN statement will be used before here. */
3145 : __builtin_unreachable ();
3146 : }
3147 :
3148 :
3149 : /*
3150 : GetFileOffsetBits - return the number of bits used to create SYSTEM.COFF_T.
3151 : */
3152 :
3153 16892 : extern "C" unsigned int M2Options_GetFileOffsetBits (void)
3154 : {
3155 16892 : return OffTBits;
3156 : /* static analysis guarentees a RETURN statement will be used before here. */
3157 : __builtin_unreachable ();
3158 : }
3159 :
3160 :
3161 : /*
3162 : SetMemReport - set MemReport to value.
3163 : */
3164 :
3165 0 : extern "C" void M2Options_SetMemReport (bool value)
3166 : {
3167 0 : M2Options_MemReport = value;
3168 0 : }
3169 :
3170 :
3171 : /*
3172 : SetTimeReport - set TimeReport to value.
3173 : */
3174 :
3175 0 : extern "C" void M2Options_SetTimeReport (bool value)
3176 : {
3177 0 : M2Options_TimeReport = value;
3178 0 : }
3179 :
3180 :
3181 : /*
3182 : SetWideset - set the Wideset flag to value.
3183 : */
3184 :
3185 6 : extern "C" void M2Options_SetWideset (bool value)
3186 : {
3187 6 : WidesetFlag = value;
3188 6 : }
3189 :
3190 :
3191 : /*
3192 : GetWideset - return the Wideset flag value.
3193 : */
3194 :
3195 19086 : extern "C" bool M2Options_GetWideset (void)
3196 : {
3197 19086 : return WidesetFlag;
3198 : /* static analysis guarentees a RETURN statement will be used before here. */
3199 : __builtin_unreachable ();
3200 : }
3201 :
3202 :
3203 : /*
3204 : FinaliseOptions - once all options have been parsed we set any inferred
3205 : values.
3206 : */
3207 :
3208 16892 : extern "C" void M2Options_FinaliseOptions (void)
3209 : {
3210 : /* currently only one value, this could be make an option in the future */
3211 16892 : M2Options_VariantValueChecking = M2Options_Iso;
3212 16892 : }
3213 :
3214 16892 : extern "C" void _M2_M2Options_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
3215 : {
3216 16892 : M2Options_cflag = false; /* -c. */
3217 16892 : RuntimeModuleOverride = DynamicStrings_InitString ((const char *) "m2iso:RTentity,m2iso:Storage,m2iso:SYSTEM,m2iso:M2RTS,m2iso:RTExceptions,m2iso:IOLink", 85); /* -c. */
3218 16892 : CppArgs = DynamicStrings_InitString ((const char *) "", 0);
3219 16892 : M2Options_Pim = true;
3220 16892 : M2Options_Pim2 = false;
3221 16892 : M2Options_Pim3 = false;
3222 16892 : M2Options_Pim4 = true;
3223 16892 : M2Options_PositiveModFloorDiv = false;
3224 16892 : M2Options_Iso = false;
3225 16892 : SeenSources = false;
3226 16892 : M2Options_Statistics = false;
3227 16892 : M2Options_StyleChecking = false;
3228 16892 : M2Options_CompilerDebugging = false;
3229 16892 : M2Options_GenerateDebugging = false;
3230 16892 : M2Options_Optimizing = false;
3231 16892 : M2Options_Pedantic = false;
3232 16892 : M2Options_Verbose = false;
3233 16892 : M2Options_Quiet = true;
3234 16892 : CC1Quiet = true;
3235 16892 : M2Options_Profiling = false;
3236 16892 : DumpQuad = false;
3237 16892 : M2Options_OptimizeBasicBlock = false;
3238 16892 : M2Options_OptimizeUncalledProcedures = false;
3239 16892 : M2Options_OptimizeCommonSubExpressions = false;
3240 16892 : M2Options_OptimizeSets = false;
3241 16892 : M2Options_NilChecking = false;
3242 16892 : M2Options_WholeDivChecking = false;
3243 16892 : M2Options_WholeValueChecking = false;
3244 16892 : M2Options_FloatValueChecking = false;
3245 16892 : M2Options_IndexChecking = false;
3246 16892 : M2Options_RangeChecking = false;
3247 16892 : M2Options_ReturnChecking = false;
3248 16892 : M2Options_CaseElseChecking = false;
3249 16892 : M2Options_CPreProcessor = false;
3250 16892 : M2Options_LineDirectives = true;
3251 16892 : M2Options_ExtendedOpaque = false;
3252 16892 : M2Options_UnboundedByReference = false;
3253 16892 : M2Options_VerboseUnbounded = false;
3254 16892 : M2Options_PedanticParamNames = false;
3255 16892 : M2Options_PedanticCast = false;
3256 16892 : M2Options_Xcode = false;
3257 16892 : M2Options_DumpSystemExports = false;
3258 16892 : M2Options_GenerateSwig = false;
3259 16892 : M2Options_Exceptions = true;
3260 16892 : M2Options_DebugBuiltins = false;
3261 16892 : M2Options_ForcedLocation = false;
3262 16892 : M2Options_WholeProgram = false;
3263 16892 : DebugTraceQuad = false;
3264 16892 : DebugTraceTree = false;
3265 16892 : DebugTraceLine = false;
3266 16892 : DebugTraceToken = false;
3267 16892 : DebugFunctionLineNumbers = false;
3268 16892 : M2Options_GenerateStatementNote = false;
3269 16892 : M2Options_LowerCaseKeywords = false;
3270 16892 : M2Options_UnusedVariableChecking = false;
3271 16892 : M2Options_UnusedParameterChecking = false;
3272 16892 : M2Options_StrictTypeChecking = true;
3273 16892 : M2Options_StrictTypeAssignment = true;
3274 16892 : M2Options_StrictTypeReason = true;
3275 16892 : M2Options_AutoInit = false;
3276 16892 : M2Options_SaveTemps = false;
3277 16892 : M2Options_ScaffoldDynamic = true;
3278 16892 : M2Options_ScaffoldStatic = false;
3279 16892 : M2Options_ScaffoldMain = false;
3280 16892 : UselistFilename = static_cast<DynamicStrings_String> (NULL);
3281 16892 : M2Options_GenModuleList = false;
3282 16892 : GenModuleListFilename = static_cast<DynamicStrings_String> (NULL);
3283 16892 : M2Options_SharedFlag = false;
3284 16892 : Barg = static_cast<DynamicStrings_String> (NULL);
3285 16892 : MDFlag = false;
3286 16892 : MMDFlag = false;
3287 16892 : DepTarget = static_cast<DynamicStrings_String> (NULL);
3288 16892 : MPFlag = false;
3289 16892 : SaveTempsDir = static_cast<DynamicStrings_String> (NULL);
3290 16892 : DumpDir = static_cast<DynamicStrings_String> (NULL);
3291 16892 : M2Options_UninitVariableChecking = false;
3292 16892 : M2Options_UninitVariableConditionalChecking = false;
3293 16892 : M2Options_CaseEnumChecking = false;
3294 16892 : MFlag = false;
3295 16892 : MMFlag = false;
3296 16892 : MFarg = static_cast<DynamicStrings_String> (NULL);
3297 16892 : MTFlag = static_cast<DynamicStrings_String> (NULL);
3298 16892 : MQFlag = static_cast<DynamicStrings_String> (NULL);
3299 16892 : InitializeLongDoubleFlags ();
3300 16892 : M2Prefix = DynamicStrings_InitString ((const char *) "", 0);
3301 16892 : M2PathName = DynamicStrings_InitString ((const char *) "", 0);
3302 16892 : DumpQuadFilename = static_cast<DynamicStrings_String> (NULL);
3303 16892 : DumpGimpleFilename = static_cast<DynamicStrings_String> (NULL);
3304 16892 : DumpDeclFilename = static_cast<DynamicStrings_String> (NULL);
3305 16892 : DumpDecl = false;
3306 16892 : DumpQuad = false;
3307 16892 : DumpGimple = false;
3308 16892 : M2Dump = static_cast<DynamicStrings_String> (NULL);
3309 16892 : M2DumpFilter = static_cast<DynamicStrings_String> (NULL);
3310 16892 : M2Options_TimeReport = false;
3311 16892 : M2Options_MemReport = false;
3312 16892 : EnableForward = true;
3313 16892 : OffTBits = 0; /* Default to CSSIZE_T. */
3314 16892 : WidesetFlag = true; /* Default to CSSIZE_T. */
3315 16892 : DumpBuiltinsFlag = false;
3316 16892 : }
3317 :
3318 0 : extern "C" void _M2_M2Options_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
3319 : {
3320 0 : }
|