1 (* M2Options.mod initializes the user options.
3 Copyright (C) 2001-2024 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)
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 ;
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 m2linemap IMPORT location_t ;
34 FROM m2configure IMPORT FullPathCPP ;
37 FROM DynamicStrings IMPORT String, Length, InitString, Mark, Slice, EqualArray,
38 InitStringCharStar, ConCatChar, ConCat, KillString,
40 PushAllocation, PopAllocationExemption,
41 InitStringDB, InitStringCharStarDB,
42 InitStringCharDB, MultDB, DupDB, SliceDB ;
45 #define InitString(X) InitStringDB(X, __FILE__, __LINE__)
46 #define InitStringCharStar(X) InitStringCharStarDB(X, __FILE__, __LINE__)
47 #define InitStringChar(X) InitStringCharDB(X, __FILE__, __LINE__)
48 #define Mult(X,Y) MultDB(X, Y, __FILE__, __LINE__)
49 #define Dup(X) DupDB(X, __FILE__, __LINE__)
50 #define Slice(X,Y,Z) SliceDB(X, Y, Z, __FILE__, __LINE__)
55 DefaultRuntimeModuleOverride = "m2iso:RTentity,m2iso:Storage,m2iso:SYSTEM,m2iso:M2RTS,m2iso:RTExceptions,m2iso:IOLink" ;
68 GenModuleListFilename,
70 RuntimeModuleOverride,
79 SeenSources : BOOLEAN ;
80 ForcedLocationValue : location_t ;
83 (* String garbage collection debugging routines.
89 PROCEDURE doDSdbEnter ;
99 PROCEDURE doDSdbExit (s: String) ;
101 s := PopAllocationExemption (TRUE, s)
109 PROCEDURE DSdbEnter ;
118 PROCEDURE DSdbExit (s: String) ;
124 #define DSdbEnter doDSdbEnter
125 #define DSdbExit doDSdbExit
130 SetM2Prefix - assign arg to M2Prefix.
133 PROCEDURE SetM2Prefix (arg: ADDRESS) ;
135 M2Prefix := KillString (M2Prefix) ;
136 M2Prefix := InitStringCharStar (arg)
141 GetM2Prefix - return M2Prefix as a C string.
144 PROCEDURE GetM2Prefix () : ADDRESS ;
146 RETURN string (M2Prefix)
151 SetM2PathName - assign arg to M2PathName.
154 PROCEDURE SetM2PathName (arg: ADDRESS) ;
156 M2PathName := KillString (M2PathName) ;
157 M2PathName := InitStringCharStar (arg) ;
158 (* fprintf1 (StdErr, "M2PathName = %s\n", M2PathName) *)
163 GetM2PathName - return M2PathName as a C string.
166 PROCEDURE GetM2PathName () : ADDRESS ;
168 RETURN string (M2PathName)
173 SetB - assigns Barg to arg.
176 PROCEDURE SetB (arg: ADDRESS) ;
178 Barg := KillString (Barg) ;
179 Barg := InitStringCharStar (arg)
184 GetB - returns Barg value as a C string or NIL if it was never set.
187 PROCEDURE GetB () : ADDRESS ;
194 SetM - set the MFlag.
197 PROCEDURE SetM (value: BOOLEAN) ;
204 GetM - set the MFlag.
207 PROCEDURE GetM () : BOOLEAN ;
214 SetMM - set the MMFlag.
217 PROCEDURE SetMM (value: BOOLEAN) ;
224 GetMM - set the MMFlag.
227 PROCEDURE GetMM () : BOOLEAN ;
234 SetMD - set the MDFlag to value.
237 PROCEDURE SetMD (value: BOOLEAN) ;
244 GetMD - return the MDFlag.
247 PROCEDURE GetMD () : BOOLEAN ;
254 SetMMD - set the MMDFlag to value.
257 PROCEDURE SetMMD (value: BOOLEAN) ;
264 GetMMD - return the MMDFlag.
267 PROCEDURE GetMMD () : BOOLEAN ;
274 SetMF - assigns MFarg to the filename from arg.
277 PROCEDURE SetMF (arg: ADDRESS) ;
279 MFarg := KillString (MFarg) ;
280 MFarg := InitStringCharStar (arg)
285 GetMF - returns MFarg or NIL if never set.
288 PROCEDURE GetMF () : ADDRESS ;
290 RETURN string (MFarg)
295 SetMP - set the MPflag to value.
298 PROCEDURE SetMP (value: BOOLEAN) ;
305 GetMP - get the MPflag.
308 PROCEDURE GetMP () : BOOLEAN ;
315 AddWord - concats a word to sentence inserting a space if necessary.
316 sentence is returned. sentence will be created if it is NIL.
319 PROCEDURE AddWord (sentence, word: String) : String ;
325 sentence := Dup (word)
327 sentence := ConCatChar (sentence, ' ') ;
328 sentence := ConCat (sentence, word)
336 QuoteTarget - quote the '$' character.
339 PROCEDURE QuoteTarget (target: String) : String ;
344 quoted := InitString ('') ;
346 n := Length (target) ;
348 CASE char (target, i) OF
350 '$': quoted := ConCat (quoted, Mark (InitString ('$$')))
353 quoted := ConCatChar (quoted, char (target, i))
362 SetMQ - adds a quoted target arg to the DepTarget sentence.
365 PROCEDURE SetMQ (arg: ADDRESS) ;
367 DepTarget := AddWord (DepTarget, QuoteTarget (InitStringCharStar (arg))) ;
368 MQFlag := AddWord (MQFlag, Mark (InitString ('-MQ'))) ;
369 MQFlag := AddWord (MQFlag, Mark (InitStringCharStar (arg)))
374 GetMQ - returns a C string containing all the -MQ arg values.
377 PROCEDURE GetMQ () : ADDRESS ;
379 RETURN string (MQFlag)
384 SetMT - adds a target arg to the DepTarget sentence.
387 PROCEDURE SetMT (arg: ADDRESS) ;
389 DepTarget := AddWord (DepTarget, InitStringCharStar (arg)) ;
390 MTFlag := AddWord (MTFlag, Mark (InitString ('-MT'))) ;
391 MTFlag := AddWord (MTFlag, Mark (InitStringCharStar (arg)))
396 GetMT - returns a C string containing all the -MT arg values.
399 PROCEDURE GetMT () : ADDRESS ;
401 RETURN string (MTFlag)
406 GetDepTarget - returns the DepTarget as a C string.
409 PROCEDURE GetDepTarget () : ADDRESS ;
411 RETURN string (DepTarget)
416 SetObj - assigns CmdLineObj to the filename from arg.
419 PROCEDURE SetObj (arg: ADDRESS) ;
421 CmdLineObj := KillString (CmdLineObj) ;
422 CmdLineObj := InitStringCharStar (arg)
427 GetObj - returns CmdLineObj filename as a c-string or NIL if it was never set.
430 PROCEDURE GetObj () : ADDRESS ;
432 RETURN string (CmdLineObj)
437 CppCommandLine - returns the Cpp command line and all arguments.
438 NIL is returned if the -fcpp is absent.
441 PROCEDURE CppCommandLine () : String ;
447 s := InitStringCharStar (FullPathCPP ()) ;
448 s := ConCat (ConCatChar (s, ' '), CppArgs) ;
451 s := ConCat (ConCatChar (s, ' '), Mark (InitString ('-quiet')))
461 CppArg - sets the option and arg in the cpp command line.
464 PROCEDURE CppArg (opt, arg: ADDRESS; joined: BOOLEAN) ;
468 s := InitStringCharStar(opt) ;
469 IF EqualArray(s, '-fcpp-begin') OR EqualArray(s, '-fcpp-end')
473 IF NOT EqualArray(CppArgs, '')
475 CppArgs := ConCatChar(CppArgs, ' ')
477 CppArgs := ConCat(CppArgs, Mark(s)) ;
480 s := InitStringCharStar(arg) ;
483 CppArgs := ConCatChar(CppArgs, ' ')
485 CppArgs := ConCat(CppArgs, s)
492 CppRemember - remember a string, s, as a cpp related argument.
493 The string, s, is not garbage collected.
496 PROCEDURE CppRemember (s: String) ;
498 IF (CppArgs=NIL) OR EqualArray (CppArgs, '')
502 CppArgs := ConCatChar (CppArgs, ' ') ;
503 CppArgs := ConCat (CppArgs, s)
509 FinaliseOptions - once all options have been parsed we set any inferred
513 PROCEDURE FinaliseOptions ;
515 (* currently only one value, this could be make an option in the future *)
516 VariantValueChecking := Iso
517 END FinaliseOptions ;
521 SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
524 PROCEDURE SetWholeProgram (value: BOOLEAN) ;
526 WholeProgram := value
527 END SetWholeProgram ;
534 PROCEDURE SetReturnCheck (value: BOOLEAN) : BOOLEAN ;
536 ReturnChecking := value ;
545 PROCEDURE SetNilCheck (value: BOOLEAN) : BOOLEAN ;
547 NilChecking := value ;
553 SetCaseCheck - set else case checking to, value.
556 PROCEDURE SetCaseCheck (value: BOOLEAN) : BOOLEAN ;
558 CaseElseChecking := value ;
564 SetCheckAll - set all runtime checking to, value.
567 PROCEDURE SetCheckAll (value: BOOLEAN) : BOOLEAN ;
569 NilChecking := value ;
570 WholeDivChecking := value ;
571 IndexChecking := value ;
572 RangeChecking := value ;
573 ReturnChecking := value ;
574 NilChecking := value ;
575 CaseElseChecking := value ;
576 FloatValueChecking := value ;
577 WholeValueChecking := value ;
583 SetAutoInit - -fauto-init turns on automatic initialization of pointers to NIL.
587 PROCEDURE SetAutoInit (value: BOOLEAN) ;
595 SetUnusedVariableChecking - assigns the UnusedVariableChecking to value.
598 PROCEDURE SetUnusedVariableChecking (value: BOOLEAN) ;
600 UnusedVariableChecking := value
601 END SetUnusedVariableChecking ;
605 SetUnusedParameterChecking - assigns the UnusedParameterChecking to value.
608 PROCEDURE SetUnusedParameterChecking (value: BOOLEAN) ;
610 UnusedParameterChecking := value
611 END SetUnusedParameterChecking ;
615 SetStrictTypeChecking - assigns the StrictTypeChecking flag to value.
618 PROCEDURE SetStrictTypeChecking (value: BOOLEAN) ;
620 StrictTypeChecking := value
621 END SetStrictTypeChecking ;
625 SetVerboseUnbounded - sets the VerboseUnbounded flag to, value.
628 PROCEDURE SetVerboseUnbounded (value: BOOLEAN) : BOOLEAN ;
630 VerboseUnbounded := value ;
632 END SetVerboseUnbounded ;
636 SetQuiet - sets the quiet flag to, value.
639 PROCEDURE SetQuiet (value: BOOLEAN) : BOOLEAN ;
647 SetCpp - enables the source to be preprocessed and enables the
648 recognition of C preprocessor line directives.
651 PROCEDURE SetCpp (value: BOOLEAN) : BOOLEAN ;
653 CPreProcessor := value ;
654 LineDirectives := value ;
660 GetCpp - returns TRUE if the C preprocessor was used.
663 PROCEDURE GetCpp () : BOOLEAN ;
670 SetPPOnly - set the PPonly (preprocess only) to value.
673 PROCEDURE SetPPOnly (value: BOOLEAN) ;
679 GetPPOnly - get the PPonly (preprocess only).
682 PROCEDURE GetPPOnly () : BOOLEAN ;
689 Setc - set the cflag (compile only flag -c) to value.
692 PROCEDURE Setc (value: BOOLEAN) ;
699 Getc - get the cflag (compile only flag -c).
702 PROCEDURE Getc () : BOOLEAN ;
709 SetUselist - set the uselist flag to value and remember the filename.
712 PROCEDURE SetUselist (value: BOOLEAN; filename: ADDRESS) ;
714 UselistFlag := value ;
715 UselistFilename := KillString (UselistFilename) ;
718 UselistFilename := InitStringCharStar (filename)
724 GetUselist - return the uselist flag.
727 PROCEDURE GetUselist () : BOOLEAN ;
734 GetUselistFilename - return the uselist filename as a String.
737 PROCEDURE GetUselistFilename () : String ;
739 RETURN UselistFilename
740 END GetUselistFilename ;
744 SetM2g - set GenerateStatementNote to value and return value.
745 Corresponds to the -fm2-g flag.
748 PROCEDURE SetM2g (value: BOOLEAN) : BOOLEAN ;
750 GenerateStatementNote := value ;
751 RETURN GenerateStatementNote
756 GetM2g - returns TRUE if the -fm2-g flags was used.
759 PROCEDURE GetM2g () : BOOLEAN ;
761 RETURN GenerateStatementNote
766 SetLowerCaseKeywords - set the lower case keyword flag and return the result.
769 PROCEDURE SetLowerCaseKeywords (value: BOOLEAN) : BOOLEAN ;
771 LowerCaseKeywords := value ;
772 RETURN LowerCaseKeywords
773 END SetLowerCaseKeywords ;
777 SetVerbose - set the Verbose flag to, value. It returns TRUE.
780 PROCEDURE SetVerbose (value: BOOLEAN) : BOOLEAN ;
790 PROCEDURE SetMakeall (value: BOOLEAN) : BOOLEAN ;
792 (* value is unused *)
801 PROCEDURE SetMakeall0 (value: BOOLEAN) : BOOLEAN ;
803 (* value is unused *)
812 PROCEDURE SetIncludePath (arg: ADDRESS) : BOOLEAN ;
820 SetUnboundedByReference -
823 PROCEDURE SetUnboundedByReference (value: BOOLEAN) : BOOLEAN ;
825 UnboundedByReference := value ;
827 END SetUnboundedByReference ;
832 SetDebugging - sets the debugging flag to, v.
835 PROCEDURE SetDebugging (value: BOOLEAN) ;
837 GenerateDebugging := value
842 SetProfiling - dummy procedure, as profiling is implemented in the gcc backend.
845 PROCEDURE SetProfiling (value: BOOLEAN) ;
856 PROCEDURE SetISO (value: BOOLEAN) ;
861 (* Pim4 is the default, leave it alone since the DIV and MOD rules are the
870 PROCEDURE SetPIM (value: BOOLEAN) ;
881 PROCEDURE SetPIM2 (value: BOOLEAN) ;
888 (* Pim4 is the default, turn it off. *)
898 PROCEDURE SetPIM3 (value: BOOLEAN) ;
905 (* Pim4 is the default, turn it off. *)
915 PROCEDURE SetPIM4 (value: BOOLEAN) ;
924 SetPositiveModFloor - sets the positive mod floor option.
927 PROCEDURE SetPositiveModFloor (value: BOOLEAN) ;
929 PositiveModFloorDiv := value
930 END SetPositiveModFloor ;
934 SetWholeDiv - sets the whole division flag.
937 PROCEDURE SetWholeDiv (value: BOOLEAN) ;
939 WholeDivChecking := value
944 SetIndex - sets the runtime array index checking flag.
947 PROCEDURE SetIndex (value: BOOLEAN) ;
949 IndexChecking := value
954 SetRange - sets the runtime range checking flag.
957 PROCEDURE SetRange (value: BOOLEAN) ;
959 RangeChecking := value
964 SetExceptions - sets the enable runtime exceptions flag.
967 PROCEDURE SetExceptions (value: BOOLEAN) ;
977 PROCEDURE SetStyle (value: BOOLEAN) ;
979 StyleChecking := value
987 PROCEDURE SetPedantic (value: BOOLEAN) ;
994 SetPedanticParamNames - sets the pedantic parameter name flag.
997 PROCEDURE SetPedanticParamNames (value: BOOLEAN) ;
999 PedanticParamNames := value
1000 END SetPedanticParamNames ;
1004 SetPedanticCast - sets the pedantic cast flag.
1007 PROCEDURE SetPedanticCast (value: BOOLEAN) ;
1009 PedanticCast := value
1010 END SetPedanticCast ;
1014 SetExtendedOpaque - sets the ExtendedOpaque flag.
1017 PROCEDURE SetExtendedOpaque (value: BOOLEAN) ;
1019 ExtendedOpaque := value
1020 END SetExtendedOpaque ;
1024 SetXCode - sets the xcode flag.
1027 PROCEDURE SetXCode (value: BOOLEAN) ;
1037 PROCEDURE SetSwig (value: BOOLEAN) ;
1039 GenerateSwig := value
1044 SetQuadDebugging - display the quadruples (internal debugging).
1047 PROCEDURE SetQuadDebugging (value: BOOLEAN) ;
1049 DisplayQuadruples := value
1050 END SetQuadDebugging ;
1054 SetCompilerDebugging - turn on internal compiler debugging.
1057 PROCEDURE SetCompilerDebugging (value: BOOLEAN) ;
1059 CompilerDebugging := value
1060 END SetCompilerDebugging ;
1067 PROCEDURE SetDebugTraceQuad (value: BOOLEAN) ;
1069 DebugTraceQuad := value
1070 END SetDebugTraceQuad ;
1077 PROCEDURE SetDebugTraceAPI (value: BOOLEAN) ;
1079 DebugTraceAPI := value
1080 END SetDebugTraceAPI ;
1087 PROCEDURE SetSources (value: BOOLEAN) ;
1089 Quiet := NOT value ;
1090 SeenSources := value
1095 SetDumpSystemExports -
1098 PROCEDURE SetDumpSystemExports (value: BOOLEAN) ;
1100 DumpSystemExports := value
1101 END SetDumpSystemExports ;
1108 PROCEDURE SetSearchPath (arg: ADDRESS) ;
1112 s := InitStringCharStar (arg) ;
1113 AddInclude (M2PathName, s) ;
1116 DumpPathName ("path name entries: ")
1123 setdefextension - set the source file definition module extension to arg.
1124 This should include the . and by default it is set to .def.
1127 PROCEDURE setdefextension (arg: ADDRESS) ;
1131 s := InitStringCharStar (arg) ;
1132 SetDefExtension (s) ;
1134 END setdefextension ;
1138 setmodextension - set the source file module extension to arg.
1139 This should include the . and by default it is set to .mod.
1142 PROCEDURE setmodextension (arg: ADDRESS) ;
1146 s := InitStringCharStar (arg) ;
1147 SetModExtension (s) ;
1149 END setmodextension ;
1156 PROCEDURE SetOptimizing (value: CARDINAL) ;
1160 Optimizing := TRUE ;
1161 OptimizeBasicBlock := TRUE ;
1162 OptimizeUncalledProcedures := TRUE ;
1163 OptimizeCommonSubExpressions := TRUE
1165 Optimizing := FALSE ;
1166 OptimizeBasicBlock := FALSE ;
1167 OptimizeUncalledProcedures := FALSE ;
1168 OptimizeCommonSubExpressions := FALSE
1174 SetForcedLocation - sets the location for the lifetime of this compile to, location.
1175 This is primarily an internal debugging switch.
1178 PROCEDURE SetForcedLocation (location: location_t) ;
1180 ForcedLocation := TRUE ;
1181 ForcedLocationValue := location
1182 END SetForcedLocation ;
1186 SetCC1Quiet - sets the cc1quiet flag to, value.
1189 PROCEDURE SetCC1Quiet (value: BOOLEAN) ;
1196 SetStatistics - turn on/off generate of compile time statistics.
1199 PROCEDURE SetStatistics (on: BOOLEAN) ;
1206 OverrideLocation - possibly override the location value, depending upon
1207 whether the -flocation= option was used.
1210 PROCEDURE OverrideLocation (location: location_t) : location_t ;
1214 RETURN( ForcedLocationValue )
1218 END OverrideLocation ;
1222 SetDebugFunctionLineNumbers - turn DebugFunctionLineNumbers on/off
1223 (used internally for debugging).
1226 PROCEDURE SetDebugFunctionLineNumbers (value: BOOLEAN) ;
1228 DebugFunctionLineNumbers := value
1229 END SetDebugFunctionLineNumbers ;
1233 SetGenerateStatementNote - turn on generation of nops if necessary
1234 to generate pedalogical single stepping.
1237 PROCEDURE SetGenerateStatementNote (value: BOOLEAN) ;
1239 GenerateStatementNote := value
1240 END SetGenerateStatementNote ;
1244 GetISO - return TRUE if -fiso was present on the command line.
1247 PROCEDURE GetISO () : BOOLEAN ;
1254 GetPIM - return TRUE if -fpim was present on the command line.
1257 PROCEDURE GetPIM () : BOOLEAN ;
1264 GetPIM2 - return TRUE if -fpim2 was present on the command line.
1267 PROCEDURE GetPIM2 () : BOOLEAN ;
1274 GetPIM3 - return TRUE if -fpim3 was present on the command line.
1277 PROCEDURE GetPIM3 () : BOOLEAN ;
1284 GetPIM4 - return TRUE if -fpim4 was present on the command line.
1287 PROCEDURE GetPIM4 () : BOOLEAN ;
1294 GetPositiveModFloor - return TRUE if -fpositive-mod-floor was present
1295 on the command line.
1298 PROCEDURE GetPositiveModFloor () : BOOLEAN ;
1300 RETURN PositiveModFloorDiv
1301 END GetPositiveModFloor ;
1305 GetFloatValueCheck - return TRUE if -ffloatvalue was present on the
1309 PROCEDURE GetFloatValueCheck () : BOOLEAN ;
1311 RETURN FloatValueChecking
1312 END GetFloatValueCheck ;
1316 SetFloatValueCheck - set depending upon the -ffloatvalue.
1319 PROCEDURE SetFloatValueCheck (value: BOOLEAN) ;
1321 FloatValueChecking := value
1322 END SetFloatValueCheck ;
1326 GetWholeValueCheck - return TRUE if -fwholevalue was present on the
1330 PROCEDURE GetWholeValueCheck () : BOOLEAN ;
1332 RETURN WholeValueChecking
1333 END GetWholeValueCheck ;
1337 SetWholeValueCheck - set depending upon the -fwholevalue.
1340 PROCEDURE SetWholeValueCheck (value: BOOLEAN) ;
1342 WholeValueChecking := value
1343 END SetWholeValueCheck ;
1347 SetWall - set all warnings to, value.
1350 PROCEDURE SetWall (value: BOOLEAN) ;
1352 UnusedVariableChecking := value ;
1353 UnusedParameterChecking := value ;
1354 UninitVariableChecking := value ;
1355 PedanticCast := value ;
1356 PedanticParamNames := value ;
1357 StyleChecking := value ;
1358 CaseEnumChecking := value
1363 SetSaveTemps - turn on/off -save-temps.
1366 PROCEDURE SetSaveTemps (value: BOOLEAN) ;
1373 SetSaveTempsDir - turn on/off -save-temps and specify the directory.
1376 PROCEDURE SetSaveTempsDir (arg: ADDRESS) ;
1378 SaveTempsDir := InitStringCharStar (arg) ;
1380 END SetSaveTempsDir ;
1384 GetSaveTempsDir - return SaveTempsDir or NIL if -save-temps was not used.
1387 PROCEDURE GetSaveTempsDir () : String ;
1390 END GetSaveTempsDir ;
1394 SetDumpDir - Set the dump dir.
1397 PROCEDURE SetDumpDir (arg: ADDRESS) ;
1399 DumpDir := InitStringCharStar (arg)
1404 GetDumpDir - return DumpDir or NIL.
1407 PROCEDURE GetDumpDir () : String ;
1413 SetScaffoldDynamic - set the -fscaffold-dynamic flag.
1416 PROCEDURE SetScaffoldDynamic (value: BOOLEAN) ;
1418 ScaffoldDynamic := value ;
1421 ScaffoldStatic := FALSE
1423 END SetScaffoldDynamic ;
1427 SetScaffoldStatic - set the -fscaffold-static flag.
1430 PROCEDURE SetScaffoldStatic (value: BOOLEAN) ;
1432 ScaffoldStatic := value ;
1435 ScaffoldDynamic := FALSE
1437 END SetScaffoldStatic ;
1441 GetScaffoldDynamic - get the -fscaffold-dynamic flag.
1444 PROCEDURE GetScaffoldDynamic () : BOOLEAN ;
1446 RETURN ScaffoldDynamic
1447 END GetScaffoldDynamic ;
1451 GetScaffoldStatic - get the -fscaffold-static flag.
1454 PROCEDURE GetScaffoldStatic () : BOOLEAN ;
1456 RETURN ScaffoldStatic
1457 END GetScaffoldStatic ;
1461 SetScaffoldMain - set the -fscaffold-main flag.
1464 PROCEDURE SetScaffoldMain (value: BOOLEAN) ;
1466 ScaffoldMain := value
1467 END SetScaffoldMain ;
1471 SetRuntimeModuleOverride - set the override sequence used for module
1472 initialization and finialization.
1475 PROCEDURE SetRuntimeModuleOverride (override: ADDRESS) ;
1477 RuntimeModuleOverride := KillString (RuntimeModuleOverride) ;
1478 RuntimeModuleOverride := InitStringCharStar (override)
1479 END SetRuntimeModuleOverride ;
1483 GetRuntimeModuleOverride - return a string containing any user override
1484 or the default module initialization override
1488 PROCEDURE GetRuntimeModuleOverride () : ADDRESS ;
1490 RETURN string (RuntimeModuleOverride)
1491 END GetRuntimeModuleOverride ;
1495 SetGenModuleList - set the GenModuleList flag to true and pass
1496 set GenModuleListFilename to filename.
1499 PROCEDURE SetGenModuleList (value: BOOLEAN; filename: ADDRESS) ;
1501 GenModuleListFilename := KillString (GenModuleListFilename) ;
1504 GenModuleListFilename := InitStringCharStar (filename)
1506 GenModuleList := value
1507 END SetGenModuleList ;
1511 GetGenModuleFilename - returns the filename set by SetGenModuleList.
1514 PROCEDURE GetGenModuleFilename () : String ;
1516 RETURN GenModuleListFilename
1517 END GetGenModuleFilename ;
1521 SetShared - sets the SharedFlag to value.
1524 PROCEDURE SetShared (value: BOOLEAN) ;
1531 SetUninitVariableChecking - sets the UninitVariableChecking and
1532 UninitVariableConditionalChecking flags to value
1533 depending upon arg string. The arg string
1534 can be: "all", "known,cond", "cond,known", "known"
1538 PROCEDURE SetUninitVariableChecking (value: BOOLEAN; arg: ADDRESS) : INTEGER ;
1546 printf ("SetUninitVariableChecking (TRUE, %s)\n", arg)
1548 printf ("SetUninitVariableChecking (FALSE, %s)\n", arg)
1551 s := InitStringCharStar (arg) ;
1552 IF EqualArray (s, "all") OR
1553 EqualArray (s, "known,cond") OR
1554 EqualArray (s, "cond,known")
1556 UninitVariableChecking := value ;
1557 UninitVariableConditionalChecking := value ;
1558 s := KillString (s) ;
1560 ELSIF EqualArray (s, "known")
1562 UninitVariableChecking := value ;
1563 s := KillString (s) ;
1565 ELSIF EqualArray (s, "cond")
1567 UninitVariableConditionalChecking := value ;
1568 s := KillString (s) ;
1571 s := KillString (s) ;
1574 END SetUninitVariableChecking ;
1578 SetCaseEnumChecking - sets the CaseEnumChecking to value.
1581 PROCEDURE SetCaseEnumChecking (value: BOOLEAN) ;
1583 CaseEnumChecking := value
1584 END SetCaseEnumChecking ;
1588 SetDebugBuiltins - sets the DebugBuiltins to value.
1591 PROCEDURE SetDebugBuiltins (value: BOOLEAN) ;
1593 DebugBuiltins := value
1594 END SetDebugBuiltins ;
1598 cflag := FALSE ; (* -c. *)
1599 RuntimeModuleOverride := InitString (DefaultRuntimeModuleOverride) ;
1600 CppArgs := InitString ('') ;
1605 PositiveModFloorDiv := FALSE ;
1607 SeenSources := FALSE ;
1608 Statistics := FALSE ;
1609 StyleChecking := FALSE ;
1610 CompilerDebugging := FALSE ;
1611 GenerateDebugging := FALSE ;
1612 Optimizing := FALSE ;
1617 Profiling := FALSE ;
1618 DisplayQuadruples := FALSE ;
1619 OptimizeBasicBlock := FALSE ;
1620 OptimizeUncalledProcedures := FALSE ;
1621 OptimizeCommonSubExpressions := FALSE ;
1622 NilChecking := FALSE ;
1623 WholeDivChecking := FALSE ;
1624 WholeValueChecking := FALSE ;
1625 FloatValueChecking := FALSE ;
1626 IndexChecking := FALSE ;
1627 RangeChecking := FALSE ;
1628 ReturnChecking := FALSE ;
1629 CaseElseChecking := FALSE ;
1630 CPreProcessor := FALSE ;
1631 LineDirectives := FALSE ;
1632 ExtendedOpaque := FALSE ;
1633 UnboundedByReference := FALSE ;
1634 VerboseUnbounded := FALSE ;
1635 PedanticParamNames := FALSE ;
1636 PedanticCast := FALSE ;
1638 DumpSystemExports := FALSE ;
1639 GenerateSwig := FALSE ;
1640 Exceptions := TRUE ;
1641 DebugBuiltins := FALSE ;
1642 ForcedLocation := FALSE ;
1643 WholeProgram := FALSE ;
1644 DebugTraceQuad := FALSE ;
1645 DebugTraceAPI := FALSE ;
1646 DebugFunctionLineNumbers := FALSE ;
1647 GenerateStatementNote := FALSE ;
1648 LowerCaseKeywords := FALSE ;
1649 UnusedVariableChecking := FALSE ;
1650 UnusedParameterChecking := FALSE ;
1651 StrictTypeChecking := TRUE ;
1653 SaveTemps := FALSE ;
1654 ScaffoldDynamic := TRUE ;
1655 ScaffoldStatic := FALSE ;
1656 ScaffoldMain := FALSE ;
1657 UselistFilename := NIL ;
1658 GenModuleList := FALSE ;
1659 GenModuleListFilename := NIL ;
1660 SharedFlag := FALSE ;
1666 SaveTempsDir := NIL ;
1668 UninitVariableChecking := FALSE ;
1669 UninitVariableConditionalChecking := FALSE ;
1670 CaseEnumChecking := FALSE ;
1676 M2Prefix := InitString ('') ;
1677 M2PathName := InitString ('')