public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] Alphabetically order options in gm2.texi and lang.opt and purge -fxcode.
@ 2022-12-09 23:54 Gaius Mulley
0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-12-09 23:54 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4487e05a7c45dcdff15da11ec70010af8b7ddd45
commit 4487e05a7c45dcdff15da11ec70010af8b7ddd45
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Fri Dec 9 23:53:46 2022 +0000
Alphabetically order options in gm2.texi and lang.opt and purge -fxcode.
This patch tidies up the options in gm2.texi and ensures that every
implemented option is documented. -fxcode has been removed now that
the modula-2 front end uses gcc error/warning infastructure.
gcc/m2/ChangeLog:
* doc/gm2.texi: Alphabetically sort options.
Add entry for -fwholevalue.
* m2/gm2-lang.cc (gm2_langhook_handle_option)
Comment out OPT_fxcode as it is unimplemented.
* m2/lang.opt: Remove entry for -fxcode. Alphabetically order
remaining options.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diff:
---
gcc/doc/gm2.texi | 171 ++++++++++++++++++++++++++++++++---------------------
gcc/m2/gm2-lang.cc | 7 ++-
gcc/m2/lang.opt | 24 ++++----
3 files changed, 119 insertions(+), 83 deletions(-)
diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi
index eb08ef78ca2..f7910fbfb8b 100644
--- a/gcc/doc/gm2.texi
+++ b/gcc/doc/gm2.texi
@@ -573,6 +573,10 @@ turns on auto initialization of pointers to NIL. Whenever a block is
created all pointers declarated within this scope will have their
addresses assigned to NIL.
+@item -fbounds
+turns on runtime subrange, array index and indirection via @code{NIL}
+pointer checking.
+
@item -fcase
turns on compile time checking to check whether a @code{CASE}
statement requires an @code{ELSE} clause when on was not specified.
@@ -584,11 +588,35 @@ If @samp{-fcpp} is supplied then all definition modules and
implementation modules which are parsed will be preprocessed by
@samp{cpp}.
+@c fcpp-end
+@c Modula-2
+@c passed to the preprocessor if -fcpp is used (internal switch)
+
+@c fcpp-begin
+@c Modula-2
+@c passed to the preprocessor if -fcpp is used (internal switch)
+
@item -fdebug-builtins
call a real function, rather than the builtin equivalent. This can
be useful for debugging parameter values to a builtin function as
it allows users to single step code into a real function.
+@c fd
+@c Modula-2
+@c turn on internal debugging of the compiler (internal switch)
+
+@c fdebug-trace-quad
+@c Modula-2
+@c turn on quadruple tracing (internal switch)
+
+@c fdebug-trace-api
+@c Modula-2
+@c turn on the Modula-2 api tracing (internal switch)
+
+@c fdebug-function-line-numbers
+@c Modula-2
+@c turn on the Modula-2 function line number generation (internal switch)
+
@item -fdef=
recognise the specified suffix as a definition module filename.
The default implmentation and module filename suffix is @file{.def}.
@@ -610,6 +638,10 @@ Modula-2 extension and it requires that the implementation module
defining the opaque type is available so that it can be resolved when
compiling the module which imports the opaque type.
+@item -ffloatvalue
+turns on runtime checking to check whether a floating point number is
+about to exceed range.
+
@item -fgen-module-list=@file{filename}
attempt to find all modules when linking and generate a module list.
If the @file{filename} is @samp{-} then the contents are not written
@@ -641,6 +673,10 @@ the they provide the base modules which all other dialects utilize.
The option @samp{-fno-libs=-} disables the @samp{gm2} driver from
modifying the search and library paths.
+@c flocation=
+@c Modula-2 Joined
+@c set all location values to a specific value (internal switch)
+
@item -fm2-g
improve the debugging experience for new programmers at the expense
of generating @code{nop} instructions if necessary to ensure single
@@ -652,11 +688,17 @@ where multiple @code{END} keywords are mapped onto a sequence of
@item -fm2-lower-case
render keywords in error messages using lower case.
+@item -fm2-plugin
+insert plugin to identify runtime errors at compiletime (default on).
+
@item -fm2-statistics
generates quadruple information: number of quadruples generated,
number of quadruples remaining after optimisation and number of source
lines compiled.
+@item -fm2-strict-type
+experimental flag to turn on the new strict type checker.
+
@item -fm2-whole-program
compile all implementation modules and program module at once. Notice
that you need to take care if you are compiling different dialect
@@ -712,6 +754,10 @@ can be disabled by @samp{-fno-pthread}. GNU Modula-2 uses the GCC
pthread libraries to implement coroutines (see the SYSTEM
implementation module).
+@c -fq
+@c -Modula-2
+@c -internal compiler debugging information, dump the list of quadruples
+
@item -frange
generate code to check the assignment range, return value range
set range and constructor range. Range checking can be disabled
@@ -738,6 +784,12 @@ infastructure when compiling implementation and program modules.
By default this option is on. Use @samp{-fno-scaffold-dynamic}
to turn it off or select @samp{-fno-scaffold-static}.
+@item -fscaffold-c
+generate a C source scaffold for the current module being compiled.
+
+@item -fscaffold-c++
+generate a C++ source scaffold for the current module being compiled.
+
@item -fscaffold-main
force the generation of the @samp{main} function. This is not
necessary if the @samp{-c} is omitted.
@@ -756,7 +808,7 @@ generate a shared library from the module.
turns on all runtime checks. This is the same as invoking
GNU Modula-2 using the command options
@code{-fnil} @code{-frange} @code{-findex}
-@c @code{-fwholevalue} --fixme-- add this when working
+@code{-fwholevalue}
@code{-fwholediv} @code{-fcase} @code{-freturn}.
@item -fsources
@@ -792,72 +844,57 @@ This option cannot be used if @samp{-fgen-module-list=} is enabled.
@item -fwholediv
generate code to detect whole number division by zero or modulus by
-zero. Whole number division checking can be disabled via
-@samp{-fno-wholediv}.
-
-@c @item -fxcode
-@c issues all errors and warnings in the @file{Xcode} format.
-
-@c @item -fwholevalue
-@c generate code to detect whole number overflow and underflow.
-
-@c @item -fno-wholevalue
-@c do not generate code to detect whole number overflow and underflow.
-
-@c @item -frealdiv
-@c generate code to detect real number division by zero.
-
-@c @item -fno-realdiv
-@c do not generate code to detect real number division by zero.
-
-@c @item -frealvalue
-@c generate code to detect @code{NaN}s real number overflow and underflow.
-
-@c @item -fno-realvalue
-@c do not generate code to detect @code{NaN}s real number overflow and underflow.
-
-@item -Wall
-turn on all Modula-2 warnings.
-
-@item -Wpedantic
-forces the compiler to reject nested @code{WITH} statements
-referencing the same record type. Does not allow multiple imports of
-the same item from a module. It also checks that: procedure variables
-are written to before being read; variables are not only written to
-but read from; variables are declared and used. If the compiler
-encounters a variable being read before written it will terminate with
-a message. It will check that @code{FOR} loop indices are not used
-outside the end of this loop without being reset.
-
-@item -Wpedantic-cast
-warns if the ISO system function is used and if the size of
-the variable is different from that of the type. This is legal
-in ISO Modula-2, however it can be dangerous. Some users may prefer
-to use @code{VAL} instead in these situations and use @code{CAST}
-exclusively for changes in type on objects which have the same size.
-
-@item -Wpedantic-param-names
-procedure parameter names are checked in the definition module
-against their implementation module counterpart. This is not
-necessary in ISO or PIM versions of Modula-2.
-
-@item -Wstyle
-checks for poor programming style. This option is aimed at new users of
-Modula-2 in that it checks for situations which might cause confusion
-and thus mistakes. It checks whether variables of the same name are
-declared in different scopes and whether variables look like keywords.
-Experienced users might find this option too aggressive.
-
-@item -Wunused-variable
-warns if a variable has been declared and it not used.
-
-@item -Wunused-parameter
-warns if a parameter has been declared and it not used.
-
-@item -Wverbose-unbounded
-inform the user which non @code{VAR} unbounded parameters will be
-passed by reference. This only produces output if the option
-@samp{-funbounded-by-reference} is also supplied on the command line.
+zero.
+
+@item -fwholevalue
+generate code to detect whole number overflow and underflow.
+
+@c the following warning options are complete but need to be
+@c regression tested against all other front ends
+@c to ensure the options do not conflict.
+
+@c @item -Wall
+@c turn on all Modula-2 warnings.
+
+@c @item -Wpedantic
+@c forces the compiler to reject nested @code{WITH} statements
+@c referencing the same record type. Does not allow multiple imports of
+@c the same item from a module. It also checks that: procedure variables
+@c are written to before being read; variables are not only written to
+@c but read from; variables are declared and used. If the compiler
+@c encounters a variable being read before written it will terminate with
+@c a message. It will check that @code{FOR} loop indices are not used
+@c outside the end of this loop without being reset.
+
+@c @item -Wpedantic-cast
+@c warns if the ISO system function is used and if the size of
+@c the variable is different from that of the type. This is legal
+@c in ISO Modula-2, however it can be dangerous. Some users may prefer
+@c to use @code{VAL} instead in these situations and use @code{CAST}
+@c exclusively for changes in type on objects which have the same size.
+
+@c @item -Wpedantic-param-names
+@c procedure parameter names are checked in the definition module
+@c against their implementation module counterpart. This is not
+@c necessary in ISO or PIM versions of Modula-2.
+
+@c @item -Wstyle
+@c checks for poor programming style. This option is aimed at new users of
+@c Modula-2 in that it checks for situations which might cause confusion
+@c and thus mistakes. It checks whether variables of the same name are
+@c declared in different scopes and whether variables look like keywords.
+@c Experienced users might find this option too aggressive.
+
+@c @item -Wunused-variable
+@c warns if a variable has been declared and it not used.
+
+@c @item -Wunused-parameter
+@c warns if a parameter has been declared and it not used.
+
+@c @item -Wverbose-unbounded
+@c inform the user which non @code{VAR} unbounded parameters will be
+@c passed by reference. This only produces output if the option
+@c @samp{-funbounded-by-reference} is also supplied on the command line.
@end table
diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc
index 4acec02b55c..5814ebf4db6 100644
--- a/gcc/m2/gm2-lang.cc
+++ b/gcc/m2/gm2-lang.cc
@@ -305,9 +305,12 @@ gm2_langhook_handle_option (
case OPT_Wall:
M2Options_SetWall (value);
return 1;
+#if 0
+ /* Not yet implemented. */
case OPT_fxcode:
M2Options_SetXCode (value);
return 1;
+#endif
case OPT_fm2_lower_case:
M2Options_SetLowerCaseKeywords (value);
return 1;
@@ -318,10 +321,10 @@ gm2_langhook_handle_option (
M2Options_SetRuntimeModuleOverride (arg);
return 1;
case OPT_fpthread:
- /* handled in the driver. */
+ /* Handled in the driver. */
return 1;
case OPT_fm2_plugin:
- /* handled in the driver. */
+ /* Handled in the driver. */
return 1;
case OPT_fscaffold_dynamic:
M2Options_SetScaffoldDynamic (value);
diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
index 11b629e94ae..83a5ce7eb30 100644
--- a/gcc/m2/lang.opt
+++ b/gcc/m2/lang.opt
@@ -122,13 +122,9 @@ fdebug-builtins
Modula-2
call a real function, rather than the builtin equivalent
-fdump-system-exports
-Modula-2
-display all inbuilt system items
-
fd
Modula-2
-turn on internal debugging of the compiler
+turn on internal debugging of the compiler (internal switch)
fdebug-trace-quad
Modula-2
@@ -146,6 +142,10 @@ fdef=
Modula-2 Joined
recognise the specified suffix as a definition module filename
+fdump-system-exports
+Modula-2
+display all inbuilt system items
+
fexceptions
Modula-2
; Documented in common.opt
@@ -250,10 +250,6 @@ fruntime-modules=
Modula-2 Joined
specify the list of runtime modules and their initialization order
-fscaffold-static
-Modula-2
-generate static scaffold initialization and finalization for every module inside main
-
fscaffold-dynamic
Modula-2
the modules initialization order is dynamically determined by M2RTS and application dependancies
@@ -270,13 +266,17 @@ fscaffold-main
Modula-2
generate the main function
+fscaffold-static
+Modula-2
+generate static scaffold initialization and finalization for every module inside main
+
fshared
Modula-2
generate a shared library from the module
fsoft-check-all
Modula-2
-turns on all software runtime checking (an abbreviation for -fnil -frange -findex -fwholediv -fcase -freturn -fwholediv -ffloatvalue)
+turns on all software runtime checking (an abbreviation for -fnil -frange -findex -fwholediv -fcase -freturn -fwholevalue -ffloatvalue)
fsources
Modula-2
@@ -306,10 +306,6 @@ fwholevalue
Modula-2
turns on runtime checking to check whether a whole number is about to exceed range
-fxcode
-Modula-2
-issue all errors and warnings in the Xcode format
-
iprefix
Modula-2
; Documented in c.opt
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-09 23:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 23:54 [gcc/devel/modula-2] Alphabetically order options in gm2.texi and lang.opt and purge -fxcode Gaius Mulley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).