public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5376] PR-108135 Remove PACKAGE_* definitions from gm2config.h
@ 2023-01-26 0:56 Gaius Mulley
0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2023-01-26 0:56 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:66132b1f213c2907512259cd0197ef49a74897b9
commit r13-5376-g66132b1f213c2907512259cd0197ef49a74897b9
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Thu Jan 26 00:55:56 2023 +0000
PR-108135 Remove PACKAGE_* definitions from gm2config.h
PR-108135 gcc/m2/configure generates gm2config.h and
automatically adds PACKAGE defines. gcc/m2/Make-lang.in
now removes these PACKAGE definitions. The patch also
contains fixes to remove an unused variable Dim from
BuildConstHighFromSym and also uses withTok in StartBuildWith.
StartBuildWith will generate a nop (for improved debugging)
if requested.
gcc/m2/ChangeLog:
* Make-lang.in (m2/gm2config.h): Rewrite rule to be
dependent upon m2/gm2config.aci.
(m2/gm2config.aci): Newrule.
* configure.ac (AC_CONFIG_HEADERS): Change destination
to gm2config.aci.
* configure: Regenerate.
* gm2-libs/config-host: Regenerate.
* gm2-compiler/M2GCCDeclare.mod (AddSymToWatch): Comment
out.
* gm2-compiler/M2Quads.mod (BuildConstHighFromSym): Remove
Dim.
(StartBuildWith): Call BuildStmtNoteTok.
(BuildStmtNoteTok): New procedure.
(BuildStmtNote): Re-implement re-factor into two
procedures and call BuildStmtNoteTok.
* gm2config.h.in: Remove.
* gm2config.aci.in: New file.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diff:
---
gcc/m2/Make-lang.in | 5 +++-
gcc/m2/configure | 6 ++---
gcc/m2/configure.ac | 4 +--
gcc/m2/gm2-compiler/M2GCCDeclare.mod | 2 ++
gcc/m2/gm2-compiler/M2Quads.mod | 39 ++++++++++++++++++-----------
gcc/m2/gm2-libs/config-host | 6 ++---
gcc/m2/{gm2config.h.in => gm2config.aci.in} | 2 +-
7 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index 0d3ff237385..122a35c7902 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -1503,7 +1503,10 @@ m2/gm2-libs/gm2-libs-host.h:
# Autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
# cross compiler and the ../Makefile.in above appends this to INTERNAL_CFLAGS.
-m2/gm2config.h:
+m2/gm2config.h: m2/gm2config.aci
+ grep -v define\ PACKAGE_ $< > $@
+
+m2/gm2config.aci:
NEW_SRCDIR=`${srcdir}/m2/tools-src/calcpath ../ ${srcdir} m2` ; \
export NEW_SRCDIR ; \
cd m2 ; \
diff --git a/gcc/m2/configure b/gcc/m2/configure
index 91768ab9c6f..de78fdd3724 100755
--- a/gcc/m2/configure
+++ b/gcc/m2/configure
@@ -3645,7 +3645,7 @@ $as_echo "#define HAVE_OPENDIR 1" >>confdefs.h
fi
-ac_config_headers="$ac_config_headers gm2config.h"
+ac_config_headers="$ac_config_headers gm2config.aci"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4319,7 +4319,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
- "gm2config.h") CONFIG_HEADERS="$CONFIG_HEADERS gm2config.h" ;;
+ "gm2config.aci") CONFIG_HEADERS="$CONFIG_HEADERS gm2config.aci" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -4630,7 +4630,7 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
case $ac_file$ac_mode in
- "gm2config.h":H) echo timestamp > stamp-h ;;
+ "gm2config.aci":H) echo timestamp > stamp-h ;;
esac
done # for ac_tag
diff --git a/gcc/m2/configure.ac b/gcc/m2/configure.ac
index a9c952a92f4..0a77caeaa17 100644
--- a/gcc/m2/configure.ac
+++ b/gcc/m2/configure.ac
@@ -1,4 +1,4 @@
-# configure.ac provides gm2spec.c with access to config values.
+# configure.ac provides gm2spec.cc with access to config values.
# Copyright (C) 2001-2023 Free Software Foundation, Inc.
# Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
@@ -29,5 +29,5 @@ AC_CHECK_FUNCS([stpcpy])
AC_CHECK_HEADERS(sys/types.h)
AC_HEADER_DIRENT
AC_CHECK_LIB([c],[opendir],[AC_DEFINE([HAVE_OPENDIR],[1],[found opendir])])
-AC_CONFIG_HEADERS(gm2config.h, [echo timestamp > stamp-h])
+AC_CONFIG_HEADERS(gm2config.aci, [echo timestamp > stamp-h])
AC_OUTPUT
diff --git a/gcc/m2/gm2-compiler/M2GCCDeclare.mod b/gcc/m2/gm2-compiler/M2GCCDeclare.mod
index fa27cb4b1f1..27745988c01 100644
--- a/gcc/m2/gm2-compiler/M2GCCDeclare.mod
+++ b/gcc/m2/gm2-compiler/M2GCCDeclare.mod
@@ -347,6 +347,7 @@ END DebugSetNumbers ;
lists.
*)
+(*
PROCEDURE AddSymToWatch (sym: WORD) ;
BEGIN
IF (sym#NulSym) AND (NOT IsElementInSet(WatchList, sym))
@@ -357,6 +358,7 @@ BEGIN
FIO.FlushBuffer(FIO.StdOut)
END
END AddSymToWatch ;
+*)
(*
diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod
index a58de93e4a8..939758fed7a 100644
--- a/gcc/m2/gm2-compiler/M2Quads.mod
+++ b/gcc/m2/gm2-compiler/M2Quads.mod
@@ -8101,14 +8101,11 @@ END BuildHighFunction ;
PROCEDURE BuildConstHighFromSym (tok: CARDINAL) ;
VAR
- Dim,
NoOfParam,
ReturnVar: CARDINAL ;
BEGIN
PopT (NoOfParam) ;
ReturnVar := MakeTemporary (tok, ImmediateValue) ;
- Dim := OperandD (1) ;
- INC (Dim) ;
GenHigh (tok, ReturnVar, 1, OperandT (1)) ;
PopN (NoOfParam+1) ;
PushTtok (ReturnVar, tok)
@@ -11445,6 +11442,7 @@ VAR
Sym, Type,
Ref : CARDINAL ;
BEGIN
+ BuildStmtNoteTok (withTok) ;
DisplayStack ;
PopTFtok (Sym, Type, tok) ;
Type := SkipType (Type) ;
@@ -14107,25 +14105,36 @@ END PushLineNo ;
PROCEDURE BuildStmtNote (offset: INTEGER) ;
VAR
- filename: Name ;
- f : QuadFrame ;
- i : INTEGER ;
+ tokenno: INTEGER ;
BEGIN
IF NextQuad#Head
THEN
- f := GetQF (NextQuad-1) ;
- i := offset ;
- INC (i, GetTokenNo ()) ;
- (* no need to have multiple notes at the same position. *)
- IF (f^.Operator # StatementNoteOp) OR (f^.Operand3 # VAL (CARDINAL, i))
- THEN
- filename := makekey (string (GetFileName ())) ;
- GenQuad (StatementNoteOp, WORD (filename), NulSym, i)
- END
+ tokenno := offset ;
+ INC (tokenno, GetTokenNo ()) ;
+ BuildStmtNoteTok (VAL(CARDINAL, tokenno))
END
END BuildStmtNote ;
+(*
+ BuildStmtNoteTok - adds a nop (with an assigned tokenno location) to the code.
+*)
+
+PROCEDURE BuildStmtNoteTok (tokenno: CARDINAL) ;
+VAR
+ filename: Name ;
+ f : QuadFrame ;
+BEGIN
+ f := GetQF (NextQuad-1) ;
+ (* no need to have multiple notes at the same position. *)
+ IF (f^.Operator # StatementNoteOp) OR (f^.Operand3 # tokenno)
+ THEN
+ filename := makekey (string (GetFileName ())) ;
+ GenQuad (StatementNoteOp, WORD (filename), NulSym, tokenno)
+ END
+END BuildStmtNoteTok ;
+
+
(*
AddRecordToList - adds the record held on the top of stack to the
list of records and varient fields.
diff --git a/gcc/m2/gm2-libs/config-host b/gcc/m2/gm2-libs/config-host
index 184c363cd69..5d6d33d2b84 100755
--- a/gcc/m2/gm2-libs/config-host
+++ b/gcc/m2/gm2-libs/config-host
@@ -5,7 +5,7 @@
# Report bugs to <gm2@nongnu.org>.
#
#
-# Copyright (C) 1992-2023 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -1369,7 +1369,7 @@ if $ac_init_version; then
ASCII.def configure 1.9.5
generated by GNU Autoconf 2.69
-Copyright (C) 2012-2023 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -5298,7 +5298,7 @@ ASCII.def config.status 1.9.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2012-2023 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
diff --git a/gcc/m2/gm2config.h.in b/gcc/m2/gm2config.aci.in
similarity index 96%
rename from gcc/m2/gm2config.h.in
rename to gcc/m2/gm2config.aci.in
index fe2f81400ed..cb9f5054f44 100644
--- a/gcc/m2/gm2config.h.in
+++ b/gcc/m2/gm2config.aci.in
@@ -1,4 +1,4 @@
-/* gm2config.h.in. Generated from configure.ac by autoheader. */
+/* gm2config.aci.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-26 0:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 0:56 [gcc r13-5376] PR-108135 Remove PACKAGE_* definitions from gm2config.h 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).