From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id D64903858D32; Mon, 16 Jan 2023 18:46:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D64903858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673894771; bh=q82hQcOdM1xsyggWa2sHgONSTLDpwG3MBy5yhrDOuEU=; h=From:To:Subject:Date:From; b=VipJpLUla4ICrRtvdBNhDpoC7X7S1mvi0ZQXPuZWJOEdeQcuURofWzFnxDSEna0tj 2Mf72JVE2SJqHKDNoDaH+yE930HXLp/7R7NyCqUXOTZSmzZ7zhVmvTKCrGL5hp4U/R CdDaPmy7iBMCVU5u00DjvpqQgSYyF1ltsDscD7aQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5217] Remove YEAR const from mcOptions.mod and use result from time X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/master X-Git-Oldrev: a0c595386fa322e1874d33742fc56c6a0c13c4a5 X-Git-Newrev: 2bf9bbfe5b377003a29d6560d69baa605382b895 Message-Id: <20230116184611.D64903858D32@sourceware.org> Date: Mon, 16 Jan 2023 18:46:11 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2bf9bbfe5b377003a29d6560d69baa605382b895 commit r13-5217-g2bf9bbfe5b377003a29d6560d69baa605382b895 Author: Gaius Mulley Date: Mon Jan 16 18:45:52 2023 +0000 Remove YEAR const from mcOptions.mod and use result from time This patch removes the hard coded constant YEAR and replaces its use by a call to a new procedure function getYear. It also emits a GPL v3 boilerplate. gcc/m2/ChangeLog: * mc-boot-ch/Glibc.c (libc_time): New function. (libc_localtime): New function. * mc-boot/GDynamicStrings.c: Regenerate. * mc-boot/GFIO.c: Regenerate. * mc-boot/GFormatStrings.c: Regenerate. * mc-boot/GIndexing.c: Regenerate. * mc-boot/GM2Dependent.c: Regenerate. * mc-boot/GM2EXCEPTION.c: Regenerate. * mc-boot/GPushBackInput.c: Regenerate. * mc-boot/GRTExceptions.c: Regenerate. * mc-boot/GRTint.c: Regenerate. * mc-boot/GStdIO.c: Regenerate. * mc-boot/GStringConvert.c: Regenerate. * mc-boot/GSysStorage.c: Regenerate. * mc-boot/Gdecl.c: Regenerate. * mc-boot/GmcComment.c: Regenerate. * mc-boot/GmcComp.c: Regenerate. * mc-boot/GmcDebug.c: Regenerate. * mc-boot/GmcMetaError.c: Regenerate. * mc-boot/GmcOptions.c: Regenerate. * mc-boot/GmcStack.c: Regenerate. * mc-boot/GnameKey.c: Regenerate. * mc-boot/GsymbolKey.c: Regenerate. * mc-boot/Gkeyc.c: Regenerate. * mc/decl.mod (putFieldRecord): Change NulName to NulKey and fix type comparision. * mc/mcOptions.mod (YEAR): Remove. (getYear): New procedure function. (displayVersion): Use result from getYear instead of YEAR. Emit boilerplate for GPL v3. (gplBody): Use result from getYear instead of YEAR. (glplBody): Use result from getYear instead of YEAR. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/mc-boot-ch/Glibc.c | 14 ++++ gcc/m2/mc-boot/GDynamicStrings.c | 32 ++++----- gcc/m2/mc-boot/GFIO.c | 14 ++-- gcc/m2/mc-boot/GFormatStrings.c | 2 +- gcc/m2/mc-boot/GIndexing.c | 6 +- gcc/m2/mc-boot/GM2Dependent.c | 47 +++++++++++- gcc/m2/mc-boot/GM2EXCEPTION.c | 4 +- gcc/m2/mc-boot/GPushBackInput.c | 6 +- gcc/m2/mc-boot/GRTExceptions.c | 34 ++++----- gcc/m2/mc-boot/GRTint.c | 20 +++--- gcc/m2/mc-boot/GStdIO.c | 4 +- gcc/m2/mc-boot/GStringConvert.c | 4 +- gcc/m2/mc-boot/GSysStorage.c | 6 +- gcc/m2/mc-boot/Gdecl.c | 152 +++++++++++++++++++-------------------- gcc/m2/mc-boot/Gkeyc.c | 2 +- gcc/m2/mc-boot/GmcComment.c | 2 +- gcc/m2/mc-boot/GmcComp.c | 4 +- gcc/m2/mc-boot/GmcDebug.c | 2 +- gcc/m2/mc-boot/GmcMetaError.c | 8 +-- gcc/m2/mc-boot/GmcOptions.c | 41 +++++++++-- gcc/m2/mc-boot/GmcStack.c | 4 +- gcc/m2/mc-boot/GnameKey.c | 4 +- gcc/m2/mc-boot/GsymbolKey.c | 6 +- gcc/m2/mc/decl.mod | 4 +- gcc/m2/mc/mcOptions.mod | 38 +++++++--- 25 files changed, 286 insertions(+), 174 deletions(-) diff --git a/gcc/m2/mc-boot-ch/Glibc.c b/gcc/m2/mc-boot-ch/Glibc.c index 3e9b4863f94..7a37fef6150 100644 --- a/gcc/m2/mc-boot-ch/Glibc.c +++ b/gcc/m2/mc-boot-ch/Glibc.c @@ -77,6 +77,20 @@ libc_strlen (char *s) return strlen (s); } +EXTERN +time_t +libc_time (time_t *buf) +{ + return time (buf); +} + +EXTERN +void * +libc_localtime (time_t *epochtime) +{ + return localtime (epochtime); +} + EXTERN int libc_printf (char *_format, unsigned int _format_high, ...) diff --git a/gcc/m2/mc-boot/GDynamicStrings.c b/gcc/m2/mc-boot/GDynamicStrings.c index 372bbb515f2..6907b8079e5 100644 --- a/gcc/m2/mc-boot/GDynamicStrings.c +++ b/gcc/m2/mc-boot/GDynamicStrings.c @@ -1214,7 +1214,7 @@ static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned (*c).next->contents.next = NULL; ConcatContents (&(*c).next->contents, (const char *) a, _a_high, h, o); AddDebugInfo ((*c).next); - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 722, (const char *) "ConcatContents", 14); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 722, (const char *) "ConcatContents", 14); } else { @@ -1312,7 +1312,7 @@ static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigne AddDebugInfo ((*c).next); if (TraceOn) { - (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 917, (const char *) "ConcatContentsAddress", 21); + (*c).next = AssignDebug ((*c).next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 917, (const char *) "ConcatContentsAddress", 21); } } else @@ -1537,7 +1537,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 758, (const char *) "InitString", 10); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 758, (const char *) "InitString", 10); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1640,7 +1640,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) AddDebugInfo (s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 957, (const char *) "InitStringCharStar", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 957, (const char *) "InitStringCharStar", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1665,7 +1665,7 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) s = DynamicStrings_InitString ((const char *) &a.array[0], 1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 977, (const char *) "InitStringChar", 14); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 977, (const char *) "InitStringChar", 14); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1823,7 +1823,7 @@ extern "C" DynamicStrings_String DynamicStrings_Dup (DynamicStrings_String s) s = DynamicStrings_Assign (DynamicStrings_InitString ((const char *) "", 0), s); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1173, (const char *) "Dup", 3); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1173, (const char *) "Dup", 3); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1845,7 +1845,7 @@ extern "C" DynamicStrings_String DynamicStrings_Add (DynamicStrings_String a, Dy a = DynamicStrings_ConCat (DynamicStrings_ConCat (DynamicStrings_InitString ((const char *) "", 0), a), b); if (TraceOn) { - a = AssignDebug (a, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1193, (const char *) "Add", 3); + a = AssignDebug (a, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1193, (const char *) "Add", 3); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1920,7 +1920,7 @@ extern "C" unsigned int DynamicStrings_EqualCharStar (DynamicStrings_String s, v t = DynamicStrings_InitStringCharStar (a); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1258, (const char *) "EqualCharStar", 13); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1258, (const char *) "EqualCharStar", 13); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1958,7 +1958,7 @@ extern "C" unsigned int DynamicStrings_EqualArray (DynamicStrings_String s, cons t = DynamicStrings_InitString ((const char *) a, _a_high); if (TraceOn) { - t = AssignDebug (t, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1288, (const char *) "EqualArray", 10); + t = AssignDebug (t, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1288, (const char *) "EqualArray", 10); } t = AddToGarbage (t, s); if (DynamicStrings_Equal (t, s)) @@ -1996,7 +1996,7 @@ extern "C" DynamicStrings_String DynamicStrings_Mult (DynamicStrings_String s, u } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1320, (const char *) "Mult", 4); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1320, (const char *) "Mult", 4); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2075,7 +2075,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, AddDebugInfo (t->contents.next); if (TraceOn) { - t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1388, (const char *) "Slice", 5); + t->contents.next = AssignDebug (t->contents.next, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1388, (const char *) "Slice", 5); } } t = t->contents.next; @@ -2093,7 +2093,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, } if (TraceOn) { - d = AssignDebug (d, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1405, (const char *) "Slice", 5); + d = AssignDebug (d, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1405, (const char *) "Slice", 5); } return d; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2221,7 +2221,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveComment (DynamicStrings_St } if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1517, (const char *) "RemoveComment", 13); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1517, (const char *) "RemoveComment", 13); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2246,7 +2246,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePrefix (DynamicString s = DynamicStrings_Slice (s, (int ) (i), 0); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1629, (const char *) "RemoveWhitePrefix", 17); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1629, (const char *) "RemoveWhitePrefix", 17); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2271,7 +2271,7 @@ extern "C" DynamicStrings_String DynamicStrings_RemoveWhitePostfix (DynamicStrin s = DynamicStrings_Slice (s, 0, i+1); if (TraceOn) { - s = AssignDebug (s, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 1651, (const char *) "RemoveWhitePostfix", 18); + s = AssignDebug (s, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 1651, (const char *) "RemoveWhitePostfix", 18); } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -2640,7 +2640,7 @@ extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned { stop (); /* writeString ("mismatched number of PopAllocation's compared to PushAllocation's") */ - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/DynamicStrings.mod", 62, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/DynamicStrings.mod", 55, 176, (const char *) "PopAllocationExemption", 22, (const char *) "mismatched number of PopAllocation's compared to PushAllocation's", 65); } else { diff --git a/gcc/m2/mc-boot/GFIO.c b/gcc/m2/mc-boot/GFIO.c index e4c2ce0f5b8..74cd8580cf5 100644 --- a/gcc/m2/mc-boot/GFIO.c +++ b/gcc/m2/mc-boot/GFIO.c @@ -555,7 +555,7 @@ static FIO_File GetNextFreeDescriptor (void) return f; /* create new slot */ } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } @@ -1703,7 +1703,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high) { CheckAccess (f, FIO_openedforread, FALSE); - if ((BufferedRead (f, _a_high, a)) == _a_high) + if ((BufferedRead (f, _a_high, a)) == ((int ) (_a_high))) { SetEndOfLine (f, static_cast (a[_a_high])); } @@ -1762,7 +1762,7 @@ extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high) { CheckAccess (f, FIO_openedforwrite, TRUE); - if ((BufferedWrite (f, _a_high, a)) == _a_high) + if ((BufferedWrite (f, _a_high, a)) == ((int ) (_a_high))) {} /* empty. */ } @@ -1774,7 +1774,7 @@ extern "C" void FIO_WriteAny (FIO_File f, unsigned char *a, unsigned int _a_high extern "C" void FIO_WriteChar (FIO_File f, char ch) { CheckAccess (f, FIO_openedforwrite, TRUE); - if ((BufferedWrite (f, sizeof (ch), &ch)) == sizeof (ch)) + if ((BufferedWrite (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch)))) {} /* empty. */ } @@ -1873,7 +1873,7 @@ extern "C" char FIO_ReadChar (FIO_File f) char ch; CheckAccess (f, FIO_openedforread, FALSE); - if ((BufferedRead (f, sizeof (ch), &ch)) == sizeof (ch)) + if ((BufferedRead (f, sizeof (ch), &ch)) == ((int ) (sizeof (ch)))) { SetEndOfLine (f, ch); return ch; @@ -2266,7 +2266,7 @@ extern "C" void * FIO_getFileName (FIO_File f) return fd->name.address; } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } @@ -2293,7 +2293,7 @@ extern "C" unsigned int FIO_getFileNameLength (FIO_File f) return fd->name.size; } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/FIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/FIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GFormatStrings.c b/gcc/m2/mc-boot/GFormatStrings.c index a0b91e2a05c..7710c8aae42 100644 --- a/gcc/m2/mc-boot/GFormatStrings.c +++ b/gcc/m2/mc-boot/GFormatStrings.c @@ -545,7 +545,7 @@ static DynamicStrings_String HandlePercent (DynamicStrings_String fmt, DynamicSt int prevpos; DynamicStrings_String result; - if ((startpos == (DynamicStrings_Length (fmt))) || (startpos < 0)) + if ((startpos == ((int ) (DynamicStrings_Length (fmt)))) || (startpos < 0)) { return s; } diff --git a/gcc/m2/mc-boot/GIndexing.c b/gcc/m2/mc-boot/GIndexing.c index 1c31581e44d..c809e4b9b6e 100644 --- a/gcc/m2/mc-boot/GIndexing.c +++ b/gcc/m2/mc-boot/GIndexing.c @@ -222,7 +222,7 @@ extern "C" unsigned int Indexing_InBounds (Indexing_Index i, unsigned int n) { return (n >= i->Low) && (n <= i->High); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } @@ -242,7 +242,7 @@ extern "C" unsigned int Indexing_HighIndice (Indexing_Index i) { return i->High; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } @@ -262,7 +262,7 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) { return i->Low; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/Indexing.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/Indexing.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GM2Dependent.c b/gcc/m2/mc-boot/GM2Dependent.c index 389da6aa153..b9c59cc9fac 100644 --- a/gcc/m2/mc-boot/GM2Dependent.c +++ b/gcc/m2/mc-boot/GM2Dependent.c @@ -262,6 +262,13 @@ static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyStat static void ForceDependencies (void); +/* + CheckApplication - check to see that the application is the last entry in the list. + This might happen if the application only imports FOR C modules. +*/ + +static void CheckApplication (void); + /* equal - return TRUE if C string cstr is equal to str. */ @@ -730,6 +737,7 @@ static void ResolveDependencies (void * currentmodule) static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *name_, unsigned int _name_high) { M2Dependent_ModuleChain mptr; + unsigned int count; char name[_name_high+1]; /* make a local copy of each unbounded array. */ @@ -739,8 +747,10 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *na { libc_printf ((const char *) "%s modules\\n", 12, &name); mptr = Modules.array[state-M2Dependent_unregistered]; + count = 0; do { - libc_printf ((const char *) " %s", 4, mptr->name); + libc_printf ((const char *) " %d %s", 8, count, mptr->name); + count += 1; if (mptr->dependency.appl) { libc_printf ((const char *) " application", 12); @@ -851,6 +861,38 @@ static void ForceDependencies (void) } +/* + CheckApplication - check to see that the application is the last entry in the list. + This might happen if the application only imports FOR C modules. +*/ + +static void CheckApplication (void) +{ + M2Dependent_ModuleChain mptr; + M2Dependent_ModuleChain appl; + + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]; + if (mptr != NULL) + { + appl = NULL; + do { + if (mptr->dependency.appl) + { + appl = mptr; + } + else + { + mptr = mptr->next; + } + } while (! ((appl != NULL) || (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered]))); + if (appl != NULL) + { + Modules.array[M2Dependent_ordered-M2Dependent_unregistered] = appl->next; + } + } +} + + /* equal - return TRUE if C string cstr is equal to str. */ @@ -1006,6 +1048,9 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc ForceDependencies (); traceprintf (ForceTrace, (const char *) "After user forcing ordering\\n", 29); DumpModuleData (ForceTrace); + CheckApplication (); + traceprintf (ForceTrace, (const char *) "After runtime forces application to the end\\n", 45); + DumpModuleData (ForceTrace); if (Modules.array[M2Dependent_ordered-M2Dependent_unregistered] == NULL) { traceprintf2 (ModuleTrace, (const char *) " module: %s has not registered itself using a global constructor\\n", 67, applicationmodule); diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.c b/gcc/m2/mc-boot/GM2EXCEPTION.c index 1339096cc3b..7915442b6e1 100644 --- a/gcc/m2/mc-boot/GM2EXCEPTION.c +++ b/gcc/m2/mc-boot/GM2EXCEPTION.c @@ -57,13 +57,13 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void) n = RTExceptions_GetNumber (e); if (n == (UINT_MAX)) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast (reinterpret_cast("M2Exception")), const_cast (reinterpret_cast("current coroutine is not in the exceptional execution state"))); } else { return (M2EXCEPTION_M2Exceptions) (n); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/M2EXCEPTION.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GPushBackInput.c b/gcc/m2/mc-boot/GPushBackInput.c index 1e75eded2c7..6812343de8c 100644 --- a/gcc/m2/mc-boot/GPushBackInput.c +++ b/gcc/m2/mc-boot/GPushBackInput.c @@ -274,7 +274,7 @@ extern "C" char PushBackInput_PutCh (char ch) } else { - Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, 150, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); + Debug_Halt ((const char *) "max push back stack exceeded, increase MaxPushBackStack", 55, 150, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } return ch; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -300,7 +300,7 @@ extern "C" void PushBackInput_PutString (const char *a_, unsigned int _a_high) l -= 1; if ((PushBackInput_PutCh (a[l])) != a[l]) { - Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); + Debug_Halt ((const char *) "assert failed", 13, 132, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } @@ -321,7 +321,7 @@ extern "C" void PushBackInput_PutStr (DynamicStrings_String s) i -= 1; if ((PushBackInput_PutCh (DynamicStrings_char (s, static_cast (i)))) != (DynamicStrings_char (s, static_cast (i)))) { - Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/PushBackInput.mod", 61); + Debug_Halt ((const char *) "assert failed", 13, 113, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/PushBackInput.mod", 54); } } } diff --git a/gcc/m2/mc-boot/GRTExceptions.c b/gcc/m2/mc-boot/GRTExceptions.c index 0ca1a18b063..a6aa8069f05 100644 --- a/gcc/m2/mc-boot/GRTExceptions.c +++ b/gcc/m2/mc-boot/GRTExceptions.c @@ -719,7 +719,7 @@ static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) static void indexf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 612, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 612, 9, const_cast (reinterpret_cast("indexf")), const_cast (reinterpret_cast("array index out of bounds"))); } @@ -729,7 +729,7 @@ static void indexf (void * a) static void range (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 624, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 624, 9, const_cast (reinterpret_cast("range")), const_cast (reinterpret_cast("assignment out of range"))); } @@ -739,7 +739,7 @@ static void range (void * a) static void casef (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 636, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 636, 9, const_cast (reinterpret_cast("casef")), const_cast (reinterpret_cast("case selector out of range"))); } @@ -749,7 +749,7 @@ static void casef (void * a) static void invalidloc (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 648, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 648, 9, const_cast (reinterpret_cast("invalidloc")), const_cast (reinterpret_cast("invalid address referenced"))); } @@ -759,7 +759,7 @@ static void invalidloc (void * a) static void function (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 660, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 660, 9, const_cast (reinterpret_cast("function")), const_cast (reinterpret_cast("... function ... "))); /* --fixme-- what has happened ? */ } @@ -769,7 +769,7 @@ static void function (void * a) static void wholevalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 672, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 672, 9, const_cast (reinterpret_cast("wholevalue")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -779,7 +779,7 @@ static void wholevalue (void * a) static void wholediv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 684, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 684, 9, const_cast (reinterpret_cast("wholediv")), const_cast (reinterpret_cast("illegal whole value exception"))); } @@ -789,7 +789,7 @@ static void wholediv (void * a) static void realvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 696, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 696, 9, const_cast (reinterpret_cast("realvalue")), const_cast (reinterpret_cast("illegal real value exception"))); } @@ -799,7 +799,7 @@ static void realvalue (void * a) static void realdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 708, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 708, 9, const_cast (reinterpret_cast("realdiv")), const_cast (reinterpret_cast("real number division by zero exception"))); } @@ -809,7 +809,7 @@ static void realdiv (void * a) static void complexvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 720, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 720, 9, const_cast (reinterpret_cast("complexvalue")), const_cast (reinterpret_cast("illegal complex value exception"))); } @@ -819,7 +819,7 @@ static void complexvalue (void * a) static void complexdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 732, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 732, 9, const_cast (reinterpret_cast("complexdiv")), const_cast (reinterpret_cast("complex number division by zero exception"))); } @@ -829,7 +829,7 @@ static void complexdiv (void * a) static void protection (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 744, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 744, 9, const_cast (reinterpret_cast("protection")), const_cast (reinterpret_cast("protection exception"))); } @@ -839,7 +839,7 @@ static void protection (void * a) static void systemf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 756, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 756, 9, const_cast (reinterpret_cast("systemf")), const_cast (reinterpret_cast("system exception"))); } @@ -849,7 +849,7 @@ static void systemf (void * a) static void coroutine (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 768, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 768, 9, const_cast (reinterpret_cast("coroutine")), const_cast (reinterpret_cast("coroutine exception"))); } @@ -859,7 +859,7 @@ static void coroutine (void * a) static void exception (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod")), 780, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast (reinterpret_cast("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod")), 780, 9, const_cast (reinterpret_cast("exception")), const_cast (reinterpret_cast("exception exception"))); } @@ -1178,13 +1178,13 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void) { if (currentEHB == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.mod", 60, 598, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.mod", 53, 598, (const char *) "GetBaseExceptionBlock", 21, (const char *) "currentEHB has not been initialized yet", 39); } else { return currentEHB; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTExceptions.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GRTint.c b/gcc/m2/mc-boot/GRTint.c index 00b0e6bbf53..d8cac277252 100644 --- a/gcc/m2/mc-boot/GRTint.c +++ b/gcc/m2/mc-boot/GRTint.c @@ -595,7 +595,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.def", 25, 1); + CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } v = v->pending; @@ -708,7 +708,7 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) RTco_signal (lock); return v->no; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } @@ -765,7 +765,7 @@ extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, uns v = FindVectorNo (vec); if (v == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 286, (const char *) "ReArmTimeVector", 15, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 286, (const char *) "ReArmTimeVector", 15, (const char *) "cannot find vector supplied", 27); } else { @@ -790,7 +790,7 @@ extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsi v = FindVectorNo (vec); if (v == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 312, (const char *) "GetTimeVector", 13, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 312, (const char *) "GetTimeVector", 13, (const char *) "cannot find vector supplied", 27); } else { @@ -816,7 +816,7 @@ extern "C" void * RTint_AttachVector (unsigned int vec, void * p) v = FindVectorNo (vec); if (v == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 339, (const char *) "AttachVector", 12, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 339, (const char *) "AttachVector", 12, (const char *) "cannot find vector supplied", 27); } else { @@ -830,7 +830,7 @@ extern "C" void * RTint_AttachVector (unsigned int vec, void * p) RTco_signal (lock); return l; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } @@ -855,7 +855,7 @@ extern "C" void RTint_IncludeVector (unsigned int vec) v = FindVectorNo (vec); if (v == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 372, (const char *) "IncludeVector", 13, (const char *) "cannot find vector supplied", 27); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 372, (const char *) "IncludeVector", 13, (const char *) "cannot find vector supplied", 27); } else { @@ -902,7 +902,7 @@ extern "C" void RTint_ExcludeVector (unsigned int vec) v = FindPendingVector (vec); if (v == NULL) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 415, (const char *) "ExcludeVector", 13, (const char *) "cannot find pending vector supplied", 35); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 415, (const char *) "ExcludeVector", 13, (const char *) "cannot find pending vector supplied", 35); } else { @@ -1003,7 +1003,7 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.def", 25, 1); + CaseException ("../../gcc-read-write/gcc/m2/gm2-libs/RTint.def", 25, 1); __builtin_unreachable (); } v = v->pending; @@ -1016,7 +1016,7 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector } if (((untilInterrupt && (i == NULL)) && (o == NULL)) && ! found) { - M2RTS_Halt ((const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/RTint.mod", 53, 731, (const char *) "Listen", 6, (const char *) "deadlock found, no more processes to run and no interrupts active", 65); + M2RTS_Halt ((const char *) "../../gcc-read-write/gcc/m2/gm2-libs/RTint.mod", 46, 731, (const char *) "Listen", 6, (const char *) "deadlock found, no more processes to run and no interrupts active", 65); } /* printf('} ') ; */ diff --git a/gcc/m2/mc-boot/GStdIO.c b/gcc/m2/mc-boot/GStdIO.c index d3891c21c8c..8bb03af9e3e 100644 --- a/gcc/m2/mc-boot/GStdIO.c +++ b/gcc/m2/mc-boot/GStdIO.c @@ -193,7 +193,7 @@ extern "C" StdIO_ProcWrite StdIO_GetCurrentOutput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } @@ -252,7 +252,7 @@ extern "C" StdIO_ProcRead StdIO_GetCurrentInput (void) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StdIO.def", 25, 1); + ReturnException ("../../gcc-read-write/gcc/m2/gm2-libs/StdIO.def", 25, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GStringConvert.c b/gcc/m2/mc-boot/GStringConvert.c index 03b780e7653..8b87e0bda25 100644 --- a/gcc/m2/mc-boot/GStringConvert.c +++ b/gcc/m2/mc-boot/GStringConvert.c @@ -1916,7 +1916,7 @@ extern "C" DynamicStrings_String StringConvert_ToSigFig (DynamicStrings_String s int point; unsigned int poTen; - Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StringConvert.mod", 61, 1222, (const char *) "ToSigFig", 8); + Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1222, (const char *) "ToSigFig", 8); point = DynamicStrings_Index (s, '.', 0); if (point < 0) { @@ -1968,7 +1968,7 @@ extern "C" DynamicStrings_String StringConvert_ToDecimalPlaces (DynamicStrings_S { int point; - Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/StringConvert.mod", 61, 1069, (const char *) "ToDecimalPlaces", 15); + Assert ((IsDigit (DynamicStrings_char (s, 0))) || ((DynamicStrings_char (s, 0)) == '.'), (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/StringConvert.mod", 54, 1069, (const char *) "ToDecimalPlaces", 15); point = DynamicStrings_Index (s, '.', 0); if (point < 0) { diff --git a/gcc/m2/mc-boot/GSysStorage.c b/gcc/m2/mc-boot/GSysStorage.c index db79dd72d22..d5218fb4b42 100644 --- a/gcc/m2/mc-boot/GSysStorage.c +++ b/gcc/m2/mc-boot/GSysStorage.c @@ -93,7 +93,7 @@ extern "C" void SysStorage_ALLOCATE (void * *a, unsigned int size) (*a) = libc_malloc (static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); + Debug_Halt ((const char *) "out of memory error", 19, 50, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { @@ -118,7 +118,7 @@ extern "C" void SysStorage_DEALLOCATE (void * *a, unsigned int size) } if ((libc_memset ((*a), 0, static_cast (size))) != (*a)) { - Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); + Debug_Halt ((const char *) "memset should have returned the first parameter", 47, 76, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } } if (enableDeallocation) @@ -163,7 +163,7 @@ extern "C" void SysStorage_REALLOCATE (void * *a, unsigned int size) (*a) = libc_realloc ((*a), static_cast (size)); if ((*a) == NULL) { - Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-git-devel-modula2/gcc/m2/gm2-libs/SysStorage.mod", 58); + Debug_Halt ((const char *) "out of memory error", 19, 119, (const char *) "../../gcc-read-write/gcc/m2/gm2-libs/SysStorage.mod", 51); } if (enableTrace && trace) { diff --git a/gcc/m2/mc-boot/Gdecl.c b/gcc/m2/mc-boot/Gdecl.c index 985444a43f1..5a92e9ac5eb 100644 --- a/gcc/m2/mc-boot/Gdecl.c +++ b/gcc/m2/mc-boot/Gdecl.c @@ -56,6 +56,7 @@ typedef struct mcPretty_writeLnProc_p mcPretty_writeLnProc; typedef unsigned int FIO_File; extern FIO_File FIO_StdOut; +# define symbolKey_NulKey NULL typedef struct symbolKey_performOperation_p symbolKey_performOperation; # define ASCII_tab ASCII_ht @@ -76,7 +77,6 @@ typedef struct decl_isNodeF_p decl_isNodeF; # define SYSTEM_BYTESPERWORD 4 typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP; -# define symbolKey_NulKey NULL typedef struct symbolKey_isSymbol_p symbolKey_isSymbol; # define ASCII_nul (char) 000 @@ -295,12 +295,12 @@ typedef struct DynamicStrings_stringRecord_r DynamicStrings_stringRecord; typedef struct wlists__T9_r wlists__T9; -typedef struct mcPretty__T12_r mcPretty__T12; - typedef struct DynamicStrings_Contents_r DynamicStrings_Contents; typedef struct DynamicStrings__T7_a DynamicStrings__T7; +typedef struct mcPretty__T12_r mcPretty__T12; + typedef struct wlists__T10_a wlists__T10; typedef Indexing__T5 *Indexing_Index; @@ -836,6 +836,12 @@ struct wlists__T9_r { wlists_wlist next; }; +struct DynamicStrings_Contents_r { + DynamicStrings__T7 buf; + unsigned int len; + DynamicStrings_String next; + }; + struct mcPretty__T12_r { mcPretty_writeProc write_; mcPretty_writeLnProc writeln; @@ -848,12 +854,6 @@ struct mcPretty__T12_r { mcPretty_pretty stacked; }; -struct DynamicStrings_Contents_r { - DynamicStrings__T7 buf; - unsigned int len; - DynamicStrings_String next; - }; - typedef struct DynamicStrings_descriptor_r DynamicStrings_descriptor; typedef DynamicStrings_descriptor *DynamicStrings_Descriptor; @@ -6678,7 +6678,7 @@ static decl_node newNode (decl_nodeT k) d->at.firstUsed = 0; return d; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7038,7 +7038,7 @@ static decl_node addToScope (decl_node n) } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7116,7 +7116,7 @@ static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7399,7 +7399,7 @@ static void putFieldVarient (decl_node f, decl_node v) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } switch (f->kind) @@ -7410,7 +7410,7 @@ static void putFieldVarient (decl_node f, decl_node v) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7437,7 +7437,7 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type, if (tag != nameKey_NulName) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ - if ((symbolKey_getSymKey (r->recordF.localSymbols, tag)) == nameKey_NulName) + if ((symbolKey_getSymKey (r->recordF.localSymbols, tag)) == symbolKey_NulKey) { symbolKey_putSymKey (r->recordF.localSymbols, tag, reinterpret_cast (n)); } @@ -7461,7 +7461,7 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type, default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* fill in, n. */ @@ -7519,7 +7519,7 @@ static void putVarientTag (decl_node v, decl_node tag) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -7543,7 +7543,7 @@ static decl_node getParent (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7571,7 +7571,7 @@ static decl_node getRecord (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7751,7 +7751,7 @@ static unsigned int getConstExpComplete (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7856,7 +7856,7 @@ static decl_node makeVal (decl_node params) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -7877,7 +7877,7 @@ static decl_node makeCast (decl_node c, decl_node p) M2RTS_HALT (-1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -8387,7 +8387,7 @@ static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -8481,7 +8481,7 @@ static DynamicStrings_String getStringContents (decl_node n) } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -8617,7 +8617,7 @@ static decl_node doMakeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return n; @@ -9217,12 +9217,12 @@ static decl_node doGetExprType (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -9361,12 +9361,12 @@ static decl_node getSymScope (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -9678,7 +9678,7 @@ static unsigned int needsParen (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return TRUE; @@ -9787,7 +9787,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -9813,7 +9813,7 @@ static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -10091,7 +10091,7 @@ static decl_node doGetLastOp (decl_node a, decl_node b) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -10731,7 +10731,7 @@ static void doExprC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -10936,7 +10936,7 @@ static void doExprM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -11108,7 +11108,7 @@ static DynamicStrings_String replaceChar (DynamicStrings_String s, char ch, cons return s; } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -11168,7 +11168,7 @@ static unsigned int countChar (DynamicStrings_String s, char ch) return c; } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12227,7 +12227,7 @@ static decl_node doMin (decl_node n) M2RTS_HALT (-1); /* finish the cacading elsif statement. */ __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12308,7 +12308,7 @@ static decl_node doMax (decl_node n) M2RTS_HALT (-1); /* finish the cacading elsif statement. */ __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -12597,7 +12597,7 @@ static void doBaseC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } mcPretty_setNeedSpace (p); @@ -12687,7 +12687,7 @@ static void doSystemC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -16041,7 +16041,7 @@ static void doCreal (mcPretty_pretty p, decl_node t) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -16072,7 +16072,7 @@ static void doCimag (mcPretty_pretty p, decl_node t) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -16203,7 +16203,7 @@ static void doIntrinsicC (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } outText (p, (const char *) ";", 1); @@ -17365,7 +17365,7 @@ static void dbs (decl_dependentState s, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } if (n != NULL) @@ -18258,10 +18258,10 @@ static decl_dependentState doDependants (alists_alist l, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -18358,7 +18358,7 @@ static void visitIntrinsicFunction (alists_alist v, decl_node n, decl_nodeProced default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -19357,7 +19357,7 @@ static void visitDependants (alists_alist v, decl_node n, decl_nodeProcedure p) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -19704,12 +19704,12 @@ static DynamicStrings_String genKind (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -20884,7 +20884,7 @@ static void doBaseM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } mcPretty_setNeedSpace (p); @@ -20910,7 +20910,7 @@ static void doSystemM2 (mcPretty_pretty p, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22121,10 +22121,10 @@ static decl_node doDupExpr (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -22454,7 +22454,7 @@ extern "C" unsigned int decl_isVisited (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -22484,7 +22484,7 @@ extern "C" void decl_unsetVisited (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22512,7 +22512,7 @@ extern "C" void decl_setVisited (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22540,7 +22540,7 @@ extern "C" void decl_setEnumsComplete (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -22568,7 +22568,7 @@ extern "C" unsigned int decl_getEnumsComplete (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -22789,7 +22789,7 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -23164,12 +23164,12 @@ extern "C" decl_node decl_getType (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } M2RTS_HALT (-1); __builtin_unreachable (); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -23563,7 +23563,7 @@ extern "C" decl_node decl_getScope (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -24218,7 +24218,7 @@ extern "C" decl_node decl_makeVarient (decl_node r) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } return n; @@ -24685,7 +24685,7 @@ extern "C" nameKey_Name decl_getSymName (decl_node n) __builtin_unreachable (); break; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -24723,7 +24723,7 @@ extern "C" decl_node decl_import (decl_node m, decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } importEnumFields (m, n); @@ -24852,7 +24852,7 @@ extern "C" void decl_setSource (decl_node n, nameKey_Name s) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -24880,7 +24880,7 @@ extern "C" nameKey_Name decl_getSource (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } /* static analysis guarentees a RETURN statement will be used before here. */ @@ -25323,7 +25323,7 @@ extern "C" void decl_addParameter (decl_node proc, decl_node param) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -25416,7 +25416,7 @@ extern "C" decl_node decl_makeBinaryTok (mcReserved_toktype op, decl_node l, dec M2RTS_HALT (-1); /* most likely op needs a clause as above. */ __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -25448,7 +25448,7 @@ extern "C" decl_node decl_makeUnaryTok (mcReserved_toktype op, decl_node e) M2RTS_HALT (-1); /* most likely op needs a clause as above. */ __builtin_unreachable (); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } @@ -25886,7 +25886,7 @@ extern "C" void decl_setConstExpComplete (decl_node n) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26251,7 +26251,7 @@ extern "C" void decl_putBegin (decl_node b, decl_node s) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26278,7 +26278,7 @@ extern "C" void decl_putFinally (decl_node b, decl_node s) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } } @@ -26906,7 +26906,7 @@ extern "C" void decl_out (void) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/decl.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/decl.def", 20, 1); __builtin_unreachable (); } closeOutput (); diff --git a/gcc/m2/mc-boot/Gkeyc.c b/gcc/m2/mc-boot/Gkeyc.c index 1b2fb978692..6f17ca5d3a1 100644 --- a/gcc/m2/mc-boot/Gkeyc.c +++ b/gcc/m2/mc-boot/Gkeyc.c @@ -908,7 +908,7 @@ static unsigned int mangleN (nameKey_Name n, DynamicStrings_String *m, unsigned return TRUE; } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/keyc.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/keyc.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GmcComment.c b/gcc/m2/mc-boot/GmcComment.c index 88f5de00f5c..4dfad51f4a8 100644 --- a/gcc/m2/mc-boot/GmcComment.c +++ b/gcc/m2/mc-boot/GmcComment.c @@ -257,7 +257,7 @@ static void dumpComment (mcComment_commentDesc cd) default: - CaseException ("../../gcc-git-devel-modula2/gcc/m2/mc/mcComment.def", 20, 1); + CaseException ("../../gcc-read-write/gcc/m2/mc/mcComment.def", 20, 1); __builtin_unreachable (); } if (cd->used) diff --git a/gcc/m2/mc-boot/GmcComp.c b/gcc/m2/mc-boot/GmcComp.c index d633e792927..e6b4e35bffe 100644 --- a/gcc/m2/mc-boot/GmcComp.c +++ b/gcc/m2/mc-boot/GmcComp.c @@ -294,7 +294,7 @@ static decl_node examineCompilationUnit (void) } mcflex_mcError (DynamicStrings_string (DynamicStrings_InitString ((const char *) "failed to find module name", 26))); libc_exit (1); - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/mcComp.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1); __builtin_unreachable (); } @@ -324,7 +324,7 @@ static decl_node peepInto (DynamicStrings_String s) mcPrintf_fprintf1 (FIO_StdErr, (const char *) "failed to open %s\\n", 19, (const unsigned char *) &s, (sizeof (s)-1)); libc_exit (1); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/mcComp.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcComp.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GmcDebug.c b/gcc/m2/mc-boot/GmcDebug.c index 3c471965c40..8cac40ea033 100644 --- a/gcc/m2/mc-boot/GmcDebug.c +++ b/gcc/m2/mc-boot/GmcDebug.c @@ -54,7 +54,7 @@ extern "C" void mcDebug_assert (unsigned int q) { if (! q) { - mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/mcDebug.mod", 49, 35); + mcError_internalError ((const char *) "assert failed", 13, (const char *) "../../gcc-read-write/gcc/m2/mc/mcDebug.mod", 42, 35); } } diff --git a/gcc/m2/mc-boot/GmcMetaError.c b/gcc/m2/mc-boot/GmcMetaError.c index 0c4aaf90a53..3073e62139a 100644 --- a/gcc/m2/mc-boot/GmcMetaError.c +++ b/gcc/m2/mc-boot/GmcMetaError.c @@ -408,7 +408,7 @@ static void internalFormat (DynamicStrings_String s, int i, const char *m_, unsi s = DynamicStrings_ConCatChar (s, '^'); s = SFIO_WriteS (FIO_StdOut, s); FIO_WriteLine (FIO_StdOut); - mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/mcMetaError.mod", 53, 97); + mcError_internalError ((const char *) m, _m_high, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 97); } @@ -420,7 +420,7 @@ static DynamicStrings_String x (DynamicStrings_String a, DynamicStrings_String b { if (a != b) { - mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/mcMetaError.mod", 53, 109); + mcError_internalError ((const char *) "different string returned", 25, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 109); } return a; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -734,7 +734,7 @@ static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned case mcMetaError_chained: if (e == NULL) { - mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/mcMetaError.mod", 53, 355); + mcError_internalError ((const char *) "should not be chaining an error onto an empty error note", 56, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 355); } else { @@ -758,7 +758,7 @@ static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned default: - mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/mcMetaError.mod", 53, 369); + mcError_internalError ((const char *) "unexpected enumeration value", 28, (const char *) "../../gcc-read-write/gcc/m2/mc/mcMetaError.mod", 46, 369); break; } return e; diff --git a/gcc/m2/mc-boot/GmcOptions.c b/gcc/m2/mc-boot/GmcOptions.c index 42717cf9588..3088ba49bf3 100644 --- a/gcc/m2/mc-boot/GmcOptions.c +++ b/gcc/m2/mc-boot/GmcOptions.c @@ -50,7 +50,6 @@ Boston, MA 02110-1301, USA. */ # include "GFIO.h" # include "GSFIO.h" -# define YEAR "2021" static unsigned int langC; static unsigned int langCPP; static unsigned int langM2; @@ -171,6 +170,12 @@ extern "C" unsigned int mcOptions_getScaffoldMain (void); extern "C" void mcOptions_writeGPLheader (FIO_File f); +/* + getYear - return the year. +*/ + +static unsigned int getYear (void); + /* displayVersion - displays the version of the compiler. */ @@ -293,14 +298,34 @@ static void setLang (DynamicStrings_String arg); static void handleOption (DynamicStrings_String arg); +/* + getYear - return the year. +*/ + +static unsigned int getYear (void) +{ + libc_time_t epoch; + libc_ptrToTM localTime; + + epoch = libc_time (NULL); + localTime = static_cast (libc_localtime (&epoch)); + return localTime->tm_year+1900; + /* static analysis guarentees a RETURN statement will be used before here. */ + __builtin_unreachable (); +} + + /* displayVersion - displays the version of the compiler. */ static void displayVersion (unsigned int mustExit) { - mcPrintf_printf0 ((const char *) "Copyright (C) ''2021'' Free Software Foundation, Inc.\\n", 55); - mcPrintf_printf0 ((const char *) "License GPLv2: GNU GPL version 2 or later \\n", 78); + unsigned int year; + + year = getYear (); + mcPrintf_printf1 ((const char *) "Copyright (C) %d Free Software Foundation, Inc.\\n", 49, (const unsigned char *) &year, (sizeof (year)-1)); + mcPrintf_printf0 ((const char *) "License GPLv3: GNU GPL version 3 or later \\n", 78); mcPrintf_printf0 ((const char *) "This is free software: you are free to change and redistribute it.\\n", 68); mcPrintf_printf0 ((const char *) "There is NO WARRANTY, to the extent permitted by law.\\n", 55); if (mustExit) @@ -424,7 +449,10 @@ static void commentS (FIO_File f, DynamicStrings_String s) static void gplBody (FIO_File f) { - comment (f, (const char *) "Copyright (C) ''2021'' Free Software Foundation, Inc.", 53); + unsigned int year; + + year = getYear (); + mcPrintf_printf1 ((const char *) "Copyright (C) %d Free Software Foundation, Inc.\\n", 49, (const unsigned char *) &year, (sizeof (year)-1)); if (contributed) { FIO_WriteString (f, (const char *) "Contributed by ", 15); @@ -464,7 +492,10 @@ static void gplBody (FIO_File f) static void glplBody (FIO_File f) { - comment (f, (const char *) "Copyright (C) ''2021'' Free Software Foundation, Inc.", 53); + unsigned int year; + + year = getYear (); + mcPrintf_printf1 ((const char *) "Copyright (C) %d Free Software Foundation, Inc.\\n", 49, (const unsigned char *) &year, (sizeof (year)-1)); if (contributed) { FIO_WriteString (f, (const char *) "Contributed by ", 15); diff --git a/gcc/m2/mc-boot/GmcStack.c b/gcc/m2/mc-boot/GmcStack.c index 83fecdadb65..a1f13d8f19c 100644 --- a/gcc/m2/mc-boot/GmcStack.c +++ b/gcc/m2/mc-boot/GmcStack.c @@ -165,7 +165,7 @@ extern "C" void * mcStack_pop (mcStack_stack s) Indexing_DeleteIndice (s->list, Indexing_HighIndice (s->list)); return a; } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/mcStack.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1); __builtin_unreachable (); } @@ -215,7 +215,7 @@ extern "C" void * mcStack_access (mcStack_stack s, unsigned int i) { return Indexing_GetIndice (s->list, i); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/mcStack.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/mcStack.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GnameKey.c b/gcc/m2/mc-boot/GnameKey.c index 22eac972638..11cb6fa92e4 100644 --- a/gcc/m2/mc-boot/GnameKey.c +++ b/gcc/m2/mc-boot/GnameKey.c @@ -323,7 +323,7 @@ extern "C" nameKey_Name nameKey_makeKey (const char *a_, unsigned int _a_high) (*p) = ASCII_nul; return doMakeKey (n, higha); } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/nameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1); __builtin_unreachable (); } @@ -373,7 +373,7 @@ extern "C" nameKey_Name nameKey_makekey (void * a) return doMakeKey (n, higha); } } - ReturnException ("../../gcc-git-devel-modula2/gcc/m2/mc/nameKey.def", 20, 1); + ReturnException ("../../gcc-read-write/gcc/m2/mc/nameKey.def", 20, 1); __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GsymbolKey.c b/gcc/m2/mc-boot/GsymbolKey.c index 2f3295bfabc..e72133ea3fd 100644 --- a/gcc/m2/mc-boot/GsymbolKey.c +++ b/gcc/m2/mc-boot/GsymbolKey.c @@ -142,7 +142,7 @@ static void findNodeAndParentInTree (symbolKey_symbolTree t, nameKey_Name n, sym (*father) = t; if (t == NULL) { - Debug_Halt ((const char *) "parameter t should never be NIL", 31, 203, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/symbolKey.mod", 51); + Debug_Halt ((const char *) "parameter t should never be NIL", 31, 203, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } (*child) = t->left; if ((*child) != NULL) @@ -285,7 +285,7 @@ extern "C" void symbolKey_putSymKey (symbolKey_symbolTree t, nameKey_Name name, } else { - Debug_Halt ((const char *) "symbol already stored", 21, 119, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/symbolKey.mod", 51); + Debug_Halt ((const char *) "symbol already stored", 21, 119, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } } @@ -352,7 +352,7 @@ extern "C" void symbolKey_delSymKey (symbolKey_symbolTree t, nameKey_Name name) } else { - Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 186, (const char *) "../../gcc-git-devel-modula2/gcc/m2/mc/symbolKey.mod", 51); + Debug_Halt ((const char *) "trying to delete a symbol that is not in the tree - the compiler never expects this to occur", 92, 186, (const char *) "../../gcc-read-write/gcc/m2/mc/symbolKey.mod", 44); } } diff --git a/gcc/m2/mc/decl.mod b/gcc/m2/mc/decl.mod index 738f66f37bd..f6afd666eb6 100644 --- a/gcc/m2/mc/decl.mod +++ b/gcc/m2/mc/decl.mod @@ -22,7 +22,7 @@ along with GNU Modula-2; see the file COPYING3. If not see IMPLEMENTATION MODULE decl ; (*!m2pim*) FROM ASCII IMPORT lf, tab ; -FROM symbolKey IMPORT symbolTree, initTree, getSymKey, putSymKey, foreachNodeDo ; +FROM symbolKey IMPORT NulKey, symbolTree, initTree, getSymKey, putSymKey, foreachNodeDo ; FROM mcDebug IMPORT assert ; FROM Storage IMPORT ALLOCATE, DEALLOCATE ; FROM nameKey IMPORT NulName, makeKey, lengthKey, makekey, keyToCharStar ; @@ -2936,7 +2936,7 @@ BEGIN (* ensure that field, n, is in the parents Local Symbols. *) IF tag#NulName THEN - IF getSymKey (recordF.localSymbols, tag) = NulName + IF getSymKey (recordF.localSymbols, tag) = NulKey THEN putSymKey (recordF.localSymbols, tag, n) ELSE diff --git a/gcc/m2/mc/mcOptions.mod b/gcc/m2/mc/mcOptions.mod index d84ce2bd612..3204b68d79a 100644 --- a/gcc/m2/mc/mcOptions.mod +++ b/gcc/m2/mc/mcOptions.mod @@ -20,8 +20,8 @@ IMPLEMENTATION MODULE mcOptions ; FROM SArgs IMPORT GetArg, Narg ; FROM mcSearch IMPORT prependSearchPath ; -FROM libc IMPORT exit, printf ; -FROM mcPrintf IMPORT printf0 ; +FROM libc IMPORT exit, printf, time, localtime, time_t, ptrToTM ; +FROM mcPrintf IMPORT printf0, printf1 ; FROM Debug IMPORT Halt ; FROM StrLib IMPORT StrLen ; FROM decl IMPORT setLangC, setLangCP, setLangM2 ; @@ -33,9 +33,6 @@ FROM DynamicStrings IMPORT String, Length, InitString, Mark, Slice, EqualArray, IMPORT FIO ; IMPORT SFIO ; -CONST - YEAR = '2023' ; - VAR langC, langCPP, @@ -65,13 +62,32 @@ VAR cppProgram : String ; + +(* + getYear - return the year. +*) + +PROCEDURE getYear () : CARDINAL ; +VAR + epoch : time_t ; + localTime: ptrToTM ; +BEGIN + epoch := time (NIL) ; + localTime := localtime (epoch) ; + RETURN localTime^.tm_year + 1900 +END getYear ; + + (* displayVersion - displays the version of the compiler. *) PROCEDURE displayVersion (mustExit: BOOLEAN) ; +VAR + year: CARDINAL ; BEGIN - printf0 ('Copyright (C) ' + YEAR + ' Free Software Foundation, Inc.\n') ; + year := getYear () ; + printf1 ('Copyright (C) %d Free Software Foundation, Inc.\n', year) ; printf0 ('License GPLv3: GNU GPL version 3 or later \n') ; printf0 ('This is free software: you are free to change and redistribute it.\n') ; printf0 ('There is NO WARRANTY, to the extent permitted by law.\n') ; @@ -183,8 +199,11 @@ END commentS ; *) PROCEDURE gplBody (f: File) ; +VAR + year: CARDINAL ; BEGIN - comment (f, 'Copyright (C) ' + YEAR + ' Free Software Foundation, Inc.') ; + year := getYear () ; + printf1 ('Copyright (C) %d Free Software Foundation, Inc.\n', year) ; IF contributed THEN FIO.WriteString (f, "Contributed by ") ; @@ -222,8 +241,11 @@ END gplBody ; *) PROCEDURE glplBody (f: File) ; +VAR + year: CARDINAL ; BEGIN - comment (f, 'Copyright (C) ' + YEAR + ' Free Software Foundation, Inc.') ; + year := getYear () ; + printf1 ('Copyright (C) %d Free Software Foundation, Inc.\n', year) ; IF contributed THEN FIO.WriteString (f, "Contributed by ") ;