From: Gaius Mulley Date: Fri, 27 Jan 2023 16:38:29 +0000 (+0000) Subject: Tidy up to declarations allowing files to be built by gm2 X-Git-Tag: basepoints/gcc-14~1751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32d1c3dd1d63399cca20567fb35d1ff90e30b655;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/m2/gm2-compiler/M2Options.def b/gcc/m2/gm2-compiler/M2Options.def index df42a4a5b659..dd2698430057 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 ebd9cb9f6171..d63db35f9389 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 b377011c54af..d5dd9feb25c0 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,