]> gcc.gnu.org Git - gcc.git/blob - gcc/m2/gm2-compiler/M2Options.def
Year date changes for Modula-2 source tree.
[gcc.git] / gcc / m2 / gm2-compiler / M2Options.def
1 (* M2Options.def initializes the user options.
2
3 Copyright (C) 2001-2022 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6 This file is part of GNU Modula-2.
7
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.
12
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.
17
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/>. *)
21
22 DEFINITION MODULE M2Options ;
23
24 (*
25 Author : Gaius Mulley
26 Title : M2Options
27 Date : 27/5/87 [$Date: 2013/08/14 20:39:40 $]
28 SYSTEM : UNIX (GNU Modula-2)
29 Description: Initializes the user options in the Modula-2 compiler.
30 Version : $Revision: 1.31 $
31 *)
32
33 FROM SYSTEM IMPORT ADDRESS ;
34 FROM DynamicStrings IMPORT String ;
35 FROM m2linemap IMPORT location_t ;
36
37 EXPORT QUALIFIED SetReturnCheck, SetNilCheck, SetCaseCheck,
38 SetCheckAll, SetVerboseUnbounded, SetQuiet, SetCpp, GetCpp,
39 (* SetMakeall, SetMakeall0, SetIncludePath, *) SetAutoInit,
40 SetUnboundedByReference,
41 SetSearchPath, SetISO, SetPIM, SetPIM2, SetPIM3, SetPIM4,
42 SetPositiveModFloor, SetCompilerDebugging, SetExceptions,
43 SetStudents, SetPedantic, SetPedanticParamNames, SetPedanticCast,
44 SetExtendedOpaque, SetXCode, SetQuadDebugging, SetSources,
45 SetDumpSystemExports,
46 SetSwig, DisplayVersion, SetOptimizing, SetForcedLocation,
47 SetCC1Quiet, SetWholeProgram, SetDebugTraceQuad, SetDebugTraceAPI,
48 SetVerbose, SetM2g, GetM2g,
49 GetISO, GetPIM, GetPIM2, GetPIM3, GetPIM4,
50 GetPositiveModFloor,
51 SetFloatValueCheck, GetFloatValueCheck,
52 SetWholeValueCheck, GetWholeValueCheck,
53 SetLowerCaseKeywords,
54 SetIndex, SetRange, SetWholeDiv, SetStrictTypeChecking,
55
56 Iso, Pim, Pim2, Pim3, Pim4,
57 PositiveModFloorDiv,
58 Pedantic, Verbose, Statistics,
59 UnboundedByReference, VerboseUnbounded,
60 Profiling, Coding, Optimizing,
61 OptimizeBasicBlock, OptimizeUncalledProcedures,
62 OptimizeCommonSubExpressions,
63 StudentChecking, WholeProgram,
64 NilChecking,
65 WholeDivChecking, WholeValueChecking,
66 IndexChecking, RangeChecking,
67 ReturnChecking, CaseElseChecking,
68 AutoInit,
69 VariantValueChecking,
70 UnusedVariableChecking, UnusedParameterChecking,
71 SetUnusedVariableChecking, SetUnusedParameterChecking,
72 Quiet, LineDirectives, StrictTypeChecking,
73 CPreProcessor, Xcode, ExtendedOpaque,
74 LowerCaseKeywords,
75 PedanticParamNames, PedanticCast,
76 DisplayQuadruples, DebugTraceQuad, DebugTraceAPI,
77 CompilerDebugging, GenerateDebugging, GenerateLineDebug,
78 DumpSystemExports, GenerateSwig, Exceptions,
79 OverrideLocation, FinaliseOptions,
80 DebugBuiltins, setdefextension, setmodextension,
81 SetStatistics, SetWall, SetSaveTemps, SetSaveTempsDir,
82 SaveTemps,
83 CppProg, CppArg, CppCommandLine, CppRemember,
84 SetDebugFunctionLineNumbers, DebugFunctionLineNumbers,
85 SetGenerateStatementNote, GenerateStatementNote ;
86
87
88 VAR
89 Iso, (* -fiso use ISO SYSTEM.def *)
90 Pim, (* -fpim use PIM [234] SYSTEM.def *)
91 Pim2, (* -fpim2 use strict rules. *)
92 Pim3, (* -fpim3 use strict rules. *)
93 Pim4, (* -fpim4 use strict rules. *)
94 PositiveModFloorDiv, (* force PIM4 behaviour for DIV and MOD *)
95 CompilerDebugging, (* -fd internal debugging messages *)
96 DebugTraceQuad, (* -fdebug-trace-quad *)
97 DebugTraceAPI, (* -fdebug-trace-api *)
98 GenerateDebugging, (* -g option to generate info for gdb/dbx *)
99 GenerateLineDebug, (* -gline to generate line debugging. *)
100 Verbose, (* -verbose produce verbose error messages. *)
101 Pedantic, (* -pedantic be pedantic on error checking. *)
102 PedanticParamNames, (* -Wpedantic-param-names *)
103 PedanticCast, (* -Wpedantic-cast warns if sizes differ. *)
104 Statistics, (* -fstatistics information about code *)
105 StudentChecking, (* -Wstudents checks for common student errs*)
106 DisplayQuadruples, (* -Wq option will display quadruples. *)
107 UnboundedByReference, (* -funbounded-by-reference *)
108 VerboseUnbounded, (* -Wverbose-unbounded *)
109 OptimizeUncalledProcedures, (* -Ouncalled removes uncalled procedures *)
110 OptimizeBasicBlock, (* -Obb create basic blocks and optimize. *)
111 OptimizeCommonSubExpressions, (* -Ocse optimize common subexpressions *)
112 WholeProgram, (* -fwhole-program optimization. *)
113 NilChecking, (* -fnil makes compiler test for pointer *)
114 (* NIL *)
115 WholeDivChecking, (* -fwholediv produces code to raise an *)
116 (* exception if a whole number divide by *)
117 (* zero occurs. *)
118 WholeValueChecking, (* -fwholevalue produces code to raise an *)
119 (* exception if a whole value variable is *)
120 (* about to exceed the type limits. *)
121 FloatValueChecking, (* -ffloatvalue produces code to raise an *)
122 (* exception if a floating point variable *)
123 (* is about to exceed the type limits. *)
124 IndexChecking, (* -findex array bounds checking. *)
125 RangeChecking, (* -frange assignment, set values, *)
126 (* constructor values in range. *)
127 ReturnChecking, (* -freturn checks that functions always *)
128 (* exit with a RETURN statement. *)
129 CaseElseChecking, (* -fcase checks program does not need an *)
130 (* else statement within an case statement *)
131 (* when the user omits one *)
132 VariantValueChecking, (* should we check all values are present *)
133 (* in a variant record? True for ISO and *)
134 (* false for PIM. *)
135 Quiet, (* -fquiet option specified. *)
136 LineDirectives, (* should compiler understand preprocessor *)
137 (* # linenumber "filename" markers? *)
138 StrictTypeChecking, (* -fm2-strict-type experimental checker. *)
139 CPreProcessor, (* must we run the cpp on the source? *)
140 Xcode, (* should errors follow Xcode format? *)
141 ExtendedOpaque, (* do we allow non pointer opaque types? *)
142 DumpSystemExports, (* print all inbuilt system items? *)
143 GenerateSwig, (* should we generate a swig interface file?*)
144 Exceptions, (* should we generate exception code? *)
145 UnusedVariableChecking, (* should we warn about unused variables? *)
146 UnusedParameterChecking, (* should we warn about unused parameters? *)
147 LowerCaseKeywords, (* should keywords in errors be in lower? *)
148 DebugBuiltins, (* should we always call a real function? *)
149 AutoInit, (* -fauto-init assigns pointers to NIL. *)
150 SaveTemps, (* -save-temps save all temporary files. *)
151 ForcedLocation,
152 DebugFunctionLineNumbers,
153 GenerateStatementNote,
154 Optimizing,
155 Coding,
156 Profiling : BOOLEAN ;
157
158
159 (*
160 DisplayVersion - displays the version of the compiler.
161 *)
162
163 PROCEDURE DisplayVersion (mustExit: BOOLEAN) ;
164
165
166 (*
167 SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
168 *)
169
170 PROCEDURE SetWholeProgram (value: BOOLEAN) ;
171
172
173 (*
174 SetAutoInit - set the auto initialization flag to value. If the value
175 is true then all pointers are automatically
176 initialized to NIL.
177 *)
178
179 PROCEDURE SetAutoInit (value: BOOLEAN) : BOOLEAN ;
180
181
182 (*
183 SetReturnCheck - set return statement checking in procedure functions
184 to value.
185 *)
186
187 PROCEDURE SetReturnCheck (value: BOOLEAN) : BOOLEAN ;
188
189
190 (*
191 SetNilCheck - set access through NIL violation runtime checking to value.
192 *)
193
194 PROCEDURE SetNilCheck (value: BOOLEAN) : BOOLEAN ;
195
196
197 (*
198 SetCaseCheck - set else case checking to, value.
199 *)
200
201 PROCEDURE SetCaseCheck (value: BOOLEAN) : BOOLEAN ;
202
203
204 (*
205 SetCheckAll - set all runtime checking to, value.
206 *)
207
208 PROCEDURE SetCheckAll (value: BOOLEAN) : BOOLEAN ;
209
210
211 (*
212 SetVerboseUnbounded - sets the VerboseUnbounded flag to, value.
213 *)
214
215 PROCEDURE SetVerboseUnbounded (value: BOOLEAN) : BOOLEAN ;
216
217
218 (*
219 SetQuiet - sets the quiet flag to, value.
220 *)
221
222 PROCEDURE SetQuiet (value: BOOLEAN) : BOOLEAN ;
223
224
225 (*
226 SetCC1Quiet - sets the cc1quiet flag to, value.
227 *)
228
229 PROCEDURE SetCC1Quiet (value: BOOLEAN) ;
230
231
232 (*
233 SetCpp -
234 *)
235
236 PROCEDURE SetCpp (value: BOOLEAN) : BOOLEAN ;
237
238
239 (*
240 GetCpp - returns TRUE if the C preprocessor was used.
241 *)
242
243 PROCEDURE GetCpp () : BOOLEAN ;
244
245
246 (*
247 SetM2g - set the -fm2-g flag.
248 *)
249
250 PROCEDURE SetM2g (value: BOOLEAN) : BOOLEAN ;
251
252
253 (*
254 GetM2g - returns TRUE if the -fm2-g flags was used.
255 *)
256
257 PROCEDURE GetM2g () : BOOLEAN ;
258
259
260 (*
261 SetLowerCaseKeywords - set the lower case keyword flag and return the result.
262 *)
263
264 PROCEDURE SetLowerCaseKeywords (value: BOOLEAN) : BOOLEAN ;
265
266
267 (*
268 SetMakeall -
269
270 PROCEDURE SetMakeall (value: BOOLEAN) : BOOLEAN ;
271 *)
272
273
274 (*
275 SetMakeall0 -
276
277 PROCEDURE SetMakeall0 (value: BOOLEAN) : BOOLEAN ;
278 *)
279
280
281 (*
282 SetIncludePath -
283
284 PROCEDURE SetIncludePath (arg: ADDRESS) : BOOLEAN ;
285 *)
286
287
288 (*
289 SetUnboundedByReference -
290 *)
291
292 PROCEDURE SetUnboundedByReference (value: BOOLEAN) : BOOLEAN ;
293
294
295 (*
296 SetSearchPath -
297 *)
298
299 PROCEDURE SetSearchPath (arg: ADDRESS) ;
300
301
302 (*
303 SetISO -
304 *)
305
306 PROCEDURE SetISO (value: BOOLEAN) ;
307
308
309 (*
310 SetPIM -
311 *)
312
313 PROCEDURE SetPIM (value: BOOLEAN) ;
314
315
316 (*
317 SetPIM2 -
318 *)
319
320 PROCEDURE SetPIM2 (value: BOOLEAN) ;
321
322
323 (*
324 SetPIM3 -
325 *)
326
327 PROCEDURE SetPIM3 (value: BOOLEAN) ;
328
329
330 (*
331 SetPIM4 -
332 *)
333
334 PROCEDURE SetPIM4 (value: BOOLEAN) ;
335
336
337 (*
338 SetPositiveModFloor -
339 *)
340
341 PROCEDURE SetPositiveModFloor (value: BOOLEAN) ;
342
343
344 (*
345 SetWholeDiv - sets the whole division flag.
346 *)
347
348 PROCEDURE SetWholeDiv (value: BOOLEAN) ;
349
350
351 (*
352 SetIndex - sets the runtime array index checking flag.
353 *)
354
355 PROCEDURE SetIndex (value: BOOLEAN) ;
356
357
358 (*
359 SetRange - sets the runtime range checking flag.
360 *)
361
362 PROCEDURE SetRange (value: BOOLEAN) ;
363
364
365 (*
366 SetExceptions -
367 *)
368
369 PROCEDURE SetExceptions (value: BOOLEAN) ;
370
371
372 (*
373 SetStudents -
374 *)
375
376 PROCEDURE SetStudents (value: BOOLEAN) ;
377
378
379 (*
380 SetPedantic -
381 *)
382
383 PROCEDURE SetPedantic (value: BOOLEAN) ;
384
385
386 (*
387 SetPedanticParamNames -
388 *)
389
390 PROCEDURE SetPedanticParamNames (value: BOOLEAN) ;
391
392
393 (*
394 SetPedanticCast -
395 *)
396
397 PROCEDURE SetPedanticCast (value: BOOLEAN) ;
398
399
400 (*
401 SetExtendedOpaque -
402 *)
403
404 PROCEDURE SetExtendedOpaque (value: BOOLEAN) ;
405
406
407 (*
408 SetXCode -
409 *)
410
411 PROCEDURE SetXCode (value: BOOLEAN) ;
412
413
414 (*
415 SetCompilerDebugging - turn on internal compiler debugging.
416 *)
417
418 PROCEDURE SetCompilerDebugging (value: BOOLEAN) ;
419
420
421 (*
422 SetQuadDebugging - display the quadruples (internal debugging).
423 *)
424
425 PROCEDURE SetQuadDebugging (value: BOOLEAN) ;
426
427
428 (*
429 SetDebugTraceQuad -
430 *)
431
432 PROCEDURE SetDebugTraceQuad (value: BOOLEAN) ;
433
434
435 (*
436 SetDebugTraceAPI -
437 *)
438
439 PROCEDURE SetDebugTraceAPI (value: BOOLEAN) ;
440
441
442 (*
443 SetDebugFunctionLineNumbers - turn DebugFunctionLineNumbers on/off
444 (used internally for debugging).
445 *)
446
447 PROCEDURE SetDebugFunctionLineNumbers (value: BOOLEAN) ;
448
449
450 (*
451 SetGenerateStatementNote - turn on generation of nops if necessary
452 to generate pedalogical single stepping.
453 *)
454
455 PROCEDURE SetGenerateStatementNote (value: BOOLEAN) ;
456
457
458 (*
459 SetSources -
460 *)
461
462 PROCEDURE SetSources (value: BOOLEAN) ;
463
464
465 (*
466 SetDumpSystemExports -
467 *)
468
469 PROCEDURE SetDumpSystemExports (value: BOOLEAN) ;
470
471
472 (*
473 SetSwig -
474 *)
475
476 PROCEDURE SetSwig (value: BOOLEAN) ;
477
478
479 (*
480 SetOptimizing -
481 *)
482
483 PROCEDURE SetOptimizing (value: CARDINAL) ;
484
485
486 (*
487 OverrideLocation - possibly override the location value, depending upon
488 whether the -flocation= option was used.
489 *)
490
491 PROCEDURE OverrideLocation (location: location_t) : location_t ;
492
493
494 (*
495 SetForcedLocation - sets the location for the lifetime of this compile to, location.
496 This is primarily an internal debugging switch.
497 *)
498
499 PROCEDURE SetForcedLocation (location: location_t) ;
500
501
502 (*
503 SetUnusedVariableChecking - assigns the UnusedVariableChecking to value.
504 *)
505
506 PROCEDURE SetUnusedVariableChecking (value: BOOLEAN) ;
507
508
509 (*
510 SetUnusedParameterChecking - assigns the UnusedParameterChecking to value.
511 *)
512
513 PROCEDURE SetUnusedParameterChecking (value: BOOLEAN) ;
514
515
516 (*
517 SetStrictTypeChecking - assigns the StrictTypeChecking flag to value.
518 *)
519
520 PROCEDURE SetStrictTypeChecking (value: BOOLEAN) ;
521
522
523 (*
524 setdefextension -
525 *)
526
527 PROCEDURE setdefextension (arg: ADDRESS) ;
528
529
530 (*
531 setmodextension -
532 *)
533
534 PROCEDURE setmodextension (arg: ADDRESS) ;
535
536
537 (*
538 SetStatistics - turn on/off generate of compile time statistics.
539 *)
540
541 PROCEDURE SetStatistics (on: BOOLEAN) ;
542
543
544 (*
545 SetVerbose - set the Verbose flag to, value. It returns TRUE.
546 *)
547
548 PROCEDURE SetVerbose (value: BOOLEAN) : BOOLEAN ;
549
550
551 (*
552 CppProg - sets the cpp program to be, program.
553 *)
554
555 PROCEDURE CppProg (program: ADDRESS) ;
556
557
558 (*
559 CppArg - sets the option and arg in the cpp command line.
560 *)
561
562 PROCEDURE CppArg (opt, arg: ADDRESS; joined: BOOLEAN) ;
563
564
565 (*
566 CppCommandLine - returns the Cpp command line and all arguments.
567 *)
568
569 PROCEDURE CppCommandLine () : String ;
570
571
572 (*
573 CppRemember - remember a string, s, as a cpp related argument.
574 The string, s, is not garbage collected.
575 *)
576
577 PROCEDURE CppRemember (s: String) ;
578
579
580 (*
581 GetISO - return TRUE if -fiso was present on the command line.
582 *)
583
584 PROCEDURE GetISO () : BOOLEAN ;
585
586
587 (*
588 GetPIM - return TRUE if -fpim was present on the command line.
589 *)
590
591 PROCEDURE GetPIM () : BOOLEAN ;
592
593
594 (*
595 GetPIM2 - return TRUE if -fpim2 was present on the command line.
596 *)
597
598 PROCEDURE GetPIM2 () : BOOLEAN ;
599
600
601 (*
602 GetPIM3 - return TRUE if -fpim3 was present on the command line.
603 *)
604
605 PROCEDURE GetPIM3 () : BOOLEAN ;
606
607
608 (*
609 GetPIM4 - return TRUE if -fpim4 was present on the command line.
610 *)
611
612 PROCEDURE GetPIM4 () : BOOLEAN ;
613
614
615 (*
616 GetPositiveModFloor - return TRUE if -fpositive-mod-floor was present
617 on the command line.
618 *)
619
620 PROCEDURE GetPositiveModFloor () : BOOLEAN ;
621
622
623 (*
624 GetFloatValueCheck - return TRUE if -ffloatvalue was present on the
625 command line.
626 *)
627
628 PROCEDURE GetFloatValueCheck () : BOOLEAN ;
629
630
631 (*
632 SetFloatValueCheck - set depending upon the -ffloatvalue.
633 *)
634
635 PROCEDURE SetFloatValueCheck (value: BOOLEAN) ;
636
637
638 (*
639 GetWholeValueCheck - return TRUE if -fwholevalue was present on the
640 command line.
641 *)
642
643 PROCEDURE GetWholeValueCheck () : BOOLEAN ;
644
645
646 (*
647 SetWholeValueCheck - set depending upon the -fwholevalue.
648 *)
649
650 PROCEDURE SetWholeValueCheck (value: BOOLEAN) ;
651
652
653 (*
654 SetWall - set all warnings to, value.
655 *)
656
657 PROCEDURE SetWall (value: BOOLEAN) ;
658
659
660 (*
661 SetSaveTemps - turn on/off -save-temps.
662 *)
663
664 PROCEDURE SetSaveTemps (value: BOOLEAN) ;
665
666
667 (*
668 SetSaveTempsDir - turn on/off -save-temps specifying the
669 directory.
670 *)
671
672 PROCEDURE SetSaveTempsDir (arg: ADDRESS) ;
673
674
675 (*
676 FinaliseOptions - once all options have been parsed we set any inferred
677 values.
678 *)
679
680 PROCEDURE FinaliseOptions ;
681
682
683 END M2Options.
This page took 0.071008 seconds and 5 git commands to generate.