public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5456] Tidy up to declarations allowing files to be built by gm2
@ 2023-01-27 16:39 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2023-01-27 16:39 UTC (permalink / raw)
  To: gcc-cvs

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,

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

only message in thread, other threads:[~2023-01-27 16:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 16:39 [gcc r13-5456] Tidy up to declarations allowing files to be built by gm2 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).