public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] Partial cleanup for gcc/m2/gm2spec.cc
@ 2022-08-13 12:02 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-08-13 12:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:352fd437af9c10c33dc647fac604091777562b5b

commit 352fd437af9c10c33dc647fac604091777562b5b
Author: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Date:   Sat Aug 13 13:01:30 2022 +0100

    Partial cleanup for gcc/m2/gm2spec.cc
    
    The code was derived from a mixture of the fortran
    and C++ front end spec sources.  This patch removes
    comments which are not relevant for Modula-2 and also removes
    many ifdef development/test comments.
    
    gcc/m2/ChangeLog:
    
            * gm2spec.cc: Removed many of the test #ifdef comments and
            rationalized the include files.  (stop) Removed.
    
    libgm2/ChangeLog:
    
            * libm2iso/Makefile.in: Rebuilt.
    
    Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>

Diff:
---
 gcc/m2/gm2spec.cc           | 76 +++++++++------------------------------------
 libgm2/libm2iso/Makefile.in | 11 -------
 2 files changed, 15 insertions(+), 72 deletions(-)

diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc
index a9a57d41884..83655e1dd77 100644
--- a/gcc/m2/gm2spec.cc
+++ b/gcc/m2/gm2spec.cc
@@ -19,13 +19,6 @@ You should have received a copy of the GNU General Public License
 along with GNU Modula-2; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "opts.h"
-
-#if 1
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
@@ -37,7 +30,6 @@ along with GNU Modula-2; see the file COPYING3.  If not see
 #include "opt-suggestions.h"
 #include "gcc.h"
 #include "opts.h"
-#endif
 #include "vec.h"
 
 #include "m2/gm2version.h"
@@ -112,6 +104,7 @@ enum stdcxxlib_kind
 };
 
 #define DEFAULT_DIALECT "pim"
+#undef DEBUG_ARG
 
 typedef enum { iso, pim, min, logitech, pimcoroutine, maxlib } libs;
 
@@ -136,7 +129,6 @@ static const char *library_abbrev[maxlib]
    -flibs=m2pim,m2iso respectively.  This provides a match between
    the dialect of Modula-2 and the library set.  */
 
-
 static const char *add_include (const char *libpath, const char *library);
 
 static bool seen_scaffold_static = false;
@@ -170,7 +162,6 @@ strings_same (const char *s1, const char *s2)
   return s1 == s2 || (s1 != NULL && s2 != NULL && strcmp (s1, s2) == 0);
 }
 
-#if 1
 bool
 options_same (const struct cl_decoded_option *opt1,
 	      const struct cl_decoded_option *opt2)
@@ -229,6 +220,7 @@ append_arg (const struct cl_decoded_option *arg)
 
 /* Append an option described by OPT_INDEX, ARG and VALUE to the list
    being built.  */
+
 static void
 append_option (size_t opt_index, const char *arg, int value)
 {
@@ -237,9 +229,9 @@ append_option (size_t opt_index, const char *arg, int value)
   generate_option (opt_index, arg, value, CL_DRIVER, &decoded);
   append_arg (&decoded);
 }
-#endif
 
-/* gen_gm2_libexec, return a libexec string.  */
+/* gen_gm2_libexec returns a string containing libexec /
+   DEFAULT_TARGET_MACHINE string / DEFAULT_TARGET_MACHINE.  */
 
 static const char *
 gen_gm2_libexec (const char *libexec)
@@ -610,9 +602,6 @@ convert_abbreviations (const char *libraries)
 }
 
 
-
-void stop (void) {}
-
 void
 lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 		      unsigned int *in_decoded_options_count,
@@ -652,7 +641,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
   /* Have we seen -fmod=?  */
   bool seen_module_extension = false;
 
-  /* Should the driver perform a linl?  */
+  /* Should the driver perform a link?  */
   bool linking = true;
 
   /* "-lm" or "-lmath" if it appears on the command line.  */
@@ -685,8 +674,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
   /* True if we should set up include paths and library paths.  */
   bool allow_libraries = true;
 
-#if 0
-  stop ();
+#if defined(DEBUG_ARG)
   printf ("argc = %d\n", argc);
   fprintf (stderr, "Incoming:");
   for (i = 0; i < argc; i++)
@@ -711,15 +699,10 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
     {
       const char *arg = decoded_options[i].arg;
       args[i] = 0;
-#if 0
+#if defined(DEBUG_ARG)
       printf ("1st pass: %s\n",
 	      decoded_options[i].orig_option_with_args_text);
 #endif
-#if 0
-      if (decoded_options[i].errors & CL_ERR_MISSING_ARG)
-	continue; /* Avoid examining arguments of options missing them.  */
-#endif
-
       switch (decoded_options[i].opt_index)
 	{
 	case OPT_fiso:
@@ -750,12 +733,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 	case OPT_fm2_version:
 	  gm2_version (false);
 	  break;
-
-#if 0
-        case OPT_fexceptions:
-          seen_fexceptions = decoded_options[i].value;
-          break;
-#endif
         case OPT_B:
           seen_B = true;
           B_path = decoded_options[i].arg;
@@ -784,7 +761,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 	  seen_uselist = true;
 	  uselist = decoded_options[i].value;
 	  break;
-	  ///////
 
 	case OPT_nostdlib:
 	case OPT_nostdlib__:
@@ -892,25 +868,15 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
   shared_libgcc = 0;
 #endif
 
-  /* For libc++, on most platforms, the ABI library (usually called libc++abi)
-     is provided as a separate DSO, which we must also append.
-     However, a platform might have the ability to forward the ABI library
-     from libc++, or combine it in some other way; in that case, LIBCXXABI
-     should be set to NULL to signal that it need not be appended.
-
-     remove this...
- */
-
   /* Second pass through arglist, transforming arguments as appropriate.  */
 
   append_arg (&decoded_options[0]); /* Start with command name, of course.  */
   for (i = 1; i < argc; ++i)
     {
-#if 0
+#if defined(DEBUG_ARG)
       printf ("2nd pass: %s\n",
 	      decoded_options[i].orig_option_with_args_text);
 #endif
-
       if ((args[i] & SKIPOPT) == 0)
 	{
 	  append_arg (&decoded_options[i]);
@@ -922,7 +888,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 	  if (!saw_libc && (args[i] & WITHLIBC) && library > 0)
 	    saw_libc = &decoded_options[i];
 	}
-#if 0
+#if defined(DEBUG_ARG)
       else
 	printf ("skipping: %s\n",
 		decoded_options[i].orig_option_with_args_text);
@@ -933,18 +899,15 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
      compile or link.  For example include paths for dialect of Modula-2,
      library paths and default scaffold linking options.  */
 
-#if 1
   /* If we have not seen either uselist or gen_module_list and we need
      to link then we turn on -fgen_module_list=- as the default.  */
   if ((! (seen_uselist || seen_gen_module_list)) && linking)
     append_option (OPT_fgen_module_list_, "-", 1);
-#endif
 
   if (allow_libraries)
     {
-      /* If the libraries have not been specified by the user and the
+      /* If the libraries have not been specified by the user but the
 	 dialect has been specified then select the appropriate libraries.  */
-
       if (libraries == NULL)
 	{
 	  if (strcmp (dialect, "iso") == 0)
@@ -953,12 +916,9 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 	    /* Default to pim libraries if none specified.  */
 	    libraries = xstrdup ("m2pim,m2log,m2iso");
 	}
-
       libraries = convert_abbreviations (libraries);
       if (! check_valid_list (libpath, libraries))
 	return;
-
-#if 1
       add_default_includes (libpath, libraries);
     }
   if ((! seen_x_flag) && seen_module_extension)
@@ -966,14 +926,11 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 
   if (need_plugin)
     append_option (OPT_fplugin_, "m2rte", 1);
-#endif
 
   if (linking)
     {
-#if 1
       if (allow_libraries)
 	add_default_archives (libpath, libraries);
-#endif
       /* Add `-lstdc++' if we haven't already done so.  */
 #ifdef HAVE_LD_STATIC_DYNAMIC
       if (library > 1 && !static_link)
@@ -1018,12 +975,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
       append_option (OPT_l, "pthread", 1);
       added_libraries++;
     }
-#if 0
-  if (saw_time)
-    new_decoded_options[j++] = *saw_time;
-  if (saw_libc)
-    new_decoded_options[j++] = *saw_libc;
-#endif
   if (shared_libgcc && !static_link)
     append_option (OPT_shared_libgcc, NULL, 1);
 
@@ -1044,17 +995,20 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
 }
 
 /* Called before linking.  Returns 0 on success and -1 on failure.  */
-int lang_specific_pre_link (void)  /* Not used for C++.  */
+int
+lang_specific_pre_link (void)  /* Not used for M2.  */
 {
   return 0;
 }
 
 /* Number of extra output files that lang_specific_pre_link may generate.  */
-int lang_specific_extra_outfiles = 0;  /* --fixme-- remove me.  */
+int lang_specific_extra_outfiles = 0;
 
 /* lang_register_spec_functions.   --fixme-- remove me.  */
 void
 lang_register_spec_functions (void)
 {
+#if 1
   fe_add_spec_function ("exec_prefix", add_exec_dir);
+#endif
 }
diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in
index 28869eea718..d3e33b0acdf 100644
--- a/libgm2/libm2iso/Makefile.in
+++ b/libgm2/libm2iso/Makefile.in
@@ -920,17 +920,6 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES
 @BUILD_ISOLIB_TRUE@	$(INSTALL_DATA) .libs/libm2iso.a $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
 @BUILD_ISOLIB_TRUE@	chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)/libm2iso.a
 @BUILD_ISOLIB_TRUE@	$(RANLIB) $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)/libm2iso.a
-@BUILD_ISOLIB_TRUE@	echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
-@BUILD_ISOLIB_TRUE@	echo "  gxx_include_dir = $(gxx_include_dir)"
-@BUILD_ISOLIB_TRUE@	echo "  TARGET_LIB_PATH = $(TARGET_LIB_PATH)"
-@BUILD_ISOLIB_TRUE@	echo "  libexecsubdir = $(libexecsubdir)"
-@BUILD_ISOLIB_TRUE@	echo "  multiple:  $(libexecdir)/gcc/$(target_alias)/$(gcc_version)"
-@BUILD_ISOLIB_TRUE@	echo "  $(DESTDIR)/A/$(inst_libdir)/B/$(MULTIDIR)/C/$(M2LIBDIR)/D/"
-@BUILD_ISOLIB_TRUE@	echo "  DESTDIR = $(DESTDIR)"
-@BUILD_ISOLIB_TRUE@	echo "  inst_libdir = $(inst_libdir)"
-@BUILD_ISOLIB_TRUE@	echo "  MULTIDIR = $(MULTIDIR)"
-@BUILD_ISOLIB_TRUE@	echo "  M2LIBDIR = $(M2LIBDIR)"
-@BUILD_ISOLIB_TRUE@	echo "  pwd = `pwd`"
 @BUILD_ISOLIB_TRUE@	for i in $(M2DEFS) $(M2MODS) ; do \
 @BUILD_ISOLIB_TRUE@           if [ -f $$i ] ; then \
 @BUILD_ISOLIB_TRUE@              $(INSTALL_DATA) $$i '$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)'; \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-13 12:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-13 12:02 [gcc/devel/modula-2] Partial cleanup for gcc/m2/gm2spec.cc 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).