loop-iv, riscv: Fix get_biv_step_1 for RISC-V [PR117506]
[official-gcc.git] / gcc / m2 / gm2-compiler / M2Options.mod
blob39f0b2a73fb2ef3c74e4ad6fd103141c27fb2ee7
1 (* M2Options.mod initializes the user options.
3 Copyright (C) 2001-2025 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 This file is part of GNU Modula-2.
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU Modula-2; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. *)
22 IMPLEMENTATION MODULE M2Options ;
25 IMPORT CmdArgs ;
26 FROM SArgs IMPORT GetArg, Narg ;
27 FROM M2Search IMPORT SetDefExtension, SetModExtension ;
28 FROM PathName IMPORT DumpPathName, AddInclude ;
29 FROM M2Printf IMPORT printf0, printf1, fprintf1 ;
30 FROM FIO IMPORT StdErr ;
31 FROM libc IMPORT exit, printf ;
32 FROM Debug IMPORT Halt ;
33 FROM gcctypes IMPORT location_t ;
34 FROM m2configure IMPORT FullPathCPP, TargetIEEEQuadDefault ;
35 FROM M2Error IMPORT InternalError ;
36 FROM FormatStrings IMPORT Sprintf1 ;
37 FROM m2misc IMPORT cerror ;
39 FROM DynamicStrings IMPORT String, Length, InitString, Mark, Slice, EqualArray,
40 InitStringCharStar, ConCatChar, ConCat, KillString,
41 Dup, string, char, Index,
42 PushAllocation, PopAllocationExemption,
43 InitStringDB, InitStringCharStarDB,
44 InitStringCharDB, MultDB, DupDB, SliceDB ;
47 #define InitString(X) InitStringDB(X, __FILE__, __LINE__)
48 #define InitStringCharStar(X) InitStringCharStarDB(X, __FILE__, __LINE__)
49 #define InitStringChar(X) InitStringCharDB(X, __FILE__, __LINE__)
50 #define Mult(X,Y) MultDB(X, Y, __FILE__, __LINE__)
51 #define Dup(X) DupDB(X, __FILE__, __LINE__)
52 #define Slice(X,Y,Z) SliceDB(X, Y, Z, __FILE__, __LINE__)
55 CONST
56 Debugging = FALSE ;
57 DefaultRuntimeModuleOverride = "m2iso:RTentity,m2iso:Storage,m2iso:SYSTEM,m2iso:M2RTS,m2iso:RTExceptions,m2iso:IOLink" ;
59 VAR
60 DumpDeclFilename,
61 DumpQuadFilename,
62 DumpGimpleFilename,
63 M2Dump,
64 M2DumpFilter,
65 M2Prefix,
66 M2PathName,
67 Barg,
68 MFarg,
69 MTFlag,
70 MQFlag,
71 DepTarget,
72 CmdLineObj,
73 SaveTempsDir,
74 DumpDir,
75 GenModuleListFilename,
76 UselistFilename,
77 RuntimeModuleOverride,
78 CppArgs : String ;
79 EnableForward,
80 DebugFunctionLineNumbers,
81 DebugTraceQuad, (* -fm2-debug-trace=quad. *)
82 DebugTraceLine, (* -fm2-debug-trace=line. *)
83 DebugTraceToken, (* -fm2-debug-trace=token. *)
84 DebugTraceTree, (* -fm2-debug-trace=tree. (not yet implemented). *)
85 DumpDecl, (* -fm2-dump=decl. *)
86 DumpGimple, (* -fm2-dump=gimple. *)
87 DumpQuad, (* -fq, -fm2-dump=quad dump quadruples. *)
88 MFlag,
89 MMFlag,
90 MPFlag,
91 MDFlag,
92 MMDFlag,
93 IBMLongDouble,
94 IEEELongDouble,
95 UselistFlag,
96 CC1Quiet,
97 SeenSources : BOOLEAN ;
98 OffTBits : CARDINAL ;
99 ForcedLocationValue : location_t ;
102 (* String garbage collection debugging routines.
105 doDSdbEnter -
108 PROCEDURE doDSdbEnter ;
109 BEGIN
110 PushAllocation
111 END doDSdbEnter ;
115 doDSdbExit -
118 PROCEDURE doDSdbExit (s: String) ;
119 BEGIN
120 s := PopAllocationExemption (TRUE, s)
121 END doDSdbExit ;
125 DSdbEnter -
128 PROCEDURE DSdbEnter ;
129 BEGIN
130 END DSdbEnter ;
134 DSdbExit -
137 PROCEDURE DSdbExit (s: String) ;
138 BEGIN
139 END DSdbExit ;
143 #define DSdbEnter doDSdbEnter
144 #define DSdbExit doDSdbExit
149 SetM2Prefix - assign arg to M2Prefix.
152 PROCEDURE SetM2Prefix (arg: ADDRESS) ;
153 BEGIN
154 M2Prefix := KillString (M2Prefix) ;
155 M2Prefix := InitStringCharStar (arg)
156 END SetM2Prefix ;
160 GetM2Prefix - return M2Prefix as a C string.
163 PROCEDURE GetM2Prefix () : ADDRESS ;
164 BEGIN
165 RETURN string (M2Prefix)
166 END GetM2Prefix ;
170 SetM2PathName - assign arg to M2PathName.
173 PROCEDURE SetM2PathName (arg: ADDRESS) ;
174 BEGIN
175 M2PathName := KillString (M2PathName) ;
176 M2PathName := InitStringCharStar (arg) ;
177 (* fprintf1 (StdErr, "M2PathName = %s\n", M2PathName) *)
178 END SetM2PathName ;
182 GetM2PathName - return M2PathName as a C string.
185 PROCEDURE GetM2PathName () : ADDRESS ;
186 BEGIN
187 RETURN string (M2PathName)
188 END GetM2PathName ;
192 SetB - assigns Barg to arg.
195 PROCEDURE SetB (arg: ADDRESS) ;
196 BEGIN
197 Barg := KillString (Barg) ;
198 Barg := InitStringCharStar (arg)
199 END SetB ;
203 GetB - returns Barg value as a C string or NIL if it was never set.
206 PROCEDURE GetB () : ADDRESS ;
207 BEGIN
208 RETURN string (Barg)
209 END GetB ;
213 SetM - set the MFlag.
216 PROCEDURE SetM (value: BOOLEAN) ;
217 BEGIN
218 MFlag := value
219 END SetM ;
223 GetM - set the MFlag.
226 PROCEDURE GetM () : BOOLEAN ;
227 BEGIN
228 RETURN MFlag
229 END GetM ;
233 SetMM - set the MMFlag.
236 PROCEDURE SetMM (value: BOOLEAN) ;
237 BEGIN
238 MMFlag := value
239 END SetMM ;
243 GetMM - set the MMFlag.
246 PROCEDURE GetMM () : BOOLEAN ;
247 BEGIN
248 RETURN MMFlag
249 END GetMM ;
253 SetMD - set the MDFlag to value.
256 PROCEDURE SetMD (value: BOOLEAN) ;
257 BEGIN
258 MDFlag := value
259 END SetMD ;
263 GetMD - return the MDFlag.
266 PROCEDURE GetMD () : BOOLEAN ;
267 BEGIN
268 RETURN MDFlag
269 END GetMD ;
273 SetMMD - set the MMDFlag to value.
276 PROCEDURE SetMMD (value: BOOLEAN) ;
277 BEGIN
278 MMDFlag := value
279 END SetMMD ;
283 GetMMD - return the MMDFlag.
286 PROCEDURE GetMMD () : BOOLEAN ;
287 BEGIN
288 RETURN MMDFlag
289 END GetMMD ;
293 SetMF - assigns MFarg to the filename from arg.
296 PROCEDURE SetMF (arg: ADDRESS) ;
297 BEGIN
298 MFarg := KillString (MFarg) ;
299 MFarg := InitStringCharStar (arg)
300 END SetMF ;
304 GetMF - returns MFarg or NIL if never set.
307 PROCEDURE GetMF () : ADDRESS ;
308 BEGIN
309 RETURN string (MFarg)
310 END GetMF ;
314 SetMP - set the MPflag to value.
317 PROCEDURE SetMP (value: BOOLEAN) ;
318 BEGIN
319 MPFlag := value
320 END SetMP ;
324 GetMP - get the MPflag.
327 PROCEDURE GetMP () : BOOLEAN ;
328 BEGIN
329 RETURN MPFlag
330 END GetMP ;
334 errors1 -
337 PROCEDURE errors1 (format: ARRAY OF CHAR; arg: String) ;
339 message: String ;
340 cstr : ADDRESS ;
341 BEGIN
342 message := Sprintf1 (InitString (format), arg) ;
343 cstr := string (message) ;
344 cerror (cstr) ;
345 exit (1)
346 END errors1 ;
350 AddWord - concats a word to sentence inserting a space if necessary.
351 sentence is returned. sentence will be created if it is NIL.
354 PROCEDURE AddWord (sentence, word: String) : String ;
355 BEGIN
356 IF word # NIL
357 THEN
358 IF sentence = NIL
359 THEN
360 sentence := Dup (word)
361 ELSE
362 sentence := ConCatChar (sentence, ' ') ;
363 sentence := ConCat (sentence, word)
365 END ;
366 RETURN sentence
367 END AddWord ;
371 QuoteTarget - quote the '$' character.
374 PROCEDURE QuoteTarget (target: String) : String ;
376 quoted: String ;
377 i, n : CARDINAL ;
378 BEGIN
379 quoted := InitString ('') ;
380 i := 0 ;
381 n := Length (target) ;
382 WHILE i < n DO
383 CASE char (target, i) OF
385 '$': quoted := ConCat (quoted, Mark (InitString ('$$')))
387 ELSE
388 quoted := ConCatChar (quoted, char (target, i))
389 END ;
390 INC (i)
391 END ;
392 RETURN quoted
393 END QuoteTarget ;
397 SetMQ - adds a quoted target arg to the DepTarget sentence.
400 PROCEDURE SetMQ (arg: ADDRESS) ;
401 BEGIN
402 DepTarget := AddWord (DepTarget, QuoteTarget (InitStringCharStar (arg))) ;
403 MQFlag := AddWord (MQFlag, Mark (InitString ('-MQ'))) ;
404 MQFlag := AddWord (MQFlag, Mark (InitStringCharStar (arg)))
405 END SetMQ ;
409 GetMQ - returns a C string containing all the -MQ arg values.
412 PROCEDURE GetMQ () : ADDRESS ;
413 BEGIN
414 RETURN string (MQFlag)
415 END GetMQ ;
419 SetMT - adds a target arg to the DepTarget sentence.
422 PROCEDURE SetMT (arg: ADDRESS) ;
423 BEGIN
424 DepTarget := AddWord (DepTarget, InitStringCharStar (arg)) ;
425 MTFlag := AddWord (MTFlag, Mark (InitString ('-MT'))) ;
426 MTFlag := AddWord (MTFlag, Mark (InitStringCharStar (arg)))
427 END SetMT ;
431 GetMT - returns a C string containing all the -MT arg values.
434 PROCEDURE GetMT () : ADDRESS ;
435 BEGIN
436 RETURN string (MTFlag)
437 END GetMT ;
441 GetDepTarget - returns the DepTarget as a C string.
444 PROCEDURE GetDepTarget () : ADDRESS ;
445 BEGIN
446 RETURN string (DepTarget)
447 END GetDepTarget ;
451 SetObj - assigns CmdLineObj to the filename from arg.
454 PROCEDURE SetObj (arg: ADDRESS) ;
455 BEGIN
456 CmdLineObj := KillString (CmdLineObj) ;
457 CmdLineObj := InitStringCharStar (arg)
458 END SetObj ;
462 GetObj - returns CmdLineObj filename as a c-string or NIL if it was never set.
465 PROCEDURE GetObj () : ADDRESS ;
466 BEGIN
467 RETURN string (CmdLineObj)
468 END GetObj ;
472 CppCommandLine - returns the Cpp command line and all arguments.
473 NIL is returned if the -fcpp is absent.
476 PROCEDURE CppCommandLine () : String ;
478 s: String ;
479 BEGIN
480 IF CPreProcessor
481 THEN
482 s := InitStringCharStar (FullPathCPP ()) ;
483 s := ConCat (ConCatChar (s, ' '), CppArgs) ;
484 IF CC1Quiet
485 THEN
486 s := ConCat (ConCatChar (s, ' '), Mark (InitString ('-quiet')))
487 END ;
488 RETURN s
489 ELSE
490 RETURN NIL
492 END CppCommandLine ;
496 CppArg - sets the option and arg in the cpp command line.
499 PROCEDURE CppArg (opt, arg: ADDRESS; joined: BOOLEAN) ;
501 s: String ;
502 BEGIN
503 s := InitStringCharStar(opt) ;
504 IF EqualArray(s, '-fcpp-begin') OR EqualArray(s, '-fcpp-end')
505 THEN
506 (* do nothing *)
507 ELSE
508 IF NOT EqualArray(CppArgs, '')
509 THEN
510 CppArgs := ConCatChar(CppArgs, ' ')
511 END ;
512 CppArgs := ConCat(CppArgs, Mark(s)) ;
513 IF arg#NIL
514 THEN
515 s := InitStringCharStar(arg) ;
516 IF NOT joined
517 THEN
518 CppArgs := ConCatChar(CppArgs, ' ')
519 END ;
520 CppArgs := ConCat(CppArgs, s)
523 END CppArg ;
527 CppRemember - remember a string, s, as a cpp related argument.
528 The string, s, is not garbage collected.
531 PROCEDURE CppRemember (s: String) ;
532 BEGIN
533 IF (CppArgs=NIL) OR EqualArray (CppArgs, '')
534 THEN
535 CppArgs := Dup (s)
536 ELSE
537 CppArgs := ConCatChar (CppArgs, ' ') ;
538 CppArgs := ConCat (CppArgs, s)
540 END CppRemember ;
544 FinaliseOptions - once all options have been parsed we set any inferred
545 values.
548 PROCEDURE FinaliseOptions ;
549 BEGIN
550 (* currently only one value, this could be make an option in the future *)
551 VariantValueChecking := Iso
552 END FinaliseOptions ;
556 SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
559 PROCEDURE SetWholeProgram (value: BOOLEAN) ;
560 BEGIN
561 WholeProgram := value
562 END SetWholeProgram ;
566 SetReturnCheck -
569 PROCEDURE SetReturnCheck (value: BOOLEAN) : BOOLEAN ;
570 BEGIN
571 ReturnChecking := value ;
572 RETURN TRUE
573 END SetReturnCheck ;
577 SetNilCheck -
580 PROCEDURE SetNilCheck (value: BOOLEAN) : BOOLEAN ;
581 BEGIN
582 NilChecking := value ;
583 RETURN TRUE
584 END SetNilCheck ;
588 SetCaseCheck - set else case checking to, value.
591 PROCEDURE SetCaseCheck (value: BOOLEAN) : BOOLEAN ;
592 BEGIN
593 CaseElseChecking := value ;
594 RETURN TRUE
595 END SetCaseCheck ;
599 SetCheckAll - set all runtime checking to, value.
602 PROCEDURE SetCheckAll (value: BOOLEAN) : BOOLEAN ;
603 BEGIN
604 NilChecking := value ;
605 WholeDivChecking := value ;
606 IndexChecking := value ;
607 RangeChecking := value ;
608 ReturnChecking := value ;
609 NilChecking := value ;
610 CaseElseChecking := value ;
611 FloatValueChecking := value ;
612 WholeValueChecking := value ;
613 RETURN TRUE
614 END SetCheckAll ;
618 SetAutoInit - -fauto-init turns on automatic initialization of pointers to NIL.
619 TRUE is returned.
622 PROCEDURE SetAutoInit (value: BOOLEAN) : BOOLEAN ;
623 BEGIN
624 AutoInit := value ;
625 RETURN TRUE
626 END SetAutoInit ;
630 SetUnusedVariableChecking - assigns the UnusedVariableChecking to value.
633 PROCEDURE SetUnusedVariableChecking (value: BOOLEAN) ;
634 BEGIN
635 UnusedVariableChecking := value
636 END SetUnusedVariableChecking ;
640 SetUnusedParameterChecking - assigns the UnusedParameterChecking to value.
643 PROCEDURE SetUnusedParameterChecking (value: BOOLEAN) ;
644 BEGIN
645 UnusedParameterChecking := value
646 END SetUnusedParameterChecking ;
650 SetStrictTypeChecking - assigns the StrictTypeChecking flag to value.
653 PROCEDURE SetStrictTypeChecking (value: BOOLEAN) ;
654 BEGIN
655 StrictTypeChecking := value
656 END SetStrictTypeChecking ;
660 SetVerboseUnbounded - sets the VerboseUnbounded flag to, value.
663 PROCEDURE SetVerboseUnbounded (value: BOOLEAN) : BOOLEAN ;
664 BEGIN
665 VerboseUnbounded := value ;
666 RETURN TRUE
667 END SetVerboseUnbounded ;
671 SetQuiet - sets the quiet flag to, value.
674 PROCEDURE SetQuiet (value: BOOLEAN) : BOOLEAN ;
675 BEGIN
676 Quiet := value ;
677 RETURN TRUE
678 END SetQuiet ;
682 SetCpp - enables the source to be preprocessed and enables the
683 recognition of C preprocessor line directives.
686 PROCEDURE SetCpp (value: BOOLEAN) : BOOLEAN ;
687 BEGIN
688 CPreProcessor := value ;
689 LineDirectives := value ;
690 RETURN TRUE
691 END SetCpp ;
695 GetCpp - returns TRUE if the C preprocessor was used.
698 PROCEDURE GetCpp () : BOOLEAN ;
699 BEGIN
700 RETURN CPreProcessor
701 END GetCpp ;
705 GetLineDirectives - returns TRUE if line directives are allowed.
708 PROCEDURE GetLineDirectives () : BOOLEAN ;
709 BEGIN
710 RETURN LineDirectives
711 END GetLineDirectives ;
715 SetPPOnly - set the PPonly (preprocess only) to value.
718 PROCEDURE SetPPOnly (value: BOOLEAN) ;
719 BEGIN
720 PPonly := value
721 END SetPPOnly ;
724 GetPPOnly - get the PPonly (preprocess only).
727 PROCEDURE GetPPOnly () : BOOLEAN ;
728 BEGIN
729 RETURN PPonly
730 END GetPPOnly ;
734 Setc - set the cflag (compile only flag -c) to value.
737 PROCEDURE Setc (value: BOOLEAN) ;
738 BEGIN
739 cflag := value
740 END Setc ;
744 Getc - get the cflag (compile only flag -c).
747 PROCEDURE Getc () : BOOLEAN ;
748 BEGIN
749 RETURN cflag
750 END Getc ;
754 SetUselist - set the uselist flag to value and remember the filename.
757 PROCEDURE SetUselist (value: BOOLEAN; filename: ADDRESS) ;
758 BEGIN
759 UselistFlag := value ;
760 UselistFilename := KillString (UselistFilename) ;
761 IF filename # NIL
762 THEN
763 UselistFilename := InitStringCharStar (filename)
765 END SetUselist ;
769 GetUselist - return the uselist flag.
772 PROCEDURE GetUselist () : BOOLEAN ;
773 BEGIN
774 RETURN UselistFlag
775 END GetUselist ;
779 GetUselistFilename - return the uselist filename as a String.
782 PROCEDURE GetUselistFilename () : String ;
783 BEGIN
784 RETURN UselistFilename
785 END GetUselistFilename ;
789 SetM2g - set GenerateStatementNote to value and return value.
790 Corresponds to the -fm2-g flag.
793 PROCEDURE SetM2g (value: BOOLEAN) : BOOLEAN ;
794 BEGIN
795 GenerateStatementNote := value ;
796 RETURN GenerateStatementNote
797 END SetM2g ;
801 GetM2g - returns TRUE if the -fm2-g flags was used.
804 PROCEDURE GetM2g () : BOOLEAN ;
805 BEGIN
806 RETURN GenerateStatementNote
807 END GetM2g ;
811 SetLowerCaseKeywords - set the lower case keyword flag and return the result.
814 PROCEDURE SetLowerCaseKeywords (value: BOOLEAN) : BOOLEAN ;
815 BEGIN
816 LowerCaseKeywords := value ;
817 RETURN LowerCaseKeywords
818 END SetLowerCaseKeywords ;
822 SetVerbose - set the Verbose flag to, value. It returns TRUE.
825 PROCEDURE SetVerbose (value: BOOLEAN) : BOOLEAN ;
826 BEGIN
827 Verbose := value ;
828 RETURN( TRUE )
829 END SetVerbose ;
833 SetMakeall -
835 PROCEDURE SetMakeall (value: BOOLEAN) : BOOLEAN ;
836 BEGIN
837 (* value is unused *)
838 RETURN( TRUE )
839 END SetMakeall ;
844 SetMakeall0 -
846 PROCEDURE SetMakeall0 (value: BOOLEAN) : BOOLEAN ;
847 BEGIN
848 (* value is unused *)
849 RETURN( TRUE )
850 END SetMakeall0 ;
855 SetIncludePath -
857 PROCEDURE SetIncludePath (arg: ADDRESS) : BOOLEAN ;
858 BEGIN
859 RETURN( TRUE )
860 END SetIncludePath ;
865 SetUnboundedByReference -
868 PROCEDURE SetUnboundedByReference (value: BOOLEAN) : BOOLEAN ;
869 BEGIN
870 UnboundedByReference := value ;
871 RETURN( TRUE )
872 END SetUnboundedByReference ;
877 SetDebugging - sets the debugging flag to, v.
880 PROCEDURE SetDebugging (value: BOOLEAN) ;
881 BEGIN
882 GenerateDebugging := value
883 END SetDebugging ;
887 SetProfiling - dummy procedure, as profiling is implemented in the gcc backend.
890 PROCEDURE SetProfiling (value: BOOLEAN) ;
891 BEGIN
892 (* nothing to do *)
893 END SetProfiling ;
898 SetISO -
901 PROCEDURE SetISO (value: BOOLEAN) ;
902 BEGIN
903 Iso := value ;
904 Pim := NOT value ;
905 Pim2 := NOT value ;
906 (* Pim4 is the default, leave it alone since the DIV and MOD rules are the
907 same as ISO. *)
908 END SetISO ;
912 SetPIM -
915 PROCEDURE SetPIM (value: BOOLEAN) ;
916 BEGIN
917 Pim := value ;
918 Iso := NOT value
919 END SetPIM ;
923 SetPIM2 -
926 PROCEDURE SetPIM2 (value: BOOLEAN) ;
927 BEGIN
928 Pim := value ;
929 Pim2 := value ;
930 Iso := NOT value ;
931 IF value
932 THEN
933 (* Pim4 is the default, turn it off. *)
934 Pim4 := FALSE
936 END SetPIM2 ;
940 SetPIM3 -
943 PROCEDURE SetPIM3 (value: BOOLEAN) ;
944 BEGIN
945 Pim := value ;
946 Pim3 := value ;
947 Iso := NOT value ;
948 IF value
949 THEN
950 (* Pim4 is the default, turn it off. *)
951 Pim4 := FALSE
953 END SetPIM3 ;
957 SetPIM4 -
960 PROCEDURE SetPIM4 (value: BOOLEAN) ;
961 BEGIN
962 Pim := value ;
963 Pim4 := value ;
964 Iso := NOT value
965 END SetPIM4 ;
969 SetPositiveModFloor - sets the positive mod floor option.
972 PROCEDURE SetPositiveModFloor (value: BOOLEAN) ;
973 BEGIN
974 PositiveModFloorDiv := value
975 END SetPositiveModFloor ;
979 SetWholeDiv - sets the whole division flag.
982 PROCEDURE SetWholeDiv (value: BOOLEAN) ;
983 BEGIN
984 WholeDivChecking := value
985 END SetWholeDiv ;
989 SetIndex - sets the runtime array index checking flag.
992 PROCEDURE SetIndex (value: BOOLEAN) ;
993 BEGIN
994 IndexChecking := value
995 END SetIndex ;
999 SetRange - sets the runtime range checking flag.
1002 PROCEDURE SetRange (value: BOOLEAN) ;
1003 BEGIN
1004 RangeChecking := value
1005 END SetRange ;
1009 SetExceptions - sets the enable runtime exceptions flag.
1012 PROCEDURE SetExceptions (value: BOOLEAN) ;
1013 BEGIN
1014 Exceptions := value
1015 END SetExceptions ;
1019 SetStyle -
1022 PROCEDURE SetStyle (value: BOOLEAN) ;
1023 BEGIN
1024 StyleChecking := value
1025 END SetStyle ;
1029 SetPedantic -
1032 PROCEDURE SetPedantic (value: BOOLEAN) ;
1033 BEGIN
1034 Pedantic := value
1035 END SetPedantic ;
1039 SetPedanticParamNames - sets the pedantic parameter name flag.
1042 PROCEDURE SetPedanticParamNames (value: BOOLEAN) ;
1043 BEGIN
1044 PedanticParamNames := value
1045 END SetPedanticParamNames ;
1049 SetPedanticCast - sets the pedantic cast flag.
1052 PROCEDURE SetPedanticCast (value: BOOLEAN) ;
1053 BEGIN
1054 PedanticCast := value
1055 END SetPedanticCast ;
1059 SetExtendedOpaque - sets the ExtendedOpaque flag.
1062 PROCEDURE SetExtendedOpaque (value: BOOLEAN) ;
1063 BEGIN
1064 ExtendedOpaque := value
1065 END SetExtendedOpaque ;
1069 SetXCode - sets the xcode flag.
1072 PROCEDURE SetXCode (value: BOOLEAN) ;
1073 BEGIN
1074 Xcode := value
1075 END SetXCode ;
1079 SetSwig -
1082 PROCEDURE SetSwig (value: BOOLEAN) ;
1083 BEGIN
1084 GenerateSwig := value
1085 END SetSwig ;
1089 SetQuadDebugging - display the quadruples (internal debugging).
1092 PROCEDURE SetQuadDebugging (value: BOOLEAN) ;
1093 BEGIN
1094 DumpQuad := value ;
1095 DumpQuadFilename := KillString (DumpQuadFilename) ;
1096 DumpQuadFilename := InitString ('-')
1097 END SetQuadDebugging ;
1101 SetCompilerDebugging - turn on internal compiler debugging.
1102 Enabled via the command line option -fd.
1105 PROCEDURE SetCompilerDebugging (value: BOOLEAN) ;
1106 BEGIN
1107 CompilerDebugging := value
1108 END SetCompilerDebugging ;
1112 SetM2DebugTraceFilter - set internal debug flags. The flags should be
1113 specified as a comma separated list. The full
1114 list allowed is quad,line,token,all.
1117 PROCEDURE SetM2DebugTraceFilter (value: BOOLEAN; filter: ADDRESS) ;
1119 word,
1120 full : String ;
1121 start,
1122 i : INTEGER ;
1123 BEGIN
1124 full := InitStringCharStar (filter) ;
1125 start := 0 ;
1126 REPEAT
1127 i := Index (full, ',', start) ;
1128 IF i = -1
1129 THEN
1130 word := Slice (full, start, 0)
1131 ELSE
1132 word := Slice (full, start, i)
1133 END ;
1134 SetM2DebugTrace (word, value) ;
1135 word := KillString (word) ;
1136 start := i+1 ;
1137 UNTIL i = -1 ;
1138 full := KillString (full) ;
1139 END SetM2DebugTraceFilter ;
1143 SetM2DebugTrace -
1146 PROCEDURE SetM2DebugTrace (word: String; value: BOOLEAN) ;
1147 BEGIN
1148 IF EqualArray (word, 'all')
1149 THEN
1150 (* DebugTraceTree := value ; *)
1151 DebugTraceQuad := value ;
1152 DebugTraceToken := value ;
1153 DebugTraceLine := value
1154 ELSIF EqualArray (word, 'quad')
1155 THEN
1156 DebugTraceQuad := value
1157 ELSIF EqualArray (word, 'token')
1158 THEN
1159 DebugTraceToken := value
1160 ELSIF EqualArray (word, 'line')
1161 THEN
1162 DebugTraceLine := value
1163 ELSE
1164 errors1 ("unrecognized filter %s seen in -fm2-debug-trace= option\n", word)
1166 END SetM2DebugTrace ;
1170 SetDebugFunctionLineNumbers - set DebugFunctionLineNumbers.
1173 PROCEDURE SetDebugFunctionLineNumbers (value: BOOLEAN) ;
1174 BEGIN
1175 DebugFunctionLineNumbers := value
1176 END SetDebugFunctionLineNumbers ;
1180 GetDebugTraceQuad - return DebugTraceQuad.
1183 PROCEDURE GetDebugTraceQuad () : BOOLEAN ;
1184 BEGIN
1185 RETURN DebugTraceQuad
1186 END GetDebugTraceQuad ;
1190 GetDebugTraceTree - return DebugTraceTree.
1193 PROCEDURE GetDebugTraceTree () : BOOLEAN ;
1194 BEGIN
1195 RETURN DebugTraceTree
1196 END GetDebugTraceTree ;
1200 GetDebugTraceToken - return DebugTraceToken.
1203 PROCEDURE GetDebugTraceToken () : BOOLEAN ;
1204 BEGIN
1205 RETURN DebugTraceToken
1206 END GetDebugTraceToken ;
1210 GetDebugTraceLine - return DebugTraceLine.
1213 PROCEDURE GetDebugTraceLine () : BOOLEAN ;
1214 BEGIN
1215 RETURN DebugTraceLine
1216 END GetDebugTraceLine ;
1220 GetDebugFunctionLineNumbers - return DebugFunctionLineNumbers.
1223 PROCEDURE GetDebugFunctionLineNumbers () : BOOLEAN ;
1224 BEGIN
1225 RETURN DebugFunctionLineNumbers
1226 END GetDebugFunctionLineNumbers ;
1230 SetSources -
1233 PROCEDURE SetSources (value: BOOLEAN) ;
1234 BEGIN
1235 Quiet := NOT value ;
1236 SeenSources := value
1237 END SetSources ;
1241 SetDumpSystemExports -
1244 PROCEDURE SetDumpSystemExports (value: BOOLEAN) ;
1245 BEGIN
1246 DumpSystemExports := value
1247 END SetDumpSystemExports ;
1251 SetSearchPath -
1254 PROCEDURE SetSearchPath (arg: ADDRESS) ;
1256 s: String ;
1257 BEGIN
1258 s := InitStringCharStar (arg) ;
1259 AddInclude (M2PathName, s) ;
1260 IF Debugging
1261 THEN
1262 DumpPathName ("path name entries: ")
1263 END ;
1264 s := KillString (s)
1265 END SetSearchPath ;
1269 setdefextension - set the source file definition module extension to arg.
1270 This should include the . and by default it is set to .def.
1273 PROCEDURE setdefextension (arg: ADDRESS) ;
1275 s: String ;
1276 BEGIN
1277 s := InitStringCharStar (arg) ;
1278 SetDefExtension (s) ;
1279 s := KillString (s)
1280 END setdefextension ;
1284 setmodextension - set the source file module extension to arg.
1285 This should include the . and by default it is set to .mod.
1288 PROCEDURE setmodextension (arg: ADDRESS) ;
1290 s: String ;
1291 BEGIN
1292 s := InitStringCharStar (arg) ;
1293 SetModExtension (s) ;
1294 s := KillString (s)
1295 END setmodextension ;
1299 SetOptimizing -
1302 PROCEDURE SetOptimizing (value: CARDINAL) ;
1303 BEGIN
1304 IF value>0
1305 THEN
1306 Optimizing := TRUE ;
1307 OptimizeBasicBlock := TRUE ;
1308 OptimizeUncalledProcedures := TRUE ;
1309 OptimizeCommonSubExpressions := TRUE
1310 ELSE
1311 Optimizing := FALSE ;
1312 OptimizeBasicBlock := FALSE ;
1313 OptimizeUncalledProcedures := FALSE ;
1314 OptimizeCommonSubExpressions := FALSE
1316 END SetOptimizing ;
1320 SetForcedLocation - sets the location for the lifetime of this compile to, location.
1321 This is primarily an internal debugging switch.
1324 PROCEDURE SetForcedLocation (location: location_t) ;
1325 BEGIN
1326 ForcedLocation := TRUE ;
1327 ForcedLocationValue := location
1328 END SetForcedLocation ;
1332 SetCC1Quiet - sets the cc1quiet flag to, value.
1335 PROCEDURE SetCC1Quiet (value: BOOLEAN) ;
1336 BEGIN
1337 CC1Quiet := value
1338 END SetCC1Quiet ;
1342 SetStatistics - turn on/off generate of compile time statistics.
1345 PROCEDURE SetStatistics (on: BOOLEAN) ;
1346 BEGIN
1347 Statistics := on
1348 END SetStatistics ;
1352 OverrideLocation - possibly override the location value, depending upon
1353 whether the -flocation= option was used.
1356 PROCEDURE OverrideLocation (location: location_t) : location_t ;
1357 BEGIN
1358 IF ForcedLocation
1359 THEN
1360 RETURN( ForcedLocationValue )
1361 ELSE
1362 RETURN( location )
1364 END OverrideLocation ;
1368 SetGenerateStatementNote - turn on generation of nops if necessary
1369 to generate pedalogical single stepping.
1372 PROCEDURE SetGenerateStatementNote (value: BOOLEAN) ;
1373 BEGIN
1374 GenerateStatementNote := value
1375 END SetGenerateStatementNote ;
1379 GetISO - return TRUE if -fiso was present on the command line.
1382 PROCEDURE GetISO () : BOOLEAN ;
1383 BEGIN
1384 RETURN Iso
1385 END GetISO ;
1389 GetPIM - return TRUE if -fpim was present on the command line.
1392 PROCEDURE GetPIM () : BOOLEAN ;
1393 BEGIN
1394 RETURN Pim
1395 END GetPIM ;
1399 GetPIM2 - return TRUE if -fpim2 was present on the command line.
1402 PROCEDURE GetPIM2 () : BOOLEAN ;
1403 BEGIN
1404 RETURN Pim2
1405 END GetPIM2 ;
1409 GetPIM3 - return TRUE if -fpim3 was present on the command line.
1412 PROCEDURE GetPIM3 () : BOOLEAN ;
1413 BEGIN
1414 RETURN Pim3
1415 END GetPIM3 ;
1419 GetPIM4 - return TRUE if -fpim4 was present on the command line.
1422 PROCEDURE GetPIM4 () : BOOLEAN ;
1423 BEGIN
1424 RETURN Pim4
1425 END GetPIM4 ;
1429 GetPositiveModFloor - return TRUE if -fpositive-mod-floor was present
1430 on the command line.
1433 PROCEDURE GetPositiveModFloor () : BOOLEAN ;
1434 BEGIN
1435 RETURN PositiveModFloorDiv
1436 END GetPositiveModFloor ;
1440 GetFloatValueCheck - return TRUE if -ffloatvalue was present on the
1441 command line.
1444 PROCEDURE GetFloatValueCheck () : BOOLEAN ;
1445 BEGIN
1446 RETURN FloatValueChecking
1447 END GetFloatValueCheck ;
1451 SetFloatValueCheck - set depending upon the -ffloatvalue.
1454 PROCEDURE SetFloatValueCheck (value: BOOLEAN) ;
1455 BEGIN
1456 FloatValueChecking := value
1457 END SetFloatValueCheck ;
1461 GetWholeValueCheck - return TRUE if -fwholevalue was present on the
1462 command line.
1465 PROCEDURE GetWholeValueCheck () : BOOLEAN ;
1466 BEGIN
1467 RETURN WholeValueChecking
1468 END GetWholeValueCheck ;
1472 SetWholeValueCheck - set depending upon the -fwholevalue.
1475 PROCEDURE SetWholeValueCheck (value: BOOLEAN) ;
1476 BEGIN
1477 WholeValueChecking := value
1478 END SetWholeValueCheck ;
1482 SetWall - set all warnings to, value.
1485 PROCEDURE SetWall (value: BOOLEAN) ;
1486 BEGIN
1487 UnusedVariableChecking := value ;
1488 UnusedParameterChecking := value ;
1489 UninitVariableChecking := value ;
1490 PedanticCast := value ;
1491 PedanticParamNames := value ;
1492 StyleChecking := value ;
1493 CaseEnumChecking := value
1494 END SetWall ;
1498 SetSaveTemps - turn on/off -save-temps.
1501 PROCEDURE SetSaveTemps (value: BOOLEAN) ;
1502 BEGIN
1503 SaveTemps := value
1504 END SetSaveTemps ;
1508 SetSaveTempsDir - turn on/off -save-temps and specify the directory.
1511 PROCEDURE SetSaveTempsDir (arg: ADDRESS) ;
1512 BEGIN
1513 SaveTempsDir := InitStringCharStar (arg) ;
1514 SaveTemps := TRUE
1515 END SetSaveTempsDir ;
1519 GetSaveTempsDir - return SaveTempsDir or NIL if -save-temps was not used.
1522 PROCEDURE GetSaveTempsDir () : String ;
1523 BEGIN
1524 RETURN SaveTempsDir
1525 END GetSaveTempsDir ;
1529 SetDumpDir - Set the dump dir.
1532 PROCEDURE SetDumpDir (arg: ADDRESS) ;
1533 BEGIN
1534 DumpDir := InitStringCharStar (arg)
1535 END SetDumpDir ;
1539 GetDumpDir - return DumpDir or NIL.
1542 PROCEDURE GetDumpDir () : String ;
1543 BEGIN
1544 RETURN DumpDir
1545 END GetDumpDir ;
1548 SetScaffoldDynamic - set the -fscaffold-dynamic flag.
1551 PROCEDURE SetScaffoldDynamic (value: BOOLEAN) ;
1552 BEGIN
1553 ScaffoldDynamic := value ;
1554 IF ScaffoldDynamic
1555 THEN
1556 ScaffoldStatic := FALSE
1558 END SetScaffoldDynamic ;
1562 SetScaffoldStatic - set the -fscaffold-static flag.
1565 PROCEDURE SetScaffoldStatic (value: BOOLEAN) ;
1566 BEGIN
1567 ScaffoldStatic := value ;
1568 IF ScaffoldStatic
1569 THEN
1570 ScaffoldDynamic := FALSE
1572 END SetScaffoldStatic ;
1576 GetScaffoldDynamic - get the -fscaffold-dynamic flag.
1579 PROCEDURE GetScaffoldDynamic () : BOOLEAN ;
1580 BEGIN
1581 RETURN ScaffoldDynamic
1582 END GetScaffoldDynamic ;
1586 GetScaffoldStatic - get the -fscaffold-static flag.
1589 PROCEDURE GetScaffoldStatic () : BOOLEAN ;
1590 BEGIN
1591 RETURN ScaffoldStatic
1592 END GetScaffoldStatic ;
1596 SetScaffoldMain - set the -fscaffold-main flag.
1599 PROCEDURE SetScaffoldMain (value: BOOLEAN) ;
1600 BEGIN
1601 ScaffoldMain := value
1602 END SetScaffoldMain ;
1606 SetRuntimeModuleOverride - set the override sequence used for module
1607 initialization and finialization.
1610 PROCEDURE SetRuntimeModuleOverride (override: ADDRESS) ;
1611 BEGIN
1612 RuntimeModuleOverride := KillString (RuntimeModuleOverride) ;
1613 RuntimeModuleOverride := InitStringCharStar (override)
1614 END SetRuntimeModuleOverride ;
1618 GetRuntimeModuleOverride - return a string containing any user override
1619 or the default module initialization override
1620 sequence.
1623 PROCEDURE GetRuntimeModuleOverride () : ADDRESS ;
1624 BEGIN
1625 RETURN string (RuntimeModuleOverride)
1626 END GetRuntimeModuleOverride ;
1630 SetGenModuleList - set the GenModuleList flag to true and pass
1631 set GenModuleListFilename to filename.
1634 PROCEDURE SetGenModuleList (value: BOOLEAN; filename: ADDRESS) ;
1635 BEGIN
1636 GenModuleListFilename := KillString (GenModuleListFilename) ;
1637 IF filename # NIL
1638 THEN
1639 GenModuleListFilename := InitStringCharStar (filename)
1640 END ;
1641 GenModuleList := value
1642 END SetGenModuleList ;
1646 GetGenModuleFilename - returns the filename set by SetGenModuleList.
1649 PROCEDURE GetGenModuleFilename () : String ;
1650 BEGIN
1651 RETURN GenModuleListFilename
1652 END GetGenModuleFilename ;
1656 SetShared - sets the SharedFlag to value.
1659 PROCEDURE SetShared (value: BOOLEAN) ;
1660 BEGIN
1661 SharedFlag := value
1662 END SetShared ;
1666 SetUninitVariableChecking - sets the UninitVariableChecking and
1667 UninitVariableConditionalChecking flags to value
1668 depending upon arg string. The arg string
1669 can be: "all", "known,cond", "cond,known", "known"
1670 or "cond".
1673 PROCEDURE SetUninitVariableChecking (value: BOOLEAN; arg: ADDRESS) : INTEGER ;
1675 s: String ;
1676 BEGIN
1677 IF Debugging
1678 THEN
1679 IF value
1680 THEN
1681 printf ("SetUninitVariableChecking (TRUE, %s)\n", arg)
1682 ELSE
1683 printf ("SetUninitVariableChecking (FALSE, %s)\n", arg)
1685 END ;
1686 s := InitStringCharStar (arg) ;
1687 IF EqualArray (s, "all") OR
1688 EqualArray (s, "known,cond") OR
1689 EqualArray (s, "cond,known")
1690 THEN
1691 UninitVariableChecking := value ;
1692 UninitVariableConditionalChecking := value ;
1693 s := KillString (s) ;
1694 RETURN 1
1695 ELSIF EqualArray (s, "known")
1696 THEN
1697 UninitVariableChecking := value ;
1698 s := KillString (s) ;
1699 RETURN 1
1700 ELSIF EqualArray (s, "cond")
1701 THEN
1702 UninitVariableConditionalChecking := value ;
1703 s := KillString (s) ;
1704 RETURN 1
1705 ELSE
1706 s := KillString (s) ;
1707 RETURN 0
1709 END SetUninitVariableChecking ;
1713 SetCaseEnumChecking - sets the CaseEnumChecking to value.
1716 PROCEDURE SetCaseEnumChecking (value: BOOLEAN) ;
1717 BEGIN
1718 CaseEnumChecking := value
1719 END SetCaseEnumChecking ;
1723 SetDebugBuiltins - sets the DebugBuiltins to value.
1726 PROCEDURE SetDebugBuiltins (value: BOOLEAN) ;
1727 BEGIN
1728 DebugBuiltins := value
1729 END SetDebugBuiltins ;
1733 SetIBMLongDouble - enable/disable LONGREAL to map onto the
1734 IBM long double 128 bit data type.
1735 (Only available on the ppc).
1738 PROCEDURE SetIBMLongDouble (value: BOOLEAN) ;
1739 BEGIN
1740 IBMLongDouble := value ;
1741 IF value
1742 THEN
1743 IEEELongDouble := FALSE
1745 END SetIBMLongDouble ;
1749 GetIBMLongDouble - return the value of IBMLongDouble.
1752 PROCEDURE GetIBMLongDouble () : BOOLEAN ;
1753 BEGIN
1754 RETURN IBMLongDouble
1755 END GetIBMLongDouble ;
1759 SetIEEELongDouble - enable/disable LONGREAL to map onto the
1760 IEEE long double 128 bit data type.
1761 (Only available on the ppc).
1764 PROCEDURE SetIEEELongDouble (value: BOOLEAN) ;
1765 BEGIN
1766 IEEELongDouble := value ;
1767 IF value
1768 THEN
1769 IBMLongDouble := FALSE
1771 END SetIEEELongDouble ;
1775 GetIEEELongDouble - return the value of IEEELongDouble.
1778 PROCEDURE GetIEEELongDouble () : BOOLEAN ;
1779 BEGIN
1780 RETURN IEEELongDouble
1781 END GetIEEELongDouble ;
1785 InitializeLongDoubleFlags - initialize the long double related flags
1786 with default values given during gcc configure.
1789 PROCEDURE InitializeLongDoubleFlags ;
1790 BEGIN
1791 IBMLongDouble := FALSE ;
1792 IEEELongDouble := FALSE ;
1793 CASE TargetIEEEQuadDefault () OF
1795 -1: |
1796 0: IBMLongDouble := TRUE |
1797 1: IEEELongDouble := TRUE
1799 ELSE
1800 InternalError ('unexpected value returned from TargetIEEEQuadDefault ()')
1802 END InitializeLongDoubleFlags ;
1806 GetDumpDeclFilename - returns the DumpDeclFilename.
1809 PROCEDURE GetDumpDeclFilename () : String ;
1810 BEGIN
1811 RETURN DumpDeclFilename
1812 END GetDumpDeclFilename ;
1816 SetDumpDeclFilename -
1819 PROCEDURE SetDumpDeclFilename (value: BOOLEAN; filename: ADDRESS) ;
1820 BEGIN
1821 DumpDecl := value ;
1822 DumpDeclFilename := KillString (DumpDeclFilename) ;
1823 IF filename # NIL
1824 THEN
1825 DumpDeclFilename := InitStringCharStar (filename)
1827 END SetDumpDeclFilename ;
1831 GetDumpQuadFilename - returns the DumpQuadFilename.
1834 PROCEDURE GetDumpQuadFilename () : String ;
1835 BEGIN
1836 RETURN DumpQuadFilename
1837 END GetDumpQuadFilename ;
1841 SetDumpQuadFilename -
1844 PROCEDURE SetDumpQuadFilename (value: BOOLEAN; filename: ADDRESS) ;
1845 BEGIN
1846 DumpQuad := value ;
1847 DumpQuadFilename := KillString (DumpQuadFilename) ;
1848 IF filename # NIL
1849 THEN
1850 DumpQuadFilename := InitStringCharStar (filename)
1852 END SetDumpQuadFilename ;
1856 GetDumpGimpleFilename - returns the DumpGimpleFilename.
1859 PROCEDURE GetDumpGimpleFilename () : String ;
1860 BEGIN
1861 RETURN DumpGimpleFilename
1862 END GetDumpGimpleFilename ;
1866 SetDumpGimpleFilename - set DumpGimpleFilename to filename.
1869 PROCEDURE SetDumpGimpleFilename (value: BOOLEAN; filename: ADDRESS) ;
1870 BEGIN
1871 DumpGimple := value ;
1872 DumpGimpleFilename := KillString (DumpGimpleFilename) ;
1873 IF value AND (filename # NIL)
1874 THEN
1875 DumpGimpleFilename := InitStringCharStar (filename)
1877 END SetDumpGimpleFilename ;
1881 SetM2DumpFilter - sets the filter to a comma separated list of procedures
1882 and modules. Not to be confused with SetM2Dump below
1883 which enables the class of data structures to be dumped.
1886 PROCEDURE SetM2DumpFilter (value: BOOLEAN; filter: ADDRESS) ;
1887 BEGIN
1888 M2DumpFilter := KillString (M2DumpFilter) ;
1889 IF value AND (filter # NIL)
1890 THEN
1891 M2DumpFilter := InitStringCharStar (filter)
1893 END SetM2DumpFilter ;
1897 GetM2DumpFilter - returns the dump filter.
1900 PROCEDURE GetM2DumpFilter () : ADDRESS ;
1901 BEGIN
1902 IF M2DumpFilter = NIL
1903 THEN
1904 RETURN NIL
1905 ELSE
1906 RETURN string (M2DumpFilter)
1908 END GetM2DumpFilter ;
1912 MatchDump - enable/disable dump using value. It returns TRUE if dump
1913 is valid.
1916 PROCEDURE MatchDump (dump: String; value: BOOLEAN) : BOOLEAN ;
1917 BEGIN
1918 IF EqualArray (dump, 'all')
1919 THEN
1920 DumpDecl := value ;
1921 DumpQuad := value ;
1922 DumpGimple := value ;
1923 RETURN TRUE
1924 ELSIF EqualArray (dump, 'decl')
1925 THEN
1926 DumpDecl := value ;
1927 RETURN TRUE
1928 ELSIF EqualArray (dump, 'gimple')
1929 THEN
1930 DumpGimple := value ;
1931 RETURN TRUE
1932 ELSIF EqualArray (dump, 'quad')
1933 THEN
1934 DumpQuad := value ;
1935 RETURN TRUE
1936 END ;
1937 RETURN FALSE
1938 END MatchDump ;
1942 SetM2Dump - sets the dump via a comma separated list: quad,decl,gimple,all.
1943 It returns TRUE if the comma separated list is valid.
1946 PROCEDURE SetM2Dump (value: BOOLEAN; filter: ADDRESS) : BOOLEAN ;
1948 result: BOOLEAN ;
1949 dump : String ;
1950 start,
1951 i : INTEGER ;
1952 BEGIN
1953 IF filter = NIL
1954 THEN
1955 RETURN FALSE
1956 END ;
1957 IF M2Dump # NIL
1958 THEN
1959 M2Dump := KillString (M2Dump)
1960 END ;
1961 M2Dump := InitStringCharStar (filter) ;
1962 start := 0 ;
1963 REPEAT
1964 i := Index (M2Dump, ',', start) ;
1965 IF i = -1
1966 THEN
1967 dump := Slice (M2Dump, start, 0)
1968 ELSE
1969 dump := Slice (M2Dump, start, i)
1970 END ;
1971 result := MatchDump (dump, value) ;
1972 dump := KillString (dump) ;
1973 IF NOT result
1974 THEN
1975 RETURN FALSE
1976 END ;
1977 start := i+1 ;
1978 UNTIL i = -1 ;
1979 RETURN TRUE
1980 END SetM2Dump ;
1984 GetDumpGimple - return TRUE if the dump gimple flag is set from SetM2Dump.
1987 PROCEDURE GetDumpGimple () : BOOLEAN ;
1988 BEGIN
1989 RETURN DumpGimple
1990 END GetDumpGimple ;
1994 GetDumpQuad - return TRUE if the dump quad flag is set from SetM2Dump.
1997 PROCEDURE GetDumpQuad () : BOOLEAN ;
1998 BEGIN
1999 RETURN DumpQuad
2000 END GetDumpQuad ;
2004 GetDumpDecl - return TRUE if the dump decl flag is set from SetM2Dump.
2007 PROCEDURE GetDumpDecl () : BOOLEAN ;
2008 BEGIN
2009 RETURN DumpDecl
2010 END GetDumpDecl ;
2014 GetEnableForward - return EnableForward.
2017 PROCEDURE GetEnableForward () : BOOLEAN ;
2018 BEGIN
2019 RETURN EnableForward
2020 END GetEnableForward ;
2024 SetEnableForward - set EnableForward to value.
2027 PROCEDURE SetEnableForward (value: BOOLEAN) ;
2028 BEGIN
2029 EnableForward := value
2030 END SetEnableForward ;
2034 SetFileOffsetBits - create SYSTEM.COFF_T as a signed integer of size bits.
2037 PROCEDURE SetFileOffsetBits (value: BOOLEAN; bits: CARDINAL) : BOOLEAN ;
2038 BEGIN
2039 IF value
2040 THEN
2041 OffTBits := bits
2042 END ;
2043 RETURN TRUE
2044 END SetFileOffsetBits ;
2048 GetFileOffsetBits - return the number of bits used to create SYSTEM.COFF_T.
2051 PROCEDURE GetFileOffsetBits () : CARDINAL ;
2052 BEGIN
2053 RETURN OffTBits
2054 END GetFileOffsetBits ;
2057 BEGIN
2058 cflag := FALSE ; (* -c. *)
2059 RuntimeModuleOverride := InitString (DefaultRuntimeModuleOverride) ;
2060 CppArgs := InitString ('') ;
2061 Pim := TRUE ;
2062 Pim2 := FALSE ;
2063 Pim3 := FALSE ;
2064 Pim4 := TRUE ;
2065 PositiveModFloorDiv := FALSE ;
2066 Iso := FALSE ;
2067 SeenSources := FALSE ;
2068 Statistics := FALSE ;
2069 StyleChecking := FALSE ;
2070 CompilerDebugging := FALSE ;
2071 GenerateDebugging := FALSE ;
2072 Optimizing := FALSE ;
2073 Pedantic := FALSE ;
2074 Verbose := FALSE ;
2075 Quiet := TRUE ;
2076 CC1Quiet := TRUE ;
2077 Profiling := FALSE ;
2078 DumpQuad := FALSE ;
2079 OptimizeBasicBlock := FALSE ;
2080 OptimizeUncalledProcedures := FALSE ;
2081 OptimizeCommonSubExpressions := FALSE ;
2082 NilChecking := FALSE ;
2083 WholeDivChecking := FALSE ;
2084 WholeValueChecking := FALSE ;
2085 FloatValueChecking := FALSE ;
2086 IndexChecking := FALSE ;
2087 RangeChecking := FALSE ;
2088 ReturnChecking := FALSE ;
2089 CaseElseChecking := FALSE ;
2090 CPreProcessor := FALSE ;
2091 LineDirectives := TRUE ;
2092 ExtendedOpaque := FALSE ;
2093 UnboundedByReference := FALSE ;
2094 VerboseUnbounded := FALSE ;
2095 PedanticParamNames := FALSE ;
2096 PedanticCast := FALSE ;
2097 Xcode := FALSE ;
2098 DumpSystemExports := FALSE ;
2099 GenerateSwig := FALSE ;
2100 Exceptions := TRUE ;
2101 DebugBuiltins := FALSE ;
2102 ForcedLocation := FALSE ;
2103 WholeProgram := FALSE ;
2104 DebugTraceQuad := FALSE ;
2105 DebugTraceTree := FALSE ;
2106 DebugTraceLine := FALSE ;
2107 DebugTraceToken := FALSE ;
2108 DebugFunctionLineNumbers := FALSE ;
2109 GenerateStatementNote := FALSE ;
2110 LowerCaseKeywords := FALSE ;
2111 UnusedVariableChecking := FALSE ;
2112 UnusedParameterChecking := FALSE ;
2113 StrictTypeChecking := TRUE ;
2114 AutoInit := FALSE ;
2115 SaveTemps := FALSE ;
2116 ScaffoldDynamic := TRUE ;
2117 ScaffoldStatic := FALSE ;
2118 ScaffoldMain := FALSE ;
2119 UselistFilename := NIL ;
2120 GenModuleList := FALSE ;
2121 GenModuleListFilename := NIL ;
2122 SharedFlag := FALSE ;
2123 Barg := NIL ;
2124 MDFlag := FALSE ;
2125 MMDFlag := FALSE ;
2126 DepTarget := NIL ;
2127 MPFlag := FALSE ;
2128 SaveTempsDir := NIL ;
2129 DumpDir := NIL ;
2130 UninitVariableChecking := FALSE ;
2131 UninitVariableConditionalChecking := FALSE ;
2132 CaseEnumChecking := FALSE ;
2133 MFlag := FALSE ;
2134 MMFlag := FALSE ;
2135 MFarg := NIL ;
2136 MTFlag := NIL ;
2137 MQFlag := NIL ;
2138 InitializeLongDoubleFlags ;
2139 M2Prefix := InitString ('') ;
2140 M2PathName := InitString ('') ;
2141 DumpQuadFilename := NIL ;
2142 DumpGimpleFilename := NIL ;
2143 DumpDeclFilename := NIL ;
2144 DumpDecl := FALSE ;
2145 DumpQuad := FALSE ;
2146 DumpGimple := FALSE ;
2147 M2Dump := NIL ;
2148 M2DumpFilter := NIL ;
2149 EnableForward := TRUE ;
2150 OffTBits := 0 ; (* Default to CSSIZE_T. *)
2151 END M2Options.