public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Gaius Mulley <gaius@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-5456] Tidy up to declarations allowing files to be built by gm2
Date: Fri, 27 Jan 2023 16:39:41 +0000 (GMT)	[thread overview]
Message-ID: <20230127163941.E49263858C00@sourceware.org> (raw)

https://gcc.gnu.org/g:32d1c3dd1d63399cca20567fb35d1ff90e30b655

commit r13-5456-g32d1c3dd1d63399cca20567fb35d1ff90e30b655
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Fri Jan 27 16:38:29 2023 +0000

    Tidy up to declarations allowing files to be built by gm2
    
    This patch adds missing declarations in export qualified lists
    and fixes comparisons of an address type against NIL.
    These changes allow make m2/stage2/cc1gm2 to succeed when in
    maintainer mode.
    
    gcc/m2/ChangeLog:
    
            * gm2-compiler/M2Options.def: Export GetMQ, SetMQ.
            * gm2-compiler/M2Preprocess.mod: (MakeSaveTempsFileName):
            Test NewDir against NIL.  Test Dumpdir against NIL.
            Test GetMD () against NIL.  Test GetMMD () against NIL.
            Test GetMQ () against NIL.  Test GetObj () against NIL.
            Test tempfile against NIL.
            * gm2-compiler/P2SymBuild.def: Export
            BuildNoReturnAttribute.
    
    Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>

Diff:
---
 gcc/m2/gm2-compiler/M2Options.def    |  3 ++-
 gcc/m2/gm2-compiler/M2Preprocess.mod | 16 ++++++++--------
 gcc/m2/gm2-compiler/P2SymBuild.def   |  1 +
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gcc/m2/gm2-compiler/M2Options.def b/gcc/m2/gm2-compiler/M2Options.def
index df42a4a5b65..dd269843005 100644
--- a/gcc/m2/gm2-compiler/M2Options.def
+++ b/gcc/m2/gm2-compiler/M2Options.def
@@ -93,7 +93,8 @@ EXPORT QUALIFIED SetReturnCheck, SetNilCheck, SetCaseCheck,
                  SetScaffoldMain, ScaffoldMain,
                  SetRuntimeModuleOverride, GetRuntimeModuleOverride,
                  SetGenModuleList, GetGenModuleFilename, SharedFlag,
-                 SetB, GetB, SetMD, GetMD, SetMMD, GetMMD, SetObj, GetObj ;
+                 SetB, GetB, SetMD, GetMD, SetMMD, GetMMD, SetObj, GetObj,
+                 GetMQ, SetMQ ;
 
 
 VAR
diff --git a/gcc/m2/gm2-compiler/M2Preprocess.mod b/gcc/m2/gm2-compiler/M2Preprocess.mod
index ebd9cb9f617..d63db35f938 100644
--- a/gcc/m2/gm2-compiler/M2Preprocess.mod
+++ b/gcc/m2/gm2-compiler/M2Preprocess.mod
@@ -134,7 +134,7 @@ PROCEDURE MakeSaveTempsFileName (filename: String) : String ;
 VAR
    NewName,
    DumpDir,
-   NewDir: String ;
+   NewDir : String ;
 BEGIN
    NewName := ConCat (GetFileName (filename), InitString ('.m2i')) ;
    NewDir := GetSaveTempsDir () ;
@@ -146,7 +146,7 @@ BEGIN
       fprintf1 (StdOut, " DumpDir: %s\n", DumpDir)
    END ;
 *)
-   IF (NewDir AND EqualArray (NewDir, 'obj')) AND DumpDir
+   IF (NewDir#NIL) AND EqualArray (NewDir, 'obj') AND (DumpDir#NIL)
    THEN
       RETURN Dup (ConCat (DumpDir, NewName))
    ELSE
@@ -181,20 +181,20 @@ BEGIN
       (* We support MD and MMD for the main file only, at present.  *)
       IF isMain OR PPonly
       THEN
-         IF GetMD ()
+         IF GetMD () # NIL
          THEN
             tempfile := ConCat( Mark (InitString(' -MD ')),
                                 InitStringCharStar (GetMD ()))
-         ELSIF GetMMD ()
+         ELSIF GetMMD () # NIL
          THEN
             tempfile := ConCat( Mark (InitString(' -MMD ')),
                                 InitStringCharStar (GetMMD ()))
          END ;
-         IF tempfile
+         IF tempfile#NIL
          THEN
             commandLine := ConCat (Dup (commandLine), Dup (tempfile)) ;
             (* We can only add MQ if we already have an MD/MMD.  *)
-            IF GetMQ ()
+            IF GetMQ () # NIL
             THEN
                tempfile := ConCat( Mark (InitString(' -MQ ')),
                                  InitStringCharStar (GetMQ ())) ;
@@ -207,7 +207,7 @@ BEGIN
       tempfile := NIL ;
       IF PPonly
       THEN
-         IF GetObj()
+         IF GetObj () # NIL
          THEN
            tempfile := InitStringCharStar (GetObj ())
          END ;
@@ -218,7 +218,7 @@ BEGIN
          tempfile := InitStringCharStar (make_temp_file (KeyToCharStar (MakeKey('.m2i'))))
       END ;
       commandLine := ConCat (ConCatChar (Dup (commandLine), ' '), filename) ;
-      IF tempfile
+      IF tempfile # NIL
       THEN
          commandLine := ConCat (ConCat (Dup (commandLine),
                                         Mark (InitString(' -o '))), tempfile) ;
diff --git a/gcc/m2/gm2-compiler/P2SymBuild.def b/gcc/m2/gm2-compiler/P2SymBuild.def
index b377011c54a..d5dd9feb25c 100644
--- a/gcc/m2/gm2-compiler/P2SymBuild.def
+++ b/gcc/m2/gm2-compiler/P2SymBuild.def
@@ -61,6 +61,7 @@ EXPORT QUALIFIED P2StartBuildDefModule,
                  BuildOptArg,
                  StartBuildProcedure,
                  EndBuildProcedure,
+                 BuildNoReturnAttribute,
                  BuildFunction,
                  BuildOptFunction,
                  BuildPointerType,

                 reply	other threads:[~2023-01-27 16:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230127163941.E49263858C00@sourceware.org \
    --to=gaius@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).