[gcc/devel/modula-2] Remove m2-version and -version processing in gm2.

Gaius Mulley gaius@gcc.gnu.org
Fri Oct 7 18:43:27 GMT 2022


https://gcc.gnu.org/g:2cd0f1de97a22c9eff85b88f6fb4a7cae64f2a9f

commit 2cd0f1de97a22c9eff85b88f6fb4a7cae64f2a9f
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Fri Oct 7 19:41:09 2022 +0100

    Remove m2-version and -version processing in gm2.
    
    This patch removes the m2-version option and removes -version
    processing from the gm2 driver.  The patch removes various small
    scripts which propagate the option into c/cp/m2 and texi files.
    
    gcc/ChangeLog:
    
            * doc/gm2.texi (m2/version.texi): Include removed.  References
            made to version-GM2 and version-GCC removed.
    
    gcc/m2/ChangeLog:
    
            * m2/Make-lang.in: Remove references to m2/version.texi,
            gm2version.c, M2Version.o, M2Version.c, makeversion and
            M2Version.mod.
            * gm2-compiler/M2Options.def (DisplayVersion): Removed.
            * gm2-compiler/M2Options.mod (DisplayVersion): Removed.
            * gm2-gcc/init.cc (_M2_M2Version_init): Removed.
            * gm2-lang.cc: Remove case clause for OPT_fm2_version
            and OPT_version.  (gm2version.h) Remove include.
            * gm2spec.cc (gm2version.h) Remove include.
            * lang.opt: Remove -fm2-version and -version.
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 gcc/doc/gm2.texi                  |  6 +----
 gcc/m2/Make-lang.in               | 48 ++++-----------------------------------
 gcc/m2/gm2-compiler/M2Options.def |  9 +-------
 gcc/m2/gm2-compiler/M2Options.mod | 27 ----------------------
 gcc/m2/gm2-gcc/init.cc            |  2 --
 gcc/m2/gm2-gcc/m2options.h        |  1 -
 gcc/m2/gm2-lang.cc                |  7 ------
 gcc/m2/gm2spec.cc                 |  7 ------
 gcc/m2/lang.opt                   |  8 -------
 9 files changed, 6 insertions(+), 109 deletions(-)

diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi
index 1ae2fcd2c28..897de6ead10 100644
--- a/gcc/doc/gm2.texi
+++ b/gcc/doc/gm2.texi
@@ -10,7 +10,6 @@
 @setfilename gm2.info
 @settitle The GNU Modula-2 Compiler
 
-@include m2/version.texi
 @set version-python  3.5
 
 @include gcc-common.texi
@@ -484,10 +483,7 @@ available}.
 @end menu
 
 This document contains the user and design issues relevant to the
-Modula-2 front end to gcc.  Throughout this document the GNU Modula-2
-front end is often referred to as @samp{gm2-@value{version-GM2}} or
-@samp{gm2} for short.  This corresponds to GCC version
-@value{version-GCC} and GNU Modula-2 version @value{version-GM2}.
+Modula-2 front end to gcc.
 
 @node Example usage, Compiler options, Using, Using
 @section Example compile and link
diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index 775c7059979..f785834029e 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -40,8 +40,7 @@ TEXISRC = $(objdir)/m2/images/gnu.eps \
           m2/gm2-ebnf.texi \
           m2/SYSTEM-pim.texi \
           m2/SYSTEM-iso.texi \
-          m2/Builtins.texi \
-          m2/version.texi
+          m2/Builtins.texi
 
 # Define the names for selecting modula-2 in LANGUAGES.
 m2 modula-2 modula2: gm2$(exeext) xgcc$(exeext) cc1gm2$(exeext) \
@@ -71,24 +70,10 @@ m2/gm2spec.o: $(srcdir)/m2/gm2spec.cc $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \
                 -DPREFIX=\"$(prefix)\" \
                 -c $(srcdir)/m2/gm2spec.cc $(OUTPUT_OPTION))
 
-m2/gm2version.c: gm2version-check; @true
-
-gm2version-check:
-	$(SHELL) $(srcdir)/m2/tools-src/makeversion -p $(srcdir) m2
-	$(STAMP) gm2version-check
-
-gm2version.o: m2/gm2version.c
-	(SHLIB_LINK='$(SHLIB_LINK)' \
-	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
-		-DLIBSUBDIR=\"$(libsubdir)\" \
-		$(INCLUDES) m2/gm2version.c $(OUTPUT_OPTION))
-
 # Create the compiler driver for M2.
 CFLAGS-m2/m2/gm2spec.o += $(DRIVER_DEFINES)
 
-GM2_OBJS = $(GCC_OBJS) m2/gm2version.o \
-    prefix.o intl.o m2/gm2spec.o
+GM2_OBJS = $(GCC_OBJS) prefix.o intl.o m2/gm2spec.o
 
 # Create the compiler driver for gm2.
 gm2$(exeext): $(GM2_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS) \
@@ -182,12 +167,6 @@ Builtins.texi-check:  m2/gm2-libs/Builtins.def
 	python3 $(srcdir)/m2/tools-src/def2texi.py -b./ -f$(srcdir)/m2/gm2-libs/Builtins.def > $(objdir)/m2/Builtins.texi
 	$(STAMP) Builtins.texi-check
 
-m2/version.texi: gm2-version.texi-check; @true
-
-gm2-version.texi-check:
-	$(SHELL) $(srcdir)/m2/tools-src/makeversion -t $(srcdir) m2
-	$(STAMP) gm2-version.texi-check
-
 $(objdir)/m2/gm2-compiler-boot:
 	test -d $@ || mkdir $@
 
@@ -669,7 +648,6 @@ GM2-COMP-BOOT-DEFS = \
    M2Students.def \
    M2Swig.def \
    M2System.def \
-   M2Version.def \
    NameKey.def \
    ObjectFiles.def \
    Output.def \
@@ -944,7 +922,6 @@ GM2-COMP-DEFS = \
    M2Students.def \
    M2Swig.def \
    M2System.def \
-   M2Version.def \
    NameKey.def \
    ObjectFiles.def \
    P0SymBuild.def \
@@ -1057,8 +1034,7 @@ BUILD-COMPILER-BOOT = $(BUILD-COMPILER-BOOT-H) \
                       $(GM2-COMP-BOOT-DEFS:%.def=m2/gm2-compiler-boot/$(SRC_PREFIX)%.h) \
                       $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
                       $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
-                      m2/gm2-compiler-boot/m2flex.o \
-                      m2/gm2-compiler-boot/M2Version.o
+                      m2/gm2-compiler-boot/m2flex.o
 
 BUILD-BOOT-H = m2/boot-bin/mc$(exeext) \
                $(BUILD-LIBS-BOOT-H) $(BUILD-COMPILER-BOOT-H) $(TARGET_H) $(PLUGIN_HEADERS)
@@ -1385,16 +1361,6 @@ m2/gm2-compiler/m2flex.c: $(srcdir)/m2/m2.flex $(TIMEVAR_H) insn-attr-common.h
 m2/gm2-libiberty/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libiberty/%.def $(MCDEPS)
 	$(MC) -o=$@ $(srcdir)/m2/gm2-libiberty/$*.def
 
-m2/gm2-compiler-boot/M2Version.o: m2/gm2-compiler-boot/M2Version.mod $(MCDEPS) $(BUILD-BOOT-H)
-	$(MC) -o=m2/gm2-compiler-boot/M2Version.c $<
-	$(COMPILER) -c $(ALL_CPPFLAGS) $(GM2GCC) -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -Im2/gm2-libiberty $(INCLUDES) m2/gm2-compiler-boot/M2Version.c -o $@
-
-m2/gm2-compiler-boot/M2Version.mod: M2Version-check; @true
-
-M2Version-check:
-	$(SHELL) $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler-boot
-	$(STAMP) M2Version-check
-
 # The rules to build objects in gm2-compiler and gm2-libs directories.
 
 m2/gm2-compiler/%.o: $(srcdir)/m2/gm2-compiler/%.mod
@@ -1407,9 +1373,6 @@ m2/gm2-compiler/m2flex.o: m2/gm2-compiler/m2flex.c m2/gm2-libs/gm2-libs-host.h $
 m2/gm2-compiler/%.o: m2/gm2-compiler/%.mod
 	$(GM2_1) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
 
-m2/gm2-compiler/M2Version.mod:
-	$(SHELL) $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler
-
 m2/gm2-libs-iso/%.o: $(srcdir)/m2/gm2-libs-iso/%.c m2/gm2-libs/gm2-libs-host.h
 	$(CXX) -DBUILD_GM2_LIBS_TARGET -DBUILD_GM2_LIBS -c $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
 
@@ -1483,12 +1446,10 @@ $(objdir)/m2/gm2-libs-coroutines/SYSTEM.def: $(GM2_PROG_DEP)
 
 build-compiler: $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \
                 $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o) \
-                m2/gm2-compiler/M2Version.o \
                 m2/gm2-compiler/m2flex.o
 
 m2/gm2-compiler/gm2.a: build-compiler gm2$(exeext)
 	$(AR_FOR_TARGET) cr $@ $(GM2-COMP-MODS:%.mod=m2/gm2-compiler/%.o) \
-                    m2/gm2-compiler/M2Version.o \
                     $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler/%.o)
 	$(RANLIB) $@
 
@@ -1501,8 +1462,7 @@ m2/gm2-libs-boot/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-BOOT)
 m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext) m2/boot-bin/mklink$(exeext) \
                          $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT)
 	$(AR) cr $@ $(GM2-COMP-BOOT-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
-                    $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o) \
-                    m2/gm2-compiler-boot/M2Version.o
+                    $(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-boot/%.o)
 	$(RANLIB) $@
 
 m2/gm2-compiler-boot/gm2.a: m2/boot-bin/mc$(exeext)
diff --git a/gcc/m2/gm2-compiler/M2Options.def b/gcc/m2/gm2-compiler/M2Options.def
index e381d5e9015..7e0ea4cdefa 100644
--- a/gcc/m2/gm2-compiler/M2Options.def
+++ b/gcc/m2/gm2-compiler/M2Options.def
@@ -43,7 +43,7 @@ EXPORT QUALIFIED SetReturnCheck, SetNilCheck, SetCaseCheck,
                  SetStyle, SetPedantic, SetPedanticParamNames, SetPedanticCast,
                  SetExtendedOpaque, SetXCode, SetQuadDebugging, SetSources,
                  SetDumpSystemExports,
-                 SetSwig, DisplayVersion, SetOptimizing, SetForcedLocation,
+                 SetSwig, SetOptimizing, SetForcedLocation,
                  SetCC1Quiet, SetWholeProgram, SetDebugTraceQuad, SetDebugTraceAPI,
                  SetVerbose, SetM2g, GetM2g,
 		 GetISO, GetPIM, GetPIM2, GetPIM3, GetPIM4,
@@ -175,13 +175,6 @@ VAR
    Profiling               : BOOLEAN ;
 
 
-(*
-   DisplayVersion - displays the version of the compiler.
-*)
-
-PROCEDURE DisplayVersion (mustExit: BOOLEAN) ;
-
-
 (*
    Setc - set the cflag (compile only flag -c) to value.
 *)
diff --git a/gcc/m2/gm2-compiler/M2Options.mod b/gcc/m2/gm2-compiler/M2Options.mod
index ec5f47a7db9..5e2eb570f24 100644
--- a/gcc/m2/gm2-compiler/M2Options.mod
+++ b/gcc/m2/gm2-compiler/M2Options.mod
@@ -25,7 +25,6 @@ IMPLEMENTATION MODULE M2Options ;
 IMPORT CmdArgs ;
 FROM SArgs IMPORT GetArg, Narg ;
 FROM M2Search IMPORT PrependSearchPath, SetDefExtension, SetModExtension ;
-FROM M2Version IMPORT GetGM2Version, GetGM2Date, GetGCCVersion, GetYear ;
 FROM M2Printf IMPORT printf0, printf1 ;
 FROM libc IMPORT exit ;
 FROM Debug IMPORT Halt ;
@@ -131,32 +130,6 @@ BEGIN
 END GetB ;
 
 
-(*
-   DisplayVersion - displays the version of the compiler.
-*)
-
-PROCEDURE DisplayVersion (mustExit: BOOLEAN) ;
-VAR
-   s: String ;
-BEGIN
-   s := Mark(GetGM2Version()) ;
-   printf1('GNU Modula-2  %s', s) ;
-   s := Mark(GetGM2Date()) ;
-   printf1('  (%s)\n', s) ;
-   s := Mark(GetGCCVersion()) ;
-   printf1('  grafted onto GCC %s\n', s) ;
-   s := Mark(GetYear()) ;
-   printf1('Copyright (C) %s Free Software Foundation, Inc.\n', s) ;
-   printf0('License GPLv2: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n') ;
-   printf0('This is free software: you are free to change and redistribute it.\n') ;
-   printf0('There is NO WARRANTY, to the extent permitted by law.\n') ;
-   IF mustExit
-   THEN
-      exit(0)
-   END
-END DisplayVersion ;
-
-
 (*
    CppCommandLine - returns the Cpp command line and all arguments.
                     NIL is returned if the -fcpp is absent.
diff --git a/gcc/m2/gm2-gcc/init.cc b/gcc/m2/gm2-gcc/init.cc
index 74c04a2d1ac..3453a477412 100644
--- a/gcc/m2/gm2-gcc/init.cc
+++ b/gcc/m2/gm2-gcc/init.cc
@@ -85,7 +85,6 @@ EXTERN void _M2_M2Pass_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_M2Code_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_M2AsmUtil_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_M2FileName_init (int argc, char *argv[], char *envp[]);
-EXTERN void _M2_M2Version_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_M2Students_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_StrCase_init (int argc, char *argv[], char *envp[]);
 EXTERN void _M2_SymbolConversion_init (int argc, char *argv[], char *envp[]);
@@ -182,7 +181,6 @@ init_PerCompilationInit (const char *filename)
   _M2_M2Code_init (0, NULL, NULL);
   _M2_M2AsmUtil_init (0, NULL, NULL);
   _M2_M2FileName_init (0, NULL, NULL);
-  _M2_M2Version_init (0, NULL, NULL);
   _M2_M2Students_init (0, NULL, NULL);
   _M2_StrCase_init (0, NULL, NULL);
   _M2_SymbolConversion_init (0, NULL, NULL);
diff --git a/gcc/m2/gm2-gcc/m2options.h b/gcc/m2/gm2-gcc/m2options.h
index bcf60eeb145..4b32c911b09 100644
--- a/gcc/m2/gm2-gcc/m2options.h
+++ b/gcc/m2/gm2-gcc/m2options.h
@@ -113,7 +113,6 @@ EXTERN void M2Options_SetWall (int value);
 EXTERN void M2Options_SetSaveTemps (int value);
 EXTERN void M2Options_SetSaveTempsDir (const char *arg);
 EXTERN int M2Options_GetSaveTemps (void);
-EXTERN void M2Options_DisplayVersion (int mustExit);
 EXTERN void M2Options_SetScaffoldStatic (int value);
 EXTERN void M2Options_SetScaffoldDynamic (int value);
 EXTERN void M2Options_SetScaffoldMain (int value);
diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc
index 0d6dd8a8afa..1a8c0673474 100644
--- a/gcc/m2/gm2-lang.cc
+++ b/gcc/m2/gm2-lang.cc
@@ -34,7 +34,6 @@ Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "m2block.h"
 #include "dynamicstrings.h"
 #include "m2options.h"
-#include "gm2version.h"
 #include "m2convert.h"
 #include "m2linemap.h"
 #include "init.h"
@@ -385,12 +384,6 @@ gm2_langhook_handle_option (
     case OPT_fm2_g:
       M2Options_SetM2g (value);
       return 1;
-    case OPT_version:
-      M2Options_DisplayVersion (FALSE);
-      return 1;
-    case OPT_fm2_version:
-      M2Options_DisplayVersion (FALSE);
-      return 1;
     case OPT_O:
       M2Options_SetOptimizing (value);
       return 1;
diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc
index 0acc8669cfd..3148746e1db 100644
--- a/gcc/m2/gm2spec.cc
+++ b/gcc/m2/gm2spec.cc
@@ -32,7 +32,6 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #include "opts.h"
 #include "vec.h"
 
-#include "m2/gm2version.h"
 #include "m2/gm2config.h"
 
 #ifdef HAVE_DIRENT_H
@@ -670,12 +669,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 	case OPT_fmod_:
 	  seen_module_extension = true;
 	  break;
-	case OPT_version:
-	  gm2_version (true);
-	  break;
-	case OPT_fm2_version:
-	  gm2_version (false);
-	  break;
         case OPT_fpthread:
           need_pthread = decoded_options[i].value;
           break;
diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
index 7dd6cc2ee89..11b629e94ae 100644
--- a/gcc/m2/lang.opt
+++ b/gcc/m2/lang.opt
@@ -198,10 +198,6 @@ fm2-strict-type
 Modula-2
 experimental flag to turn on the new strict type checker
 
-fm2-version
-Modula-2
-display the GNU Modula-2 version
-
 fm2-whole-program
 Modula-2
 compile all implementation modules and program module at once
@@ -353,10 +349,6 @@ v
 Modula-2
 ; Documented in c.opt
 
-version
-Modula-2
-; Documented in c.opt
-
 x
 Modula-2 Joined
 specify the language from the compiler driver


More information about the Gcc-cvs mailing list