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