public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] Remove m2 front end linking support.
@ 2022-07-07 16:02 Gaius Mulley
0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-07-07 16:02 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:bd2f92560f47aae35041e9ec97093dc827197ab4
commit bd2f92560f47aae35041e9ec97093dc827197ab4
Author: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Date: Thu Jul 7 15:57:13 2022 +0100
Remove m2 front end linking support.
2022-05-30 Gaius Mulley <gaius.mulley@southwales.ac.uk>
All m2 linking assistance by the Modula-2 front end is disabled.
cc1gm2 handles the -c option but currently does nothing with the option.
New gcc/testsuite/gm2/link/externalscaffold added to check the compiler
can link trivial application against a hand built scaffold.
gcc/testsuite/gm2/ChangeLog:
* link/externalscaffold: (New regression test). Manual linking
test using external scaffold.
gcc/m2/ChangeLog:
* gm2-compiler/M2Options.def (cflag): New boolean.
(Setc) New procedure. (Getc) New procedure function.
* gm2-compiler/M2Options.mod (Setc): New procedure.
(Getc) New procedure function. Initialize cflag to
FALSE.
* gm2-gcc/m2options.h (Setc): New external function.
(Getc) New external function.
* gm2-lang.cc: Handle OPT_c and call M2Options_Setc.
* lang-specs.h: Remove all link rules for m2.
* lang.opt: Allow m2 to process the -c option.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
Diff:
---
gcc/m2/ChangeLog | 14 ++++++++++++++
gcc/m2/gm2-compiler/M2Options.def | 16 ++++++++++++++++
gcc/m2/gm2-compiler/M2Options.mod | 21 +++++++++++++++++++++
gcc/m2/gm2-gcc/m2options.h | 3 +++
gcc/m2/gm2-lang.cc | 4 +++-
gcc/m2/lang-specs.h | 17 +++--------------
gcc/m2/lang.opt | 4 ++++
gcc/m2/m2-link-support.h | 1 -
gcc/testsuite/gm2/ChangeLog | 5 +++++
9 files changed, 69 insertions(+), 16 deletions(-)
diff --git a/gcc/m2/ChangeLog b/gcc/m2/ChangeLog
index 52e951fafaa..5ebbc2a941b 100644
--- a/gcc/m2/ChangeLog
+++ b/gcc/m2/ChangeLog
@@ -1,3 +1,17 @@
+2022-05-30 Gaius Mulley <gaius.mulley@southwales.ac.uk>
+
+ * gm2-compiler/M2Options.def (cflag): New boolean.
+ (Setc) New procedure. (Getc) New procedure function.
+ * gm2-compiler/M2Options.mod (Setc): New procedure.
+ (Getc) New procedure function. Initialize cflag to
+ FALSE.
+ * gm2-gcc/m2options.h (Setc): New external function.
+ (Getc) New external function.
+ * gm2-lang.cc: Handle OPT_c and call M2Options_Setc.
+ * lang-specs.h: Remove all link rules for m2.
+ * lang.opt: Allow m2 to process the -c option.
+ * All m2 linking is disabled.
+
2022-05-20 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2pp.cc: (Renamed from m2pp.c). Comments tidied up.
diff --git a/gcc/m2/gm2-compiler/M2Options.def b/gcc/m2/gm2-compiler/M2Options.def
index 5e324e414c9..f134c43a0db 100644
--- a/gcc/m2/gm2-compiler/M2Options.def
+++ b/gcc/m2/gm2-compiler/M2Options.def
@@ -52,6 +52,7 @@ EXPORT QUALIFIED SetReturnCheck, SetNilCheck, SetCaseCheck,
SetWholeValueCheck, GetWholeValueCheck,
SetLowerCaseKeywords,
SetIndex, SetRange, SetWholeDiv, SetStrictTypeChecking,
+ Setc, Getc,
Iso, Pim, Pim2, Pim3, Pim4,
PositiveModFloorDiv,
@@ -86,6 +87,7 @@ EXPORT QUALIFIED SetReturnCheck, SetNilCheck, SetCaseCheck,
VAR
+ cflag, (* -c flag present? *)
Iso, (* -fiso use ISO SYSTEM.def *)
Pim, (* -fpim use PIM [234] SYSTEM.def *)
Pim2, (* -fpim2 use strict rules. *)
@@ -163,6 +165,20 @@ VAR
PROCEDURE DisplayVersion (mustExit: BOOLEAN) ;
+(*
+ Setc - set the cflag (compile only flag -c) to value.
+*)
+
+PROCEDURE Setc (value: BOOLEAN) ;
+
+
+(*
+ Getc - get the cflag (compile only flag -c).
+*)
+
+PROCEDURE Getc () : BOOLEAN ;
+
+
(*
SetWholeProgram - sets the WholeProgram flag (-fwhole-program).
*)
diff --git a/gcc/m2/gm2-compiler/M2Options.mod b/gcc/m2/gm2-compiler/M2Options.mod
index ed606cfeda1..510742c3f2a 100644
--- a/gcc/m2/gm2-compiler/M2Options.mod
+++ b/gcc/m2/gm2-compiler/M2Options.mod
@@ -381,6 +381,26 @@ BEGIN
END GetCpp ;
+(*
+ Setc - set the cflag (compile only flag -c) to value.
+*)
+
+PROCEDURE Setc (value: BOOLEAN) ;
+BEGIN
+ cflag := value
+END Setc ;
+
+
+(*
+ Getc - get the cflag (compile only flag -c).
+*)
+
+PROCEDURE Getc () : BOOLEAN ;
+BEGIN
+ RETURN cflag
+END Getc ;
+
+
(*
SetM2g - returns TRUE if the -fm2-g flags was used.
*)
@@ -1016,6 +1036,7 @@ END SetSaveTempsDir ;
BEGIN
+ cflag := FALSE ; (* -c. *)
CppArgs := InitString ('') ;
CppProgram := InitString ('') ;
Pim := TRUE ;
diff --git a/gcc/m2/gm2-gcc/m2options.h b/gcc/m2/gm2-gcc/m2options.h
index b4b9961579b..5a9b1db2139 100644
--- a/gcc/m2/gm2-gcc/m2options.h
+++ b/gcc/m2/gm2-gcc/m2options.h
@@ -60,6 +60,9 @@ EXTERN int M2Options_GetPositiveModFloor (void);
EXTERN int M2Options_GetFloatValueCheck (void);
EXTERN int M2Options_GetWholeValueCheck (void);
+EXTERN void M2Options_Setc (int value);
+EXTERN int M2Options_Getc (void);
+
EXTERN void M2Options_SetAutoInit (int value);
EXTERN void M2Options_SetPositiveModFloor (int value);
EXTERN void M2Options_SetNilCheck (int value);
diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc
index a71b45788a0..45781eaade9 100644
--- a/gcc/m2/gm2-lang.cc
+++ b/gcc/m2/gm2-lang.cc
@@ -205,7 +205,9 @@ gm2_langhook_handle_option (
switch (code)
{
-
+ case OPT_c:
+ M2Options_Setc (value);
+ return 1;
case OPT_I:
if (insideCppArgs)
{
diff --git a/gcc/m2/lang-specs.h b/gcc/m2/lang-specs.h
index 2bea228a48a..0ef2f2456bd 100644
--- a/gcc/m2/lang-specs.h
+++ b/gcc/m2/lang-specs.h
@@ -23,26 +23,15 @@ along with GCC; see the file COPYING3. If not see
#include "m2-link-support.h"
-#if !defined(MODULA_PROJECT_SUPPORT)
-# define MODULA_PROJECT_SUPPORT " "
-#endif
-
-#if !defined(MODULA_LINK_SUPPORT)
-# define MODULA_LINK_SUPPORT " "
-#endif
-
#if !defined(M2CPP)
# define M2CPP " "
#endif
{".mod", "@modula-2", 0, 0, 0},
- // {".m2l", "@modula-2-linker", 0, 0, 0},
{"@modula-2",
- "%{c:" MODULA_PROJECT_SUPPORT "}"
- "%{c|S:cc1gm2 " M2CPP
- " %(cc1_options) %{f*} %{+e*} %{I*} "
+ "cc1gm2 " M2CPP
+ " %(cc1_options) %{c*} %{f*} %{+e*} %{I*} "
" %{MD} %{MMD} %{M} %{MM} %{MA} %{MT*} %{MF*} %V"
" %{save-temps*}"
- " %i %{!fsyntax-only:%(invoke_as)}}"
- MODULA_LINK_SUPPORT ,
+ " %i %{!fsyntax-only:%(invoke_as)}",
0, 0, 0},
diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
index 7c9f52855af..8831af688b2 100644
--- a/gcc/m2/lang.opt
+++ b/gcc/m2/lang.opt
@@ -42,6 +42,10 @@ O
Modula-2
; Documented in c.opt
+c
+Modula-2
+; Documented in c.opt
+
fiso
Modula-2
use ISO dialect of Modula-2
diff --git a/gcc/m2/m2-link-support.h b/gcc/m2/m2-link-support.h
index 22325968e25..a68b3c9cdc3 100644
--- a/gcc/m2/m2-link-support.h
+++ b/gcc/m2/m2-link-support.h
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-
/* The subprograms used by Modula-2 to facilitate linking are:
gm2l - parses the top level module and all other dependent
modules. It creates a dependency tree and emits a list
diff --git a/gcc/testsuite/gm2/ChangeLog b/gcc/testsuite/gm2/ChangeLog
index cd913d80f30..bf45faee742 100644
--- a/gcc/testsuite/gm2/ChangeLog
+++ b/gcc/testsuite/gm2/ChangeLog
@@ -1,3 +1,8 @@
+2022-05-20 Gaius Mulley <gaius.mulley@southwales.ac.uk>
+
+ * link/externalscaffold: (New regression test). Manual
+ linking test using external scaffold.
+
2021-07-07 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* calling-c/datatypes/unbounded/run/pass/c.c: New file.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-07 16:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 16:02 [gcc/devel/modula-2] Remove m2 front end linking support 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).