From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id B1791382DAC2; Sun, 18 Sep 2022 06:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1791382DAC2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663483970; bh=OWN2Uc0NFMtutr6DBfd9+YAYrTSO7vBygqy6xmx+fZc=; h=From:To:Subject:Date:From; b=nvotspZOLYkbjt9Vv4y1XaCKyaqxI30MsQJfdcB917axDn0AsVPqJp/RhZZ68iBNW aexDFMbIlhoPdQ6Rw29Qs5aTbavKlAoaIdI/vd/B+DjxoB6+RWkQPr0BsI0DI8bysj Cnfu+ykKN9FgJOZ00LA011oMC9LaS5Ya0c839Rw0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] Force qualification of type names while bootstrapping. X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: 206c4f77604af6b6d2b5986d7782fe8604529d92 X-Git-Newrev: c7ddd74ac004ffb9e1215befdc8077a957c0d5b1 Message-Id: <20220918065250.B1791382DAC2@sourceware.org> Date: Sun, 18 Sep 2022 06:52:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c7ddd74ac004ffb9e1215befdc8077a957c0d5b1 commit c7ddd74ac004ffb9e1215befdc8077a957c0d5b1 Author: Gaius Mulley Date: Sun Sep 18 00:47:27 2022 +0100 Force qualification of type names while bootstrapping. Force qualification of types generated by mc during bootstrap. Also remove ACX_NONCANONICAL_HOST and ACX_NONCANONICAL_TARGET from configure.ac. gcc/m2/ChangeLog: * configure: Rebuilt. * configure.ac (ACX_NONCANONICAL_HOST): Removed. (ACX_NONCANONICAL_TARGET) Removed. * mc/decl.mod (forceQualified): New constant. (isQualifiedForced) New procedure function. (getFQstring) check isQualifiedForced. (getFQDstring) check isQualifiedForced. * mc-boot/GArgs.c: Rebuilt. * mc-boot/GCmdArgs.c: Rebuilt. * mc-boot/GDebug.c: Rebuilt. * mc-boot/GDynamicStrings.c: Rebuilt. * mc-boot/GEnvironment.c: Rebuilt. * mc-boot/GFIO.c: Rebuilt. * mc-boot/GFpuIO.c: Rebuilt. * mc-boot/GIO.c: Rebuilt. * mc-boot/GIndexing.c: Rebuilt. * mc-boot/GM2Dependent.c: Rebuilt. * mc-boot/GM2RTS.c: Rebuilt. * mc-boot/GMemUtils.c: Rebuilt. * mc-boot/GNumberIO.c: Rebuilt. * mc-boot/GPushBackInput.c: Rebuilt. * mc-boot/GRTExceptions.c: Rebuilt. * mc-boot/GRTint.c: Rebuilt. * mc-boot/GSArgs.c: Rebuilt. * mc-boot/GStdIO.c: Rebuilt. * mc-boot/GTimeString.c: Rebuilt. * mc-boot/Galists.c: Rebuilt. * mc-boot/Gdecl.c: Rebuilt. * mc-boot/Gkeyc.c: Rebuilt. * mc-boot/Glists.c: Rebuilt. * mc-boot/GmcComment.c: Rebuilt. * mc-boot/GmcComp.c: Rebuilt. * mc-boot/GmcError.c: Rebuilt. * mc-boot/GmcLexBuf.c: Rebuilt. * mc-boot/GmcMetaError.c: Rebuilt. * mc-boot/GmcPretty.c: Rebuilt. * mc-boot/GmcStack.c: Rebuilt. * mc-boot/GmcStream.c: Rebuilt. * mc-boot/Gmcp1.c: Rebuilt. * mc-boot/Gmcp2.c: Rebuilt. * mc-boot/Gmcp3.c: Rebuilt. * mc-boot/Gmcp4.c: Rebuilt. * mc-boot/Gmcp5.c: Rebuilt. * mc-boot/GnameKey.c: Rebuilt. * mc-boot/GsymbolKey.c: Rebuilt. * mc-boot/Gvarargs.c: Rebuilt. * mc-boot/Gwlists.c: Rebuilt. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/configure.ac | 6 - gcc/m2/mc-boot/GArgs.c | 14 +- gcc/m2/mc-boot/GCmdArgs.c | 6 +- gcc/m2/mc-boot/GDebug.c | 6 +- gcc/m2/mc-boot/GDynamicStrings.c | 178 +- gcc/m2/mc-boot/GEnvironment.c | 6 +- gcc/m2/mc-boot/GFIO.c | 356 +-- gcc/m2/mc-boot/GFpuIO.c | 36 +- gcc/m2/mc-boot/GIO.c | 16 +- gcc/m2/mc-boot/GIndexing.c | 70 +- gcc/m2/mc-boot/GM2Dependent.c | 212 +- gcc/m2/mc-boot/GM2RTS.c | 52 +- gcc/m2/mc-boot/GMemUtils.c | 32 +- gcc/m2/mc-boot/GNumberIO.c | 90 +- gcc/m2/mc-boot/GPushBackInput.c | 18 +- gcc/m2/mc-boot/GRTExceptions.c | 112 +- gcc/m2/mc-boot/GRTint.c | 118 +- gcc/m2/mc-boot/GSArgs.c | 8 +- gcc/m2/mc-boot/GStdIO.c | 12 +- gcc/m2/mc-boot/GTimeString.c | 6 +- gcc/m2/mc-boot/Galists.c | 24 +- gcc/m2/mc-boot/Gdecl.c | 5418 +++++++++++++++++++------------------- gcc/m2/mc-boot/Gkeyc.c | 30 +- gcc/m2/mc-boot/Glists.c | 24 +- gcc/m2/mc-boot/GmcComment.c | 46 +- gcc/m2/mc-boot/GmcComp.c | 42 +- gcc/m2/mc-boot/GmcError.c | 36 +- gcc/m2/mc-boot/GmcLexBuf.c | 168 +- gcc/m2/mc-boot/GmcMetaError.c | 76 +- gcc/m2/mc-boot/GmcPretty.c | 32 +- gcc/m2/mc-boot/GmcStack.c | 16 +- gcc/m2/mc-boot/GmcStream.c | 14 +- gcc/m2/mc-boot/Gmcp1.c | 1620 ++++++------ gcc/m2/mc-boot/Gmcp2.c | 1712 ++++++------ gcc/m2/mc-boot/Gmcp3.c | 1516 +++++------ gcc/m2/mc-boot/Gmcp4.c | 1606 +++++------ gcc/m2/mc-boot/Gmcp5.c | 1564 +++++------ gcc/m2/mc-boot/GnameKey.c | 108 +- gcc/m2/mc-boot/GsymbolKey.c | 30 +- gcc/m2/mc-boot/Gvarargs.c | 92 +- gcc/m2/mc-boot/Gwlists.c | 24 +- gcc/m2/mc/decl.mod | 34 +- 42 files changed, 7827 insertions(+), 7759 deletions(-) diff --git a/gcc/m2/configure.ac b/gcc/m2/configure.ac index 9f0e8376156..1c5c9f66a3c 100644 --- a/gcc/m2/configure.ac +++ b/gcc/m2/configure.ac @@ -24,12 +24,6 @@ AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET -# Determine the noncanonical host name, for Modula-2. -ACX_NONCANONICAL_HOST - -# Determine the noncanonical target name, for directory use. -ACX_NONCANONICAL_TARGET - AC_CHECK_PROGS(regex_flex, flex) if test x$regex_flex = "x" ; then AC_MSG_ERROR([flex is required to build GNU Modula-2 (hint install flex).]) diff --git a/gcc/m2/mc-boot/GArgs.c b/gcc/m2/mc-boot/GArgs.c index 70464ef55c8..a25fa9bfde4 100644 --- a/gcc/m2/mc-boot/GArgs.c +++ b/gcc/m2/mc-boot/GArgs.c @@ -41,15 +41,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define MaxArgs 255 # define MaxString 4096 -typedef struct _T2_a _T2; +typedef struct Args__T2_a Args__T2; -typedef _T2 *_T1; +typedef Args__T2 *Args__T1; -typedef struct _T3_a _T3; +typedef struct Args__T3_a Args__T3; -struct _T2_a { _T3 * array[MaxArgs+1]; }; -struct _T3_a { char array[MaxString+1]; }; -static _T1 Source; +struct Args__T2_a { Args__T3 * array[MaxArgs+1]; }; +struct Args__T3_a { char array[MaxString+1]; }; +static Args__T1 Source; /* GetArg - returns the nth argument from the command line. @@ -82,7 +82,7 @@ extern "C" unsigned int Args_GetArg (char *a, unsigned int _a_high, unsigned int High = _a_high; if (i < (UnixArgs_GetArgC ())) { - Source = static_cast<_T1> (UnixArgs_GetArgV ()); + Source = static_cast (UnixArgs_GetArgV ()); while (((*(*Source).array[i]).array[j] != ASCII_nul) && (j < High)) { a[j] = (*(*Source).array[i]).array[j]; diff --git a/gcc/m2/mc-boot/GCmdArgs.c b/gcc/m2/mc-boot/GCmdArgs.c index f4c5cf4c27c..d3881e48227 100644 --- a/gcc/m2/mc-boot/GCmdArgs.c +++ b/gcc/m2/mc-boot/GCmdArgs.c @@ -287,10 +287,10 @@ extern "C" unsigned int CmdArgs_GetArg (const char *CmdLine_, unsigned int _CmdL extern "C" unsigned int CmdArgs_Narg (const char *CmdLine_, unsigned int _CmdLine_high) { - typedef struct _T1_a _T1; + typedef struct Narg__T1_a Narg__T1; - struct _T1_a { char array[1000+1]; }; - _T1 a; + struct Narg__T1_a { char array[1000+1]; }; + Narg__T1 a; unsigned int ArgNo; char CmdLine[_CmdLine_high+1]; diff --git a/gcc/m2/mc-boot/GDebug.c b/gcc/m2/mc-boot/GDebug.c index f42fbc7ee65..2f2bf82f7fe 100644 --- a/gcc/m2/mc-boot/GDebug.c +++ b/gcc/m2/mc-boot/GDebug.c @@ -90,10 +90,10 @@ static void WriteLn (void) extern "C" void Debug_Halt (const char *Message_, unsigned int _Message_high, unsigned int LineNo, const char *Module_, unsigned int _Module_high) { - typedef struct _T1_a _T1; + typedef struct Halt__T1_a Halt__T1; - struct _T1_a { char array[MaxNoOfDigits+1]; }; - _T1 No; + struct Halt__T1_a { char array[MaxNoOfDigits+1]; }; + Halt__T1 No; char Message[_Message_high+1]; char Module[_Module_high+1]; diff --git a/gcc/m2/mc-boot/GDynamicStrings.c b/gcc/m2/mc-boot/GDynamicStrings.c index e3b75d3bbdc..23ed7fbfbff 100644 --- a/gcc/m2/mc-boot/GDynamicStrings.c +++ b/gcc/m2/mc-boot/GDynamicStrings.c @@ -62,63 +62,63 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define DebugOn FALSE # define CheckOn FALSE # define TraceOn FALSE -typedef struct Contents_r Contents; +typedef struct DynamicStrings_Contents_r DynamicStrings_Contents; -typedef struct DebugInfo_r DebugInfo; +typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo; -typedef struct stringRecord_r stringRecord; +typedef struct DynamicStrings_stringRecord_r DynamicStrings_stringRecord; -typedef struct descriptor_r descriptor; +typedef struct DynamicStrings_descriptor_r DynamicStrings_descriptor; -typedef descriptor *Descriptor; +typedef DynamicStrings_descriptor *DynamicStrings_Descriptor; -typedef struct frameRec_r frameRec; +typedef struct DynamicStrings_frameRec_r DynamicStrings_frameRec; -typedef frameRec *frame; +typedef DynamicStrings_frameRec *DynamicStrings_frame; -typedef struct _T3_a _T3; +typedef struct DynamicStrings__T3_a DynamicStrings__T3; -typedef enum {inuse, marked, onlist, poisoned} desState; +typedef enum {DynamicStrings_inuse, DynamicStrings_marked, DynamicStrings_onlist, DynamicStrings_poisoned} DynamicStrings_desState; -typedef stringRecord *DynamicStrings_String; +typedef DynamicStrings_stringRecord *DynamicStrings_String; -struct DebugInfo_r { - DynamicStrings_String next; - void *file; - unsigned int line; - void *proc; - }; +struct DynamicStrings_DebugInfo_r { + DynamicStrings_String next; + void *file; + unsigned int line; + void *proc; + }; -struct descriptor_r { - unsigned int charStarUsed; - void *charStar; - unsigned int charStarSize; - unsigned int charStarValid; - desState state; - DynamicStrings_String garbage; - }; +struct DynamicStrings_descriptor_r { + unsigned int charStarUsed; + void *charStar; + unsigned int charStarSize; + unsigned int charStarValid; + DynamicStrings_desState state; + DynamicStrings_String garbage; + }; -struct frameRec_r { - DynamicStrings_String alloc; - DynamicStrings_String dealloc; - frame next; - }; +struct DynamicStrings_frameRec_r { + DynamicStrings_String alloc; + DynamicStrings_String dealloc; + DynamicStrings_frame next; + }; -struct _T3_a { char array[(MaxBuf-1)+1]; }; -struct Contents_r { - _T3 buf; - unsigned int len; - DynamicStrings_String next; - }; +struct DynamicStrings__T3_a { char array[(MaxBuf-1)+1]; }; +struct DynamicStrings_Contents_r { + DynamicStrings__T3 buf; + unsigned int len; + DynamicStrings_String next; + }; -struct stringRecord_r { - Contents contents; - Descriptor head; - DebugInfo debug; - }; +struct DynamicStrings_stringRecord_r { + DynamicStrings_Contents contents; + DynamicStrings_Descriptor head; + DynamicStrings_DebugInfo debug; + }; static unsigned int Initialized; -static frame frameHead; +static DynamicStrings_frame frameHead; static DynamicStrings_String captured; /* @@ -550,7 +550,7 @@ static void AddDebugInfo (DynamicStrings_String s); total length of, a. The offset is in, o. */ -static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o); +static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o); /* DeallocateCharStar - deallocates any charStar. @@ -575,7 +575,7 @@ static void MarkInvalid (DynamicStrings_String s); total length of, a. */ -static void ConcatContentsAddress (Contents *c, void * a, unsigned int h); +static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigned int h); /* AddToGarbage - adds String, b, onto the garbage list of, a. Providing @@ -637,21 +637,21 @@ static void writeStringDesc (DynamicStrings_String s) writeString ((const char *) " ", 1); switch (s->head->state) { - case inuse: + case DynamicStrings_inuse: writeString ((const char *) "still in use (", 14); writeCard (s->contents.len); writeString ((const char *) ") characters", 12); break; - case marked: + case DynamicStrings_marked: writeString ((const char *) "marked", 6); break; - case onlist: + case DynamicStrings_onlist: writeString ((const char *) "on a (lost) garbage list", 24); break; - case poisoned: + case DynamicStrings_poisoned: writeString ((const char *) "poisoned", 8); break; @@ -1049,7 +1049,7 @@ static void AddDeallocated (DynamicStrings_String s) static unsigned int IsOnAllocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1075,7 +1075,7 @@ static unsigned int IsOnAllocated (DynamicStrings_String s) static unsigned int IsOnDeallocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1101,7 +1101,7 @@ static unsigned int IsOnDeallocated (DynamicStrings_String s) static void SubAllocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1125,7 +1125,7 @@ static void SubAllocated (DynamicStrings_String s) static void SubDeallocated (DynamicStrings_String s) { - frame f; + DynamicStrings_frame f; Init (); f = frameHead; @@ -1190,7 +1190,7 @@ static void AddDebugInfo (DynamicStrings_String s) total length of, a. The offset is in, o. */ -static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o) +static void ConcatContents (DynamicStrings_Contents *c, const char *a_, unsigned int _a_high, unsigned int h, unsigned int o) { unsigned int i; char a[_a_high+1]; @@ -1208,7 +1208,7 @@ static void ConcatContents (Contents *c, const char *a_, unsigned int _a_high, u if (o < h) { (*c).len = MaxBuf; - Storage_ALLOCATE ((void **) &(*c).next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &(*c).next, sizeof (DynamicStrings_stringRecord)); (*c).next->head = NULL; (*c).next->contents.len = 0; (*c).next->contents.next = NULL; @@ -1249,7 +1249,7 @@ static void DeallocateCharStar (DynamicStrings_String s) static DynamicStrings_String CheckPoisoned (DynamicStrings_String s) { - if (((PoisonOn && (s != NULL)) && (s->head != NULL)) && (s->head->state == poisoned)) + if (((PoisonOn && (s != NULL)) && (s->head != NULL)) && (s->head->state == DynamicStrings_poisoned)) { M2RTS_HALT (-1); __builtin_unreachable (); @@ -1282,17 +1282,17 @@ static void MarkInvalid (DynamicStrings_String s) total length of, a. */ -static void ConcatContentsAddress (Contents *c, void * a, unsigned int h) +static void ConcatContentsAddress (DynamicStrings_Contents *c, void * a, unsigned int h) { - typedef char *_T1; + typedef char *ConcatContentsAddress__T1; - _T1 p; + ConcatContentsAddress__T1 p; unsigned int i; unsigned int j; j = 0; i = (*c).len; - p = static_cast<_T1> (a); + p = static_cast (a); while ((j < h) && (i < MaxBuf)) { (*c).buf.array[i] = (*p); @@ -1304,7 +1304,7 @@ static void ConcatContentsAddress (Contents *c, void * a, unsigned int h) { /* avoid dangling else. */ (*c).len = MaxBuf; - Storage_ALLOCATE ((void **) &(*c).next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &(*c).next, sizeof (DynamicStrings_stringRecord)); (*c).next->head = NULL; (*c).next->contents.len = 0; (*c).next->contents.next = NULL; @@ -1344,7 +1344,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin writeString('warning trying to add to a marked string') ; writeLn END ; */ - if (((((a != b) && (a != NULL)) && (b != NULL)) && (b->head->state == marked)) && (a->head->state == inuse)) + if (((((a != b) && (a != NULL)) && (b != NULL)) && (b->head->state == DynamicStrings_marked)) && (a->head->state == DynamicStrings_inuse)) { c = a; while (c->head->garbage != NULL) @@ -1352,7 +1352,7 @@ static DynamicStrings_String AddToGarbage (DynamicStrings_String a, DynamicStrin c = c->head->garbage; } c->head->garbage = b; - b->head->state = onlist; + b->head->state = DynamicStrings_onlist; if (CheckOn) { SubDebugInfo (b); @@ -1410,21 +1410,21 @@ static void DumpState (DynamicStrings_String s) { switch (s->head->state) { - case inuse: + case DynamicStrings_inuse: writeString ((const char *) "still in use (", 14); writeCard (s->contents.len); writeString ((const char *) ") characters", 12); break; - case marked: + case DynamicStrings_marked: writeString ((const char *) "marked", 6); break; - case onlist: + case DynamicStrings_onlist: writeString ((const char *) "on a garbage list", 17); break; - case poisoned: + case DynamicStrings_poisoned: writeString ((const char *) "poisoned", 8); break; @@ -1523,17 +1523,17 @@ extern "C" DynamicStrings_String DynamicStrings_InitString (const char *a_, unsi /* make a local copy of each unbounded array. */ memcpy (a, a_, _a_high+1); - Storage_ALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); s->contents.len = 0; s->contents.next = NULL; ConcatContents (&s->contents, (const char *) a, _a_high, StrLib_StrLen ((const char *) a, _a_high), 0); - Storage_ALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head->charStarUsed = FALSE; s->head->charStar = NULL; s->head->charStarSize = 0; s->head->charStarValid = FALSE; s->head->garbage = NULL; - s->head->state = inuse; + s->head->state = DynamicStrings_inuse; AddDebugInfo (s); if (TraceOn) { @@ -1575,7 +1575,7 @@ extern "C" DynamicStrings_String DynamicStrings_KillString (DynamicStrings_Strin } if (s->head != NULL) { - s->head->state = poisoned; + s->head->state = DynamicStrings_poisoned; s->head->garbage = DynamicStrings_KillString (s->head->garbage); if (! PoisonOn) { @@ -1583,14 +1583,14 @@ extern "C" DynamicStrings_String DynamicStrings_KillString (DynamicStrings_Strin } if (! PoisonOn) { - Storage_DEALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_DEALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head = NULL; } } t = DynamicStrings_KillString (s->contents.next); if (! PoisonOn) { - Storage_DEALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_DEALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); } } return NULL; @@ -1623,20 +1623,20 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) { DynamicStrings_String s; - Storage_ALLOCATE ((void **) &s, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &s, sizeof (DynamicStrings_stringRecord)); s->contents.len = 0; s->contents.next = NULL; if (a != NULL) { ConcatContentsAddress (&s->contents, a, static_cast (libc_strlen (a))); } - Storage_ALLOCATE ((void **) &s->head, sizeof (descriptor)); + Storage_ALLOCATE ((void **) &s->head, sizeof (DynamicStrings_descriptor)); s->head->charStarUsed = FALSE; s->head->charStar = NULL; s->head->charStarSize = 0; s->head->charStarValid = FALSE; s->head->garbage = NULL; - s->head->state = inuse; + s->head->state = DynamicStrings_inuse; AddDebugInfo (s); if (TraceOn) { @@ -1654,10 +1654,10 @@ extern "C" DynamicStrings_String DynamicStrings_InitStringCharStar (void * a) extern "C" DynamicStrings_String DynamicStrings_InitStringChar (char ch) { - typedef struct _T4_a _T4; + typedef struct InitStringChar__T4_a InitStringChar__T4; - struct _T4_a { char array[1+1]; }; - _T4 a; + struct InitStringChar__T4_a { char array[1+1]; }; + InitStringChar__T4 a; DynamicStrings_String s; a.array[0] = ch; @@ -1683,9 +1683,9 @@ extern "C" DynamicStrings_String DynamicStrings_Mark (DynamicStrings_String s) { s = CheckPoisoned (s); } - if ((s != NULL) && (s->head->state == inuse)) + if ((s != NULL) && (s->head->state == DynamicStrings_inuse)) { - s->head->state = marked; + s->head->state = DynamicStrings_marked; } return s; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -1762,10 +1762,10 @@ extern "C" DynamicStrings_String DynamicStrings_ConCat (DynamicStrings_String a, extern "C" DynamicStrings_String DynamicStrings_ConCatChar (DynamicStrings_String a, char ch) { - typedef struct _T5_a _T5; + typedef struct ConCatChar__T5_a ConCatChar__T5; - struct _T5_a { char array[1+1]; }; - _T5 b; + struct ConCatChar__T5_a { char array[1+1]; }; + ConCatChar__T5 b; DynamicStrings_String t; if (PoisonOn) @@ -2069,7 +2069,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s, { if (t->contents.next == NULL) { - Storage_ALLOCATE ((void **) &t->contents.next, sizeof (stringRecord)); + Storage_ALLOCATE ((void **) &t->contents.next, sizeof (DynamicStrings_stringRecord)); t->contents.next->head = NULL; t->contents.next->contents.len = 0; AddDebugInfo (t->contents.next); @@ -2420,12 +2420,12 @@ extern "C" char DynamicStrings_char (DynamicStrings_String s, int i) extern "C" void * DynamicStrings_string (DynamicStrings_String s) { - typedef char *_T2; + typedef char *string__T2; DynamicStrings_String a; unsigned int l; unsigned int i; - _T2 p; + string__T2 p; if (PoisonOn) { @@ -2447,7 +2447,7 @@ extern "C" void * DynamicStrings_string (DynamicStrings_String s) s->head->charStarSize = l+1; s->head->charStarUsed = TRUE; } - p = static_cast<_T2> (s->head->charStar); + p = static_cast (s->head->charStar); a = s; while (a != NULL) { @@ -2583,12 +2583,12 @@ extern "C" DynamicStrings_String DynamicStrings_SliceDB (DynamicStrings_String s extern "C" void DynamicStrings_PushAllocation (void) { - frame f; + DynamicStrings_frame f; if (CheckOn) { Init (); - Storage_ALLOCATE ((void **) &f, sizeof (frameRec)); + Storage_ALLOCATE ((void **) &f, sizeof (DynamicStrings_frameRec)); f->next = frameHead; f->alloc = NULL; f->dealloc = NULL; @@ -2629,7 +2629,7 @@ extern "C" void DynamicStrings_PopAllocation (unsigned int halt) extern "C" DynamicStrings_String DynamicStrings_PopAllocationExemption (unsigned int halt, DynamicStrings_String e) { DynamicStrings_String s; - frame f; + DynamicStrings_frame f; unsigned int b; Init (); diff --git a/gcc/m2/mc-boot/GEnvironment.c b/gcc/m2/mc-boot/GEnvironment.c index 2cb4c7570e1..5487a4d4934 100644 --- a/gcc/m2/mc-boot/GEnvironment.c +++ b/gcc/m2/mc-boot/GEnvironment.c @@ -73,11 +73,11 @@ extern "C" unsigned int Environment_PutEnvironment (const char *EnvDef_, unsigne extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned int _Env_high, char *dest, unsigned int _dest_high) { - typedef char *_T1; + typedef char *GetEnvironment__T1; unsigned int High; unsigned int i; - _T1 Addr; + GetEnvironment__T1 Addr; char Env[_Env_high+1]; /* make a local copy of each unbounded array. */ @@ -85,7 +85,7 @@ extern "C" unsigned int Environment_GetEnvironment (const char *Env_, unsigned i i = 0; High = _dest_high; - Addr = static_cast<_T1> (libc_getenv (&Env)); + Addr = static_cast (libc_getenv (&Env)); while (((i < High) && (Addr != NULL)) && ((*Addr) != ASCII_nul)) { dest[i] = (*Addr); diff --git a/gcc/m2/mc-boot/GFIO.c b/gcc/m2/mc-boot/GFIO.c index d2f5c87122f..039d221f626 100644 --- a/gcc/m2/mc-boot/GFIO.c +++ b/gcc/m2/mc-boot/GFIO.c @@ -71,50 +71,50 @@ FIO_File FIO_StdIn; # define CreatePermissions 0666 # define MaxBufferLength (1024*16) # define MaxErrorString (1024*8) -typedef struct NameInfo_r NameInfo; +typedef struct FIO_NameInfo_r FIO_NameInfo; -typedef struct buf_r buf; +typedef struct FIO_buf_r FIO_buf; -typedef buf *Buffer; +typedef FIO_buf *FIO_Buffer; -typedef struct fds_r fds; +typedef struct FIO_fds_r FIO_fds; -typedef fds *FileDescriptor; +typedef FIO_fds *FIO_FileDescriptor; -typedef struct _T7_a _T7; +typedef struct FIO__T7_a FIO__T7; -typedef char *PtrToChar; +typedef char *FIO_PtrToChar; -typedef enum {successful, outofmemory, toomanyfilesopen, failed, connectionfailure, endofline, endoffile} FileStatus; +typedef enum {FIO_successful, FIO_outofmemory, FIO_toomanyfilesopen, FIO_failed, FIO_connectionfailure, FIO_endofline, FIO_endoffile} FIO_FileStatus; -typedef enum {unused, openedforread, openedforwrite, openedforrandom} FileUsage; +typedef enum {FIO_unused, FIO_openedforread, FIO_openedforwrite, FIO_openedforrandom} FIO_FileUsage; -struct NameInfo_r { - void *address; - unsigned int size; - }; +struct FIO_NameInfo_r { + void *address; + unsigned int size; + }; -struct buf_r { - unsigned int valid; - long int bufstart; - unsigned int position; - void *address; - unsigned int filled; - unsigned int size; - unsigned int left; - _T7 *contents; - }; +struct FIO_buf_r { + unsigned int valid; + long int bufstart; + unsigned int position; + void *address; + unsigned int filled; + unsigned int size; + unsigned int left; + FIO__T7 *contents; + }; -struct _T7_a { char array[MaxBufferLength+1]; }; -struct fds_r { - int unixfd; - NameInfo name; - FileStatus state; - FileUsage usage; - unsigned int output; - Buffer buffer; - long int abspos; - }; +struct FIO__T7_a { char array[MaxBufferLength+1]; }; +struct FIO_fds_r { + int unixfd; + FIO_NameInfo name; + FIO_FileStatus state; + FIO_FileUsage usage; + unsigned int output; + FIO_Buffer buffer; + long int abspos; + }; static Indexing_Index FileInfo; static FIO_File Error; @@ -375,13 +375,13 @@ static FIO_File GetNextFreeDescriptor (void); SetState - sets the field, state, of file, f, to, s. */ -static void SetState (FIO_File f, FileStatus s); +static void SetState (FIO_File f, FIO_FileStatus s); /* InitializeFile - initialize a file descriptor */ -static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FileStatus fstate, FileUsage use, unsigned int towrite, unsigned int buflength); +static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength); /* ConnectToUnix - connects a FIO file to a UNIX file descriptor. @@ -454,7 +454,7 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c opened for read/write. */ -static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite); +static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite); /* SetEndOfLine - @@ -476,7 +476,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a); PreInitialize - preinitialize the file descriptor. */ -static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FileStatus state, FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize); +static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize); /* Init - initialize the modules, global variables. @@ -532,7 +532,7 @@ static FIO_File GetNextFreeDescriptor (void) { FIO_File f; FIO_File h; - FileDescriptor fd; + FIO_FileDescriptor fd; f = Error+1; h = Indexing_HighIndice (FileInfo); @@ -540,7 +540,7 @@ static FIO_File GetNextFreeDescriptor (void) { if (f <= h) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { return f; @@ -562,11 +562,11 @@ static FIO_File GetNextFreeDescriptor (void) SetState - sets the field, state, of file, f, to, s. */ -static void SetState (FIO_File f, FileStatus s) +static void SetState (FIO_File f, FIO_FileStatus s) { - FileDescriptor fd; + FIO_FileDescriptor fd; - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); fd->state = s; } @@ -575,15 +575,15 @@ static void SetState (FIO_File f, FileStatus s) InitializeFile - initialize a file descriptor */ -static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FileStatus fstate, FileUsage use, unsigned int towrite, unsigned int buflength) +static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, FIO_FileStatus fstate, FIO_FileUsage use, unsigned int towrite, unsigned int buflength) { - PtrToChar p; - FileDescriptor fd; + FIO_PtrToChar p; + FIO_FileDescriptor fd; - Storage_ALLOCATE ((void **) &fd, sizeof (fds)); + Storage_ALLOCATE ((void **) &fd, sizeof (FIO_fds)); if (fd == NULL) { - SetState (Error, outofmemory); + SetState (Error, FIO_outofmemory); return Error; } else @@ -595,20 +595,20 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, Storage_ALLOCATE (&fd->name.address, fd->name.size); if (fd->name.address == NULL) { - fd->state = outofmemory; + fd->state = FIO_outofmemory; return f; } fd->name.address = libc_strncpy (fd->name.address, fname, flength); /* and assign nul to the last byte */ - p = static_cast (fd->name.address); + p = static_cast (fd->name.address); p += flength; (*p) = ASCII_nul; fd->abspos = 0; /* now for the buffer */ - Storage_ALLOCATE ((void **) &fd->buffer, sizeof (buf)); + Storage_ALLOCATE ((void **) &fd->buffer, sizeof (FIO_buf)); if (fd->buffer == NULL) { - SetState (Error, outofmemory); + SetState (Error, FIO_outofmemory); return Error; } else @@ -627,7 +627,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, Storage_ALLOCATE (&fd->buffer->address, fd->buffer->size); if (fd->buffer->address == NULL) { - fd->state = outofmemory; + fd->state = FIO_outofmemory; return f; } } @@ -639,7 +639,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, { fd->buffer->left = 0; } - fd->buffer->contents = reinterpret_cast<_T7 *> (fd->buffer->address); /* provides easy access for reading characters */ + fd->buffer->contents = reinterpret_cast (fd->buffer->address); /* provides easy access for reading characters */ fd->state = fstate; /* provides easy access for reading characters */ } } @@ -655,11 +655,11 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength, static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfile) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if (towrite) @@ -679,7 +679,7 @@ static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfil } if (fd->unixfd < 0) { - fd->state = connectionfailure; + fd->state = FIO_connectionfailure; } } } @@ -698,19 +698,19 @@ static void ConnectToUnix (FIO_File f, unsigned int towrite, unsigned int newfil static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) { - typedef unsigned char *_T1; + typedef unsigned char *ReadFromBuffer__T1; void * t; int result; unsigned int total; unsigned int n; - _T1 p; - FileDescriptor fd; + ReadFromBuffer__T1 p; + FIO_FileDescriptor fd; if (f != Error) { total = 0; /* how many bytes have we read */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* how many bytes have we read */ + fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* how many bytes have we read */ /* extract from the buffer first */ if ((fd->buffer != NULL) && fd->buffer->valid) { @@ -720,7 +720,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T1> (a); + p = static_cast (a); (*p) = static_cast ((*fd->buffer->contents).array[fd->buffer->position]); fd->buffer->left -= 1; /* remove consumed bytes */ fd->buffer->position += 1; /* move onwards n bytes */ @@ -733,7 +733,7 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T1> (libc_memcpy (a, t, static_cast (n))); + p = static_cast (libc_memcpy (a, t, static_cast (n))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move onwards ready for direct reads */ @@ -767,11 +767,11 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) if (result == 0) { /* eof reached */ - fd->state = endoffile; + fd->state = FIO_endoffile; } else { - fd->state = failed; + fd->state = FIO_failed; } /* indicate buffer is empty */ if (fd->buffer != NULL) @@ -808,19 +808,19 @@ static int ReadFromBuffer (FIO_File f, void * a, unsigned int nBytes) static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) { - typedef unsigned char *_T3; + typedef unsigned char *BufferedRead__T3; void * t; int result; int total; int n; - _T3 p; - FileDescriptor fd; + BufferedRead__T3 p; + FIO_FileDescriptor fd; if (f != Error) { /* avoid dangling else. */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); total = 0; /* how many bytes have we read */ if (fd != NULL) /* how many bytes have we read */ { @@ -834,7 +834,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T3> (a); + p = static_cast (a); (*p) = static_cast ((*fd->buffer->contents).array[fd->buffer->position]); fd->buffer->left -= 1; /* remove consumed byte */ fd->buffer->position += 1; /* move onwards n byte */ @@ -846,7 +846,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T3> (libc_memcpy (a, t, static_cast (n))); + p = static_cast (libc_memcpy (a, t, static_cast (n))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move onwards ready for direct reads */ @@ -872,7 +872,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) if (n == 0) { /* eof reached */ - fd->state = endoffile; + fd->state = FIO_endoffile; return -1; } } @@ -882,7 +882,7 @@ static int BufferedRead (FIO_File f, unsigned int nBytes, void * a) fd->buffer->position = 0; fd->buffer->left = 0; fd->buffer->filled = 0; - fd->state = failed; + fd->state = FIO_failed; return total; } } @@ -980,18 +980,18 @@ static void Cast (unsigned char *a, unsigned int _a_high, const unsigned char *b static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_, unsigned int _src_high, const unsigned char *w_, unsigned int _w_high) { - typedef struct _T8_a _T8; + typedef struct StringFormat1__T8_a StringFormat1__T8; - typedef char *_T4; + typedef char *StringFormat1__T4; - struct _T8_a { char array[MaxErrorString+1]; }; + struct StringFormat1__T8_a { char array[MaxErrorString+1]; }; unsigned int HighSrc; unsigned int HighDest; unsigned int c; unsigned int i; unsigned int j; - _T8 str; - _T4 p; + StringFormat1__T8 str; + StringFormat1__T4 p; char src[_src_high+1]; unsigned char w[_w_high+1]; @@ -1095,10 +1095,10 @@ static void FormatError (const char *a_, unsigned int _a_high) static void FormatError1 (const char *a_, unsigned int _a_high, const unsigned char *w_, unsigned int _w_high) { - typedef struct _T9_a _T9; + typedef struct FormatError1__T9_a FormatError1__T9; - struct _T9_a { char array[MaxErrorString+1]; }; - _T9 s; + struct FormatError1__T9_a { char array[MaxErrorString+1]; }; + FormatError1__T9 s; char a[_a_high+1]; unsigned char w[_w_high+1]; @@ -1117,10 +1117,10 @@ static void FormatError1 (const char *a_, unsigned int _a_high, const unsigned c static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned char *w1_, unsigned int _w1_high, const unsigned char *w2_, unsigned int _w2_high) { - typedef struct _T10_a _T10; + typedef struct FormatError2__T10_a FormatError2__T10; - struct _T10_a { char array[MaxErrorString+1]; }; - _T10 s; + struct FormatError2__T10_a { char array[MaxErrorString+1]; }; + FormatError2__T10 s; char a[_a_high+1]; unsigned char w1[_w1_high+1]; unsigned char w2[_w2_high+1]; @@ -1140,14 +1140,14 @@ static void FormatError2 (const char *a_, unsigned int _a_high, const unsigned c opened for read/write. */ -static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) +static void CheckAccess (FIO_File f, FIO_FileUsage use, unsigned int towrite) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { /* avoid dangling else. */ - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { if (f != FIO_StdErr) @@ -1159,20 +1159,20 @@ static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) } else { - if ((use == openedforwrite) && (fd->usage == openedforread)) + if ((use == FIO_openedforwrite) && (fd->usage == FIO_openedforread)) { FormatError1 ((const char *) "this file (%s) has been opened for reading but is now being written\\n", 69, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); M2RTS_HALT (-1); __builtin_unreachable (); } - else if ((use == openedforread) && (fd->usage == openedforwrite)) + else if ((use == FIO_openedforread) && (fd->usage == FIO_openedforwrite)) { /* avoid dangling else. */ FormatError1 ((const char *) "this file (%s) has been opened for writing but is now being read\\n", 66, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); M2RTS_HALT (-1); __builtin_unreachable (); } - else if (fd->state == connectionfailure) + else if (fd->state == FIO_connectionfailure) { /* avoid dangling else. */ FormatError1 ((const char *) "this file (%s) was not successfully opened\\n", 44, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); @@ -1212,19 +1212,19 @@ static void CheckAccess (FIO_File f, FileUsage use, unsigned int towrite) static void SetEndOfLine (FIO_File f, char ch) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (ch == ASCII_nl) { - fd->state = endofline; + fd->state = FIO_endofline; } else { - fd->state = successful; + fd->state = FIO_successful; } } } @@ -1240,18 +1240,18 @@ static void SetEndOfLine (FIO_File f, char ch) static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) { - typedef unsigned char *_T5; + typedef unsigned char *BufferedWrite__T5; void * t; int result; int total; int n; - _T5 p; - FileDescriptor fd; + BufferedWrite__T5 p; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { total = 0; /* how many bytes have we read */ @@ -1265,7 +1265,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) if (nBytes == 1) { /* too expensive to call memcpy for 1 character */ - p = static_cast<_T5> (a); + p = static_cast (a); (*fd->buffer->contents).array[fd->buffer->position] = static_cast ((*p)); fd->buffer->left -= 1; /* reduce space */ fd->buffer->position += 1; /* move onwards n byte */ @@ -1277,7 +1277,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) n = Min (fd->buffer->left, nBytes); t = fd->buffer->address; t = reinterpret_cast (reinterpret_cast (t)+fd->buffer->position); - p = static_cast<_T5> (libc_memcpy (a, t, static_cast ((unsigned int ) (n)))); + p = static_cast (libc_memcpy (a, t, static_cast ((unsigned int ) (n)))); fd->buffer->left -= n; /* remove consumed bytes */ fd->buffer->position += n; /* move onwards n bytes */ /* move ready for further writes */ @@ -1289,7 +1289,7 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) else { FIO_FlushBuffer (f); - if ((fd->state != successful) && (fd->state != endofline)) + if ((fd->state != FIO_successful) && (fd->state != FIO_endofline)) { nBytes = 0; } @@ -1309,10 +1309,10 @@ static int BufferedWrite (FIO_File f, unsigned int nBytes, void * a) PreInitialize - preinitialize the file descriptor. */ -static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FileStatus state, FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize) +static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_high, FIO_FileStatus state, FIO_FileUsage use, unsigned int towrite, int osfd, unsigned int bufsize) { - FileDescriptor fd; - FileDescriptor fe; + FIO_FileDescriptor fd; + FIO_FileDescriptor fe; char fname[_fname_high+1]; /* make a local copy of each unbounded array. */ @@ -1320,10 +1320,10 @@ static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_h if ((InitializeFile (f, &fname, StrLib_StrLen ((const char *) fname, _fname_high), state, use, towrite, bufsize)) == f) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (f == Error) { - fe = static_cast (Indexing_GetIndice (FileInfo, FIO_StdErr)); + fe = static_cast (Indexing_GetIndice (FileInfo, FIO_StdErr)); if (fe == NULL) { M2RTS_HALT (-1); @@ -1355,13 +1355,13 @@ static void Init (void) { FileInfo = Indexing_InitIndex (0); Error = 0; - PreInitialize (Error, (const char *) "error", 5, toomanyfilesopen, unused, FALSE, -1, 0); + PreInitialize (Error, (const char *) "error", 5, FIO_toomanyfilesopen, FIO_unused, FALSE, -1, 0); FIO_StdIn = 1; - PreInitialize (FIO_StdIn, (const char *) "", 7, successful, openedforread, FALSE, 0, MaxBufferLength); + PreInitialize (FIO_StdIn, (const char *) "", 7, FIO_successful, FIO_openedforread, FALSE, 0, MaxBufferLength); FIO_StdOut = 2; - PreInitialize (FIO_StdOut, (const char *) "", 8, successful, openedforwrite, TRUE, 1, MaxBufferLength); + PreInitialize (FIO_StdOut, (const char *) "", 8, FIO_successful, FIO_openedforwrite, TRUE, 1, MaxBufferLength); FIO_StdErr = 3; - PreInitialize (FIO_StdErr, (const char *) "", 8, successful, openedforwrite, TRUE, 2, MaxBufferLength); + PreInitialize (FIO_StdErr, (const char *) "", 8, FIO_successful, FIO_openedforwrite, TRUE, 2, MaxBufferLength); if (! (M2RTS_InstallTerminationProcedure ((PROC ) {(PROC_t) FIO_FlushOutErr}))) { M2RTS_HALT (-1); @@ -1376,7 +1376,7 @@ static void Init (void) extern "C" unsigned int FIO_IsNoError (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f == Error) { @@ -1384,8 +1384,8 @@ extern "C" unsigned int FIO_IsNoError (FIO_File f) } else { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - return (fd != NULL) && (((fd->state == successful) || (fd->state == endoffile)) || (fd->state == endofline)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + return (fd != NULL) && (((fd->state == FIO_successful) || (fd->state == FIO_endoffile)) || (fd->state == FIO_endofline)); } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -1470,11 +1470,11 @@ extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_h extern "C" void FIO_Close (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); /* we allow users to close files which have an error status */ @@ -1486,7 +1486,7 @@ extern "C" void FIO_Close (FIO_File f) if ((libc_close (fd->unixfd)) != 0) { FormatError1 ((const char *) "failed to close file (%s)\\n", 27, (const unsigned char *) &fd->name.address, (sizeof (fd->name.address)-1)); - fd->state = failed; /* --fixme-- too late to notify user (unless we return a BOOLEAN) */ + fd->state = FIO_failed; /* --fixme-- too late to notify user (unless we return a BOOLEAN) */ } } if (fd->name.address != NULL) @@ -1499,10 +1499,10 @@ extern "C" void FIO_Close (FIO_File f) { Storage_DEALLOCATE (&fd->buffer->address, fd->buffer->size); } - Storage_DEALLOCATE ((void **) &fd->buffer, sizeof (buf)); + Storage_DEALLOCATE ((void **) &fd->buffer, sizeof (FIO_buf)); fd->buffer = NULL; } - Storage_DEALLOCATE ((void **) &fd, sizeof (fds)); + Storage_DEALLOCATE ((void **) &fd, sizeof (FIO_fds)); Indexing_PutIndice (FileInfo, f, NULL); } } @@ -1547,11 +1547,11 @@ extern "C" FIO_File FIO_openToRead (void * fname, unsigned int flength) f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforread, FALSE, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforread, FALSE, MaxBufferLength); ConnectToUnix (f, FALSE, FALSE); } return f; @@ -1574,11 +1574,11 @@ extern "C" FIO_File FIO_openToWrite (void * fname, unsigned int flength) f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforwrite, TRUE, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforwrite, TRUE, MaxBufferLength); ConnectToUnix (f, TRUE, TRUE); } return f; @@ -1603,11 +1603,11 @@ extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsig f = GetNextFreeDescriptor (); if (f == Error) { - SetState (f, toomanyfilesopen); + SetState (f, FIO_toomanyfilesopen); } else { - f = InitializeFile (f, fname, flength, successful, openedforrandom, towrite, MaxBufferLength); + f = InitializeFile (f, fname, flength, FIO_successful, FIO_openedforrandom, towrite, MaxBufferLength); ConnectToUnix (f, towrite, newfile); } return f; @@ -1622,11 +1622,11 @@ extern "C" FIO_File FIO_openForRandom (void * fname, unsigned int flength, unsig extern "C" void FIO_FlushBuffer (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if (fd->output && (fd->buffer != NULL)) @@ -1641,7 +1641,7 @@ extern "C" void FIO_FlushBuffer (FIO_File f) } else { - fd->state = failed; + fd->state = FIO_failed; } } } @@ -1658,14 +1658,14 @@ extern "C" void FIO_FlushBuffer (FIO_File f) extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * dest) { - typedef char *_T2; + typedef char *ReadNBytes__T2; int n; - _T2 p; + ReadNBytes__T2 p; if (f != Error) { - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); n = ReadFromBuffer (f, dest, nBytes); if (n <= 0) { @@ -1673,7 +1673,7 @@ extern "C" unsigned int FIO_ReadNBytes (FIO_File f, unsigned int nBytes, void * } else { - p = static_cast<_T2> (dest); + p = static_cast (dest); p += n-1; SetEndOfLine (f, (*p)); return n; @@ -1696,7 +1696,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, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if ((BufferedRead (f, _a_high, a)) == _a_high) { SetEndOfLine (f, static_cast (a[_a_high])); @@ -1715,19 +1715,19 @@ extern "C" void FIO_ReadAny (FIO_File f, unsigned char *a, unsigned int _a_high) extern "C" unsigned int FIO_WriteNBytes (FIO_File f, unsigned int nBytes, void * src) { int total; - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforwrite, TRUE); + CheckAccess (f, FIO_openedforwrite, TRUE); FIO_FlushBuffer (f); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { total = static_cast (libc_write (fd->unixfd, src, static_cast ((int ) (nBytes)))); if (total < 0) { - fd->state = failed; + fd->state = FIO_failed; return 0; } else @@ -1755,7 +1755,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, openedforwrite, TRUE); + CheckAccess (f, FIO_openedforwrite, TRUE); if ((BufferedWrite (f, _a_high, a)) == _a_high) {} /* empty. */ } @@ -1767,7 +1767,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, openedforwrite, TRUE); + CheckAccess (f, FIO_openedforwrite, TRUE); if ((BufferedWrite (f, sizeof (ch), &ch)) == sizeof (ch)) {} /* empty. */ } @@ -1779,15 +1779,15 @@ extern "C" void FIO_WriteChar (FIO_File f, char ch) extern "C" unsigned int FIO_EOF (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { - return fd->state == endoffile; + return fd->state == FIO_endoffile; } } return TRUE; @@ -1804,22 +1804,22 @@ extern "C" unsigned int FIO_EOF (FIO_File f) extern "C" unsigned int FIO_EOLN (FIO_File f) { char ch; - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); /* we will read a character and then push it back onto the input stream, having noted the file status, we also reset the status. */ if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { - if ((fd->state == successful) || (fd->state == endofline)) + if ((fd->state == FIO_successful) || (fd->state == FIO_endofline)) { ch = FIO_ReadChar (f); - if ((fd->state == successful) || (fd->state == endofline)) + if ((fd->state == FIO_successful) || (fd->state == FIO_endofline)) { FIO_UnReadChar (f, ch); } @@ -1839,17 +1839,17 @@ extern "C" unsigned int FIO_EOLN (FIO_File f) extern "C" unsigned int FIO_WasEOLN (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f == Error) { return FALSE; } else { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - return (fd != NULL) && (fd->state == endofline); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + return (fd != NULL) && (fd->state == FIO_endofline); } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -1866,7 +1866,7 @@ extern "C" char FIO_ReadChar (FIO_File f) { char ch; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if ((BufferedRead (f, sizeof (ch), &ch)) == sizeof (ch)) { SetEndOfLine (f, ch); @@ -1894,27 +1894,27 @@ extern "C" char FIO_ReadChar (FIO_File f) extern "C" void FIO_UnReadChar (FIO_File f, char ch) { - FileDescriptor fd; + FIO_FileDescriptor fd; unsigned int n; void * a; void * b; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); - if (((fd->state == successful) || (fd->state == endoffile)) || (fd->state == endofline)) + fd = static_cast (Indexing_GetIndice (FileInfo, f)); + if (((fd->state == FIO_successful) || (fd->state == FIO_endoffile)) || (fd->state == FIO_endofline)) { /* avoid dangling else. */ if ((fd->buffer != NULL) && fd->buffer->valid) { /* we assume that a ReadChar has occurred, we will check just in case. */ - if (fd->state == endoffile) + if (fd->state == FIO_endoffile) { fd->buffer->position = MaxBufferLength; fd->buffer->left = 0; fd->buffer->filled = 0; - fd->state = successful; + fd->state = FIO_successful; } if (fd->buffer->position > 0) { @@ -1989,7 +1989,7 @@ extern "C" void FIO_ReadString (FIO_File f, char *a, unsigned int _a_high) unsigned int i; char ch; - CheckAccess (f, openedforread, FALSE); + CheckAccess (f, FIO_openedforread, FALSE); high = _a_high; i = 0; do { @@ -2047,11 +2047,11 @@ extern "C" unsigned int FIO_ReadCardinal (FIO_File f) extern "C" int FIO_GetUnixFileDescriptor (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { return fd->unixfd; @@ -2071,11 +2071,11 @@ extern "C" int FIO_GetUnixFileDescriptor (FIO_File f) extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) { long int offset; - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { /* always force the lseek, until we are confident that abspos is always correct, @@ -2103,7 +2103,7 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) } else { - fd->state = failed; + fd->state = FIO_failed; fd->abspos = 0; } if (fd->buffer != NULL) @@ -2124,11 +2124,11 @@ extern "C" void FIO_SetPositionFromBeginning (FIO_File f, long int pos) extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) { long int offset; - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { FIO_FlushBuffer (f); @@ -2152,7 +2152,7 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) } else { - fd->state = failed; + fd->state = FIO_failed; fd->abspos = 0; offset = 0; } @@ -2172,11 +2172,11 @@ extern "C" void FIO_SetPositionFromEnd (FIO_File f, long int pos) extern "C" long int FIO_FindPosition (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd != NULL) { if ((fd->buffer == NULL) || ! fd->buffer->valid) @@ -2201,15 +2201,15 @@ extern "C" long int FIO_FindPosition (FIO_File f) extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) { - typedef char *_T6; + typedef char *GetFileName__T6; unsigned int i; - _T6 p; - FileDescriptor fd; + GetFileName__T6 p; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); @@ -2224,7 +2224,7 @@ extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) } else { - p = static_cast<_T6> (fd->name.address); + p = static_cast (fd->name.address); i = 0; while (((*p) != ASCII_nul) && (i <= _a_high)) { @@ -2244,11 +2244,11 @@ extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high) extern "C" void * FIO_getFileName (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); @@ -2271,11 +2271,11 @@ extern "C" void * FIO_getFileName (FIO_File f) extern "C" unsigned int FIO_getFileNameLength (FIO_File f) { - FileDescriptor fd; + FIO_FileDescriptor fd; if (f != Error) { - fd = static_cast (Indexing_GetIndice (FileInfo, f)); + fd = static_cast (Indexing_GetIndice (FileInfo, f)); if (fd == NULL) { FormatError ((const char *) "this file has probably been closed and not reopened successfully or alternatively never opened\\n", 96); diff --git a/gcc/m2/mc-boot/GFpuIO.c b/gcc/m2/mc-boot/GFpuIO.c index 8c35b4eca29..354cddbf700 100644 --- a/gcc/m2/mc-boot/GFpuIO.c +++ b/gcc/m2/mc-boot/GFpuIO.c @@ -126,10 +126,10 @@ extern "C" void FpuIO_LongIntToStr (long int x, unsigned int n, char *a, unsigne extern "C" void FpuIO_ReadReal (double *x) { - typedef struct _T1_a _T1; + typedef struct ReadReal__T1_a ReadReal__T1; - struct _T1_a { char array[MaxLineLength+1]; }; - _T1 a; + struct ReadReal__T1_a { char array[MaxLineLength+1]; }; + ReadReal__T1 a; /* #undef GM2_DEBUG_FPUIO @@ -154,10 +154,10 @@ if defined(GM2_DEBUG_FPUIO) extern "C" void FpuIO_WriteReal (double x, unsigned int TotalWidth, unsigned int FractionWidth) { - typedef struct _T2_a _T2; + typedef struct WriteReal__T2_a WriteReal__T2; - struct _T2_a { char array[MaxLineLength+1]; }; - _T2 a; + struct WriteReal__T2_a { char array[MaxLineLength+1]; }; + WriteReal__T2 a; FpuIO_RealToStr (x, TotalWidth, FractionWidth, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -197,10 +197,10 @@ extern "C" void FpuIO_RealToStr (double x, unsigned int TotalWidth, unsigned int extern "C" void FpuIO_ReadLongReal (long double *x) { - typedef struct _T3_a _T3; + typedef struct ReadLongReal__T3_a ReadLongReal__T3; - struct _T3_a { char array[MaxLineLength+1]; }; - _T3 a; + struct ReadLongReal__T3_a { char array[MaxLineLength+1]; }; + ReadLongReal__T3 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); FpuIO_StrToLongReal ((const char *) &a.array[0], MaxLineLength, x); @@ -214,10 +214,10 @@ extern "C" void FpuIO_ReadLongReal (long double *x) extern "C" void FpuIO_WriteLongReal (long double x, unsigned int TotalWidth, unsigned int FractionWidth) { - typedef struct _T4_a _T4; + typedef struct WriteLongReal__T4_a WriteLongReal__T4; - struct _T4_a { char array[MaxLineLength+1]; }; - _T4 a; + struct WriteLongReal__T4_a { char array[MaxLineLength+1]; }; + WriteLongReal__T4 a; FpuIO_LongRealToStr (x, TotalWidth, FractionWidth, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -266,10 +266,10 @@ extern "C" void FpuIO_LongRealToStr (long double x, unsigned int TotalWidth, uns extern "C" void FpuIO_ReadLongInt (long int *x) { - typedef struct _T5_a _T5; + typedef struct ReadLongInt__T5_a ReadLongInt__T5; - struct _T5_a { char array[MaxLineLength+1]; }; - _T5 a; + struct ReadLongInt__T5_a { char array[MaxLineLength+1]; }; + ReadLongInt__T5 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); FpuIO_StrToLongInt ((const char *) &a.array[0], MaxLineLength, x); @@ -283,10 +283,10 @@ extern "C" void FpuIO_ReadLongInt (long int *x) extern "C" void FpuIO_WriteLongInt (long int x, unsigned int n) { - typedef struct _T6_a _T6; + typedef struct WriteLongInt__T6_a WriteLongInt__T6; - struct _T6_a { char array[MaxLineLength+1]; }; - _T6 a; + struct WriteLongInt__T6_a { char array[MaxLineLength+1]; }; + WriteLongInt__T6 a; FpuIO_LongIntToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); diff --git a/gcc/m2/mc-boot/GIO.c b/gcc/m2/mc-boot/GIO.c index 47dfa33ff45..10f1c85682d 100644 --- a/gcc/m2/mc-boot/GIO.c +++ b/gcc/m2/mc-boot/GIO.c @@ -53,17 +53,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # include "Gtermios.h" # define MaxDefaultFd 2 -typedef struct BasicFds_r BasicFds; +typedef struct IO_BasicFds_r IO_BasicFds; -typedef struct _T1_a _T1; +typedef struct IO__T1_a IO__T1; -struct BasicFds_r { - unsigned int IsEof; - unsigned int IsRaw; - }; +struct IO_BasicFds_r { + unsigned int IsEof; + unsigned int IsRaw; + }; -struct _T1_a { BasicFds array[MaxDefaultFd+1]; }; -static _T1 fdState; +struct IO__T1_a { IO_BasicFds array[MaxDefaultFd+1]; }; +static IO__T1 fdState; /* IsDefaultFd - returns TRUE if, fd, is 0, 1 or 2. diff --git a/gcc/m2/mc-boot/GIndexing.c b/gcc/m2/mc-boot/GIndexing.c index 78678bc0058..16740f98dca 100644 --- a/gcc/m2/mc-boot/GIndexing.c +++ b/gcc/m2/mc-boot/GIndexing.c @@ -53,26 +53,26 @@ Boston, MA 02110-1301, USA. */ typedef struct Indexing_IndexProcedure_p Indexing_IndexProcedure; # define MinSize 128 -typedef struct _T2_r _T2; +typedef struct Indexing__T2_r Indexing__T2; -typedef void * *PtrToAddress; +typedef void * *Indexing_PtrToAddress; -typedef _T2 *Indexing_Index; +typedef Indexing__T2 *Indexing_Index; -typedef unsigned char *PtrToByte; +typedef unsigned char *Indexing_PtrToByte; typedef void (*Indexing_IndexProcedure_t) (void *); struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; }; -struct _T2_r { - void *ArrayStart; - unsigned int ArraySize; - unsigned int Used; - unsigned int Low; - unsigned int High; - unsigned int Debug; - unsigned int Map; - }; +struct Indexing__T2_r { + void *ArrayStart; + unsigned int ArraySize; + unsigned int Used; + unsigned int Low; + unsigned int High; + unsigned int Debug; + unsigned int Map; + }; /* @@ -164,7 +164,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low) { Indexing_Index i; - Storage_ALLOCATE ((void **) &i, sizeof (_T2)); + Storage_ALLOCATE ((void **) &i, sizeof (Indexing__T2)); i->Low = low; i->High = 0; i->ArraySize = MinSize; @@ -186,7 +186,7 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low) extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index i) { Storage_DEALLOCATE (&i->ArrayStart, i->ArraySize); - Storage_DEALLOCATE ((void **) &i, sizeof (_T2)); + Storage_DEALLOCATE ((void **) &i, sizeof (Indexing__T2)); return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -273,11 +273,11 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i) extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) { - typedef unsigned int * *_T1; + typedef unsigned int * *PutIndice__T1; unsigned int oldSize; void * b; - _T1 p; + PutIndice__T1 p; if (! (Indexing_InBounds (i, n))) { @@ -315,7 +315,7 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) } b = i->ArrayStart; b = reinterpret_cast (reinterpret_cast (b)+(n-i->Low)*sizeof (void *)); - p = static_cast<_T1> (b); + p = static_cast (b); (*p) = reinterpret_cast (a); i->Used += 1; if (i->Debug) @@ -334,17 +334,17 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a) extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n) { - PtrToByte b; - PtrToAddress p; + Indexing_PtrToByte b; + Indexing_PtrToAddress p; if (! (Indexing_InBounds (i, n))) { M2RTS_HALT (-1); __builtin_unreachable (); } - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); b += (n-i->Low)*sizeof (void *); - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); if (i->Debug) { if (((n < 32) && (! ((((1 << (n)) & (i->Map)) != 0)))) && ((*p) != NULL)) @@ -366,14 +366,14 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n) extern "C" unsigned int Indexing_IsIndiceInIndex (Indexing_Index i, void * a) { unsigned int j; - PtrToByte b; - PtrToAddress p; + Indexing_PtrToByte b; + Indexing_PtrToAddress p; j = i->Low; - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); while (j <= i->High) { - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); if ((*p) == a) { return TRUE; @@ -396,14 +396,14 @@ extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a) { unsigned int j; unsigned int k; - PtrToAddress p; - PtrToByte b; + Indexing_PtrToAddress p; + Indexing_PtrToByte b; j = i->Low; - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); while (j <= i->High) { - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); b += sizeof (void *); if ((*p) == a) { @@ -420,16 +420,16 @@ extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a) extern "C" void Indexing_DeleteIndice (Indexing_Index i, unsigned int j) { - PtrToAddress p; - PtrToByte b; + Indexing_PtrToAddress p; + Indexing_PtrToByte b; if (Indexing_InBounds (i, j)) { - b = static_cast (i->ArrayStart); + b = static_cast (i->ArrayStart); b += sizeof (void *)*(j-i->Low); - p = (PtrToAddress) (b); + p = (Indexing_PtrToAddress) (b); b += sizeof (void *); - p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((i->High-j)*sizeof (void *)))); + p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((i->High-j)*sizeof (void *)))); i->High -= 1; i->Used -= 1; } diff --git a/gcc/m2/mc-boot/GM2Dependent.c b/gcc/m2/mc-boot/GM2Dependent.c index 97f99eed714..af0cea89ce1 100644 --- a/gcc/m2/mc-boot/GM2Dependent.c +++ b/gcc/m2/mc-boot/GM2Dependent.c @@ -59,38 +59,38 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct M2Dependent_ArgCVEnvP_p M2Dependent_ArgCVEnvP; -typedef struct DependencyList_r DependencyList; +typedef struct M2Dependent_DependencyList_r M2Dependent_DependencyList; -typedef struct _T2_r _T2; +typedef struct M2Dependent__T2_r M2Dependent__T2; -typedef _T2 *ModuleChain; +typedef M2Dependent__T2 *M2Dependent_ModuleChain; -typedef struct _T3_a _T3; +typedef struct M2Dependent__T3_a M2Dependent__T3; -typedef enum {unregistered, unordered, started, ordered, user} DependencyState; +typedef enum {M2Dependent_unregistered, M2Dependent_unordered, M2Dependent_started, M2Dependent_ordered, M2Dependent_user} M2Dependent_DependencyState; typedef void (*M2Dependent_ArgCVEnvP_t) (int, void *, void *); struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; }; -struct DependencyList_r { - PROC proc; - unsigned int forced; - unsigned int forc; - unsigned int appl; - DependencyState state; - }; - -struct _T3_a { ModuleChain array[user-unregistered+1]; }; -struct _T2_r { - void *name; - M2Dependent_ArgCVEnvP init; - M2Dependent_ArgCVEnvP fini; - DependencyList dependency; - ModuleChain prev; - ModuleChain next; - }; - -static _T3 Modules; +struct M2Dependent_DependencyList_r { + PROC proc; + unsigned int forced; + unsigned int forc; + unsigned int appl; + M2Dependent_DependencyState state; + }; + +struct M2Dependent__T3_a { M2Dependent_ModuleChain array[M2Dependent_user-M2Dependent_unregistered+1]; }; +struct M2Dependent__T2_r { + void *name; + M2Dependent_ArgCVEnvP init; + M2Dependent_ArgCVEnvP fini; + M2Dependent_DependencyList dependency; + M2Dependent_ModuleChain prev; + M2Dependent_ModuleChain next; + }; + +static M2Dependent__T3 Modules; static unsigned int Initialized; static unsigned int ModuleTrace; static unsigned int DependencyTrace; @@ -133,39 +133,39 @@ extern "C" void M2Dependent_RequestDependant (void * modulename, void * dependan ModuleChain. */ -static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies); +static M2Dependent_ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies); /* AppendModule - append chain to end of the list. */ -static void AppendModule (ModuleChain *head, ModuleChain chain); +static void AppendModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain); /* RemoveModule - remove chain from double linked list head. */ -static void RemoveModule (ModuleChain *head, ModuleChain chain); +static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain); /* onChain - returns TRUE if mptr is on the Modules[state] list. */ -static unsigned int onChain (DependencyState state, ModuleChain mptr); +static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr); /* LookupModuleN - lookup module from the state list. The string is limited to nchar. */ -static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned int nchar); +static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state, void * name, unsigned int nchar); /* LookupModule - lookup and return the ModuleChain pointer containing module name from a particular list. */ -static ModuleChain LookupModule (DependencyState state, void * name); +static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name); /* toCString - replace any character sequence @@ -211,13 +211,13 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str It updates the mptr state appropriately. */ -static void moveTo (DependencyState newstate, ModuleChain mptr); +static void moveTo (M2Dependent_DependencyState newstate, M2Dependent_ModuleChain mptr); /* ResolveDependant - */ -static void ResolveDependant (ModuleChain mptr, void * currentmodule); +static void ResolveDependant (M2Dependent_ModuleChain mptr, void * currentmodule); /* PerformRequestDependant - the current modulename has a dependancy upon @@ -238,7 +238,7 @@ static void ResolveDependencies (void * currentmodule); DisplayModuleInfo - displays all module in the state. */ -static void DisplayModuleInfo (DependencyState state, const char *name_, unsigned int _name_high); +static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *name_, unsigned int _name_high); /* DumpModuleData - @@ -253,7 +253,7 @@ static void DumpModuleData (unsigned int flag); src := NIL. */ -static void combine (DependencyState src, DependencyState dest); +static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyState dest); /* ForceDependencies - if the user has specified a forced order then we override @@ -309,16 +309,16 @@ static void CheckInitialized (void); ModuleChain. */ -static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies) +static M2Dependent_ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Dependent_ArgCVEnvP fini, PROC dependencies) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; - Storage_ALLOCATE ((void **) &mptr, sizeof (_T2)); + Storage_ALLOCATE ((void **) &mptr, sizeof (M2Dependent__T2)); mptr->name = name; mptr->init = init; mptr->fini = fini; mptr->dependency.proc = dependencies; - mptr->dependency.state = unregistered; + mptr->dependency.state = M2Dependent_unregistered; mptr->prev = NULL; mptr->next = NULL; return mptr; @@ -331,7 +331,7 @@ static ModuleChain CreateModule (void * name, M2Dependent_ArgCVEnvP init, M2Depe AppendModule - append chain to end of the list. */ -static void AppendModule (ModuleChain *head, ModuleChain chain) +static void AppendModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain) { if ((*head) == NULL) { @@ -353,7 +353,7 @@ static void AppendModule (ModuleChain *head, ModuleChain chain) RemoveModule - remove chain from double linked list head. */ -static void RemoveModule (ModuleChain *head, ModuleChain chain) +static void RemoveModule (M2Dependent_ModuleChain *head, M2Dependent_ModuleChain chain) { if ((chain->next == (*head)) && (chain == (*head))) { @@ -375,20 +375,20 @@ static void RemoveModule (ModuleChain *head, ModuleChain chain) onChain - returns TRUE if mptr is on the Modules[state] list. */ -static unsigned int onChain (DependencyState state, ModuleChain mptr) +static unsigned int onChain (M2Dependent_DependencyState state, M2Dependent_ModuleChain mptr) { - ModuleChain ptr; + M2Dependent_ModuleChain ptr; - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { - ptr = Modules.array[state-unregistered]; + ptr = Modules.array[state-M2Dependent_unregistered]; do { if (ptr == mptr) { return TRUE; } ptr = ptr->next; - } while (! (ptr == Modules.array[state-unregistered])); + } while (! (ptr == Modules.array[state-M2Dependent_unregistered])); } return FALSE; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -401,20 +401,20 @@ static unsigned int onChain (DependencyState state, ModuleChain mptr) to nchar. */ -static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned int nchar) +static M2Dependent_ModuleChain LookupModuleN (M2Dependent_DependencyState state, void * name, unsigned int nchar) { - ModuleChain ptr; + M2Dependent_ModuleChain ptr; - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { - ptr = Modules.array[state-unregistered]; + ptr = Modules.array[state-M2Dependent_unregistered]; do { if ((strncmp (reinterpret_cast (ptr->name), reinterpret_cast (name), nchar)) == 0) { return ptr; } ptr = ptr->next; - } while (! (ptr == Modules.array[state-unregistered])); + } while (! (ptr == Modules.array[state-M2Dependent_unregistered])); } return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -427,7 +427,7 @@ static ModuleChain LookupModuleN (DependencyState state, void * name, unsigned i module name from a particular list. */ -static ModuleChain LookupModule (DependencyState state, void * name) +static M2Dependent_ModuleChain LookupModule (M2Dependent_DependencyState state, void * name) { return LookupModuleN (state, name, static_cast (strlen_ (reinterpret_cast (name)))); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -605,14 +605,14 @@ static void traceprintf2 (unsigned int flag, const char *str_, unsigned int _str It updates the mptr state appropriately. */ -static void moveTo (DependencyState newstate, ModuleChain mptr) +static void moveTo (M2Dependent_DependencyState newstate, M2Dependent_ModuleChain mptr) { if (onChain (mptr->dependency.state, mptr)) { - RemoveModule (&Modules.array[mptr->dependency.state-unregistered], mptr); + RemoveModule (&Modules.array[mptr->dependency.state-M2Dependent_unregistered], mptr); } mptr->dependency.state = newstate; - AppendModule (&Modules.array[mptr->dependency.state-unregistered], mptr); + AppendModule (&Modules.array[mptr->dependency.state-M2Dependent_unregistered], mptr); } @@ -620,7 +620,7 @@ static void moveTo (DependencyState newstate, ModuleChain mptr) ResolveDependant - */ -static void ResolveDependant (ModuleChain mptr, void * currentmodule) +static void ResolveDependant (M2Dependent_ModuleChain mptr, void * currentmodule) { if (mptr == NULL) { @@ -628,17 +628,17 @@ static void ResolveDependant (ModuleChain mptr, void * currentmodule) } else { - if (onChain (started, mptr)) + if (onChain (M2Dependent_started, mptr)) { traceprintf (DependencyTrace, (const char *) " processing...\\n", 18); } else { - moveTo (started, mptr); + moveTo (M2Dependent_started, mptr); traceprintf2 (DependencyTrace, (const char *) " starting: %s\\n", 17, currentmodule); (*mptr->dependency.proc.proc) (); /* Invoke and process the dependency graph. */ traceprintf2 (DependencyTrace, (const char *) " finished: %s\\n", 17, currentmodule); /* Invoke and process the dependency graph. */ - moveTo (ordered, mptr); + moveTo (M2Dependent_ordered, mptr); } } } @@ -653,32 +653,32 @@ static void ResolveDependant (ModuleChain mptr, void * currentmodule) static void PerformRequestDependant (void * modulename, void * dependantmodule) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; traceprintf2 (DependencyTrace, (const char *) " module %s", 11, modulename); if (dependantmodule == NULL) { /* avoid dangling else. */ traceprintf2 (DependencyTrace, (const char *) " has finished its import graph\\n", 32, modulename); - mptr = LookupModule (unordered, modulename); + mptr = LookupModule (M2Dependent_unordered, modulename); if (mptr != NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is now ordered\\n", 28, modulename); - moveTo (ordered, mptr); + moveTo (M2Dependent_ordered, mptr); } } else { traceprintf2 (DependencyTrace, (const char *) " imports from %s\\n", 18, dependantmodule); - mptr = LookupModule (ordered, dependantmodule); + mptr = LookupModule (M2Dependent_ordered, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is not ordered\\n", 28, dependantmodule); - mptr = LookupModule (unordered, dependantmodule); + mptr = LookupModule (M2Dependent_unordered, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s is not unordered\\n", 30, dependantmodule); - mptr = LookupModule (started, dependantmodule); + mptr = LookupModule (M2Dependent_started, dependantmodule); if (mptr == NULL) { traceprintf2 (DependencyTrace, (const char *) " module %s has not started\\n", 29, dependantmodule); @@ -711,14 +711,14 @@ static void PerformRequestDependant (void * modulename, void * dependantmodule) static void ResolveDependencies (void * currentmodule) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; - mptr = LookupModule (unordered, currentmodule); + mptr = LookupModule (M2Dependent_unordered, currentmodule); while (mptr != NULL) { traceprintf2 (DependencyTrace, (const char *) " attempting to resolve the dependants for %s\\n", 48, currentmodule); ResolveDependant (mptr, currentmodule); - mptr = Modules.array[unordered-unregistered]; + mptr = Modules.array[M2Dependent_unordered-M2Dependent_unregistered]; } } @@ -727,18 +727,18 @@ static void ResolveDependencies (void * currentmodule) DisplayModuleInfo - displays all module in the state. */ -static void DisplayModuleInfo (DependencyState state, const char *name_, unsigned int _name_high) +static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *name_, unsigned int _name_high) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; char name[_name_high+1]; /* make a local copy of each unbounded array. */ memcpy (name, name_, _name_high+1); - if (Modules.array[state-unregistered] != NULL) + if (Modules.array[state-M2Dependent_unregistered] != NULL) { libc_printf ((const char *) "%s modules\\n", 12, &name); - mptr = Modules.array[state-unregistered]; + mptr = Modules.array[state-M2Dependent_unregistered]; do { libc_printf ((const char *) " %s", 4, mptr->name); if (mptr->dependency.appl) @@ -755,7 +755,7 @@ static void DisplayModuleInfo (DependencyState state, const char *name_, unsigne } libc_printf ((const char *) "\\n", 2); mptr = mptr->next; - } while (! (mptr == Modules.array[state-unregistered])); + } while (! (mptr == Modules.array[state-M2Dependent_unregistered])); } } @@ -766,14 +766,14 @@ static void DisplayModuleInfo (DependencyState state, const char *name_, unsigne static void DumpModuleData (unsigned int flag) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; if (flag) { - DisplayModuleInfo (unregistered, (const char *) "unregistered", 12); - DisplayModuleInfo (unordered, (const char *) "unordered", 9); - DisplayModuleInfo (started, (const char *) "started", 7); - DisplayModuleInfo (ordered, (const char *) "ordered", 7); + DisplayModuleInfo (M2Dependent_unregistered, (const char *) "unregistered", 12); + DisplayModuleInfo (M2Dependent_unordered, (const char *) "unordered", 9); + DisplayModuleInfo (M2Dependent_started, (const char *) "started", 7); + DisplayModuleInfo (M2Dependent_ordered, (const char *) "ordered", 7); } } @@ -785,15 +785,15 @@ static void DumpModuleData (unsigned int flag) src := NIL. */ -static void combine (DependencyState src, DependencyState dest) +static void combine (M2Dependent_DependencyState src, M2Dependent_DependencyState dest) { - ModuleChain last; + M2Dependent_ModuleChain last; - while (Modules.array[src-unregistered] != NULL) + while (Modules.array[src-M2Dependent_unregistered] != NULL) { - last = Modules.array[src-unregistered]->prev; - moveTo (ordered, last); - Modules.array[dest-unregistered] = last; /* New item is at the head. */ + last = Modules.array[src-M2Dependent_unregistered]->prev; + moveTo (M2Dependent_ordered, last); + Modules.array[dest-M2Dependent_unregistered] = last; /* New item is at the head. */ } } @@ -805,8 +805,8 @@ static void combine (DependencyState src, DependencyState dest) static void ForceDependencies (void) { - ModuleChain mptr; - ModuleChain userChain; + M2Dependent_ModuleChain mptr; + M2Dependent_ModuleChain userChain; unsigned int count; M2LINK_PtrToChar pc; M2LINK_PtrToChar start; @@ -821,11 +821,11 @@ static void ForceDependencies (void) { if ((*pc) == ',') { - mptr = LookupModuleN (ordered, reinterpret_cast (start), count); + mptr = LookupModuleN (M2Dependent_ordered, reinterpret_cast (start), count); if (mptr != NULL) { mptr->dependency.forced = TRUE; - moveTo (user, mptr); + moveTo (M2Dependent_user, mptr); } pc += 1; start = pc; @@ -839,14 +839,14 @@ static void ForceDependencies (void) } if (start != pc) { - mptr = LookupModuleN (ordered, reinterpret_cast (start), count); + mptr = LookupModuleN (M2Dependent_ordered, reinterpret_cast (start), count); if (mptr != NULL) { mptr->dependency.forced = TRUE; - moveTo (user, mptr); + moveTo (M2Dependent_user, mptr); } } - combine (user, ordered); + combine (M2Dependent_user, M2Dependent_ordered); } } @@ -888,16 +888,16 @@ static unsigned int equal (void * cstr, const char *str_, unsigned int _str_high static void SetupDebugFlags (void) { - typedef char *_T1; + typedef char *SetupDebugFlags__T1; - _T1 pc; + SetupDebugFlags__T1 pc; ModuleTrace = FALSE; DependencyTrace = FALSE; PostTrace = FALSE; PreTrace = FALSE; ForceTrace = FALSE; - pc = static_cast<_T1> (libc_getenv (const_cast (reinterpret_cast("GCC_M2LINK_RTFLAG")))); + pc = static_cast (libc_getenv (const_cast (reinterpret_cast("GCC_M2LINK_RTFLAG")))); while ((pc != NULL) && ((*pc) != ASCII_nul)) { if (equal (reinterpret_cast (pc), (const char *) "all", 3)) @@ -954,12 +954,12 @@ static void SetupDebugFlags (void) static void Init (void) { - DependencyState state; + M2Dependent_DependencyState state; SetupDebugFlags (); - for (state=unregistered; state<=user; state= static_cast(static_cast(state+1))) + for (state=M2Dependent_unregistered; state<=M2Dependent_user; state= static_cast(static_cast(state+1))) { - Modules.array[state-unregistered] = NULL; + Modules.array[state-M2Dependent_unregistered] = NULL; } } @@ -988,12 +988,12 @@ static void CheckInitialized (void) extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc, void * argv, void * envp) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; M2Dependent_ArgCVEnvP nulp; CheckInitialized (); traceprintf2 (ModuleTrace, (const char *) "application module: %s\\n", 24, applicationmodule); - mptr = LookupModule (unordered, applicationmodule); + mptr = LookupModule (M2Dependent_unordered, applicationmodule); if (mptr != NULL) { mptr->dependency.appl = TRUE; @@ -1006,7 +1006,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc ForceDependencies (); traceprintf (ForceTrace, (const char *) "After user forcing ordering\\n", 29); DumpModuleData (ForceTrace); - if (Modules.array[ordered-unregistered] == NULL) + 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); traceprintf2 (ModuleTrace, (const char *) " hint try compile and linking using: gm2 %s.mod\\n", 50, applicationmodule); @@ -1014,7 +1014,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc } else { - mptr = Modules.array[ordered-unregistered]; + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]; do { if (mptr->dependency.forc) { @@ -1033,7 +1033,7 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc } (*mptr->init.proc) (argc, argv, envp); mptr = mptr->next; - } while (! (mptr == Modules.array[ordered-unregistered])); + } while (! (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered])); } } @@ -1045,10 +1045,10 @@ extern "C" void M2Dependent_ConstructModules (void * applicationmodule, int argc extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int argc, void * argv, void * envp) { - ModuleChain mptr; + M2Dependent_ModuleChain mptr; traceprintf2 (ModuleTrace, (const char *) "application module finishing: %s\\n", 34, applicationmodule); - if (Modules.array[ordered-unregistered] == NULL) + if (Modules.array[M2Dependent_ordered-M2Dependent_unregistered] == NULL) { traceprintf (ModuleTrace, (const char *) " no ordered modules found during finishing\\n", 45); } @@ -1057,7 +1057,7 @@ extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int ar traceprintf (ModuleTrace, (const char *) "ExecuteTerminationProcedures\\n", 30); M2RTS_ExecuteTerminationProcedures (); traceprintf (ModuleTrace, (const char *) "terminating modules in sequence\\n", 33); - mptr = Modules.array[ordered-unregistered]->prev; + mptr = Modules.array[M2Dependent_ordered-M2Dependent_unregistered]->prev; do { if (mptr->dependency.forc) { @@ -1069,7 +1069,7 @@ extern "C" void M2Dependent_DeconstructModules (void * applicationmodule, int ar } (*mptr->fini.proc) (argc, argv, envp); mptr = mptr->prev; - } while (! (mptr == Modules.array[ordered-unregistered]->prev)); + } while (! (mptr == Modules.array[M2Dependent_ordered-M2Dependent_unregistered]->prev)); } } @@ -1086,7 +1086,7 @@ extern "C" void M2Dependent_RegisterModule (void * name, M2Dependent_ArgCVEnvP i if (! M2LINK_StaticInitialization) { traceprintf2 (ModuleTrace, (const char *) "module: %s registering\\n", 24, name); - moveTo (unordered, CreateModule (name, init, fini, dependencies)); + moveTo (M2Dependent_unordered, CreateModule (name, init, fini, dependencies)); } } diff --git a/gcc/m2/mc-boot/GM2RTS.c b/gcc/m2/mc-boot/GM2RTS.c index 906d512ea5e..e7302f60565 100644 --- a/gcc/m2/mc-boot/GM2RTS.c +++ b/gcc/m2/mc-boot/GM2RTS.c @@ -61,30 +61,30 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct M2RTS_ArgCVEnvP_p M2RTS_ArgCVEnvP; -typedef struct ProcedureList_r ProcedureList; +typedef struct M2RTS_ProcedureList_r M2RTS_ProcedureList; -typedef char *PtrToChar; +typedef char *M2RTS_PtrToChar; -typedef struct _T1_r _T1; +typedef struct M2RTS__T1_r M2RTS__T1; -typedef _T1 *ProcedureChain; +typedef M2RTS__T1 *M2RTS_ProcedureChain; typedef void (*M2RTS_ArgCVEnvP_t) (int, void *, void *); struct M2RTS_ArgCVEnvP_p { M2RTS_ArgCVEnvP_t proc; }; -struct ProcedureList_r { - ProcedureChain head; - ProcedureChain tail; - }; +struct M2RTS_ProcedureList_r { + M2RTS_ProcedureChain head; + M2RTS_ProcedureChain tail; + }; -struct _T1_r { - PROC p; - ProcedureChain prev; - ProcedureChain next; - }; +struct M2RTS__T1_r { + PROC p; + M2RTS_ProcedureChain prev; + M2RTS_ProcedureChain next; + }; -static ProcedureList InitialProc; -static ProcedureList TerminateProc; +static M2RTS_ProcedureList InitialProc; +static M2RTS_ProcedureList TerminateProc; static int ExitValue; static unsigned int isHalting; static unsigned int CallExit; @@ -230,14 +230,14 @@ extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned procedures in the chain. */ -static void ExecuteReverse (ProcedureChain procptr); +static void ExecuteReverse (M2RTS_ProcedureChain procptr); /* AppendProc - append proc to the end of the procedure list defined by proclist. */ -static unsigned int AppendProc (ProcedureList *proclist, PROC proc); +static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc); /* ErrorString - writes a string to stderr. @@ -249,7 +249,7 @@ static void ErrorString (const char *a_, unsigned int _a_high); InitProcList - initialize the head and tail pointers to NIL. */ -static void InitProcList (ProcedureList *p); +static void InitProcList (M2RTS_ProcedureList *p); /* Init - initialize the initial, terminate procedure lists and booleans. @@ -273,7 +273,7 @@ static void CheckInitialized (void); procedures in the chain. */ -static void ExecuteReverse (ProcedureChain procptr) +static void ExecuteReverse (M2RTS_ProcedureChain procptr) { while (procptr != NULL) { @@ -288,11 +288,11 @@ static void ExecuteReverse (ProcedureChain procptr) defined by proclist. */ -static unsigned int AppendProc (ProcedureList *proclist, PROC proc) +static unsigned int AppendProc (M2RTS_ProcedureList *proclist, PROC proc) { - ProcedureChain pdes; + M2RTS_ProcedureChain pdes; - Storage_ALLOCATE ((void **) &pdes, sizeof (_T1)); + Storage_ALLOCATE ((void **) &pdes, sizeof (M2RTS__T1)); pdes->p = proc; pdes->prev = (*proclist).tail; pdes->next = NULL; @@ -327,7 +327,7 @@ static void ErrorString (const char *a_, unsigned int _a_high) InitProcList - initialize the head and tail pointers to NIL. */ -static void InitProcList (ProcedureList *p) +static void InitProcList (M2RTS_ProcedureList *p) { (*p).head = NULL; (*p).tail = NULL; @@ -553,10 +553,10 @@ extern "C" void M2RTS_ExitOnHalt (int e) extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *file_, unsigned int _file_high, unsigned int line, const char *function_, unsigned int _function_high) { - typedef struct _T2_a _T2; + typedef struct ErrorMessage__T2_a ErrorMessage__T2; - struct _T2_a { char array[10+1]; }; - _T2 LineNo; + struct ErrorMessage__T2_a { char array[10+1]; }; + ErrorMessage__T2 LineNo; char message[_message_high+1]; char file[_file_high+1]; char function[_function_high+1]; diff --git a/gcc/m2/mc-boot/GMemUtils.c b/gcc/m2/mc-boot/GMemUtils.c index f65e724dede..f81fca9699b 100644 --- a/gcc/m2/mc-boot/GMemUtils.c +++ b/gcc/m2/mc-boot/GMemUtils.c @@ -58,19 +58,19 @@ extern "C" void MemUtils_MemZero (void * a, unsigned int length); extern "C" void MemUtils_MemCopy (void * from, unsigned int length, void * to) { - typedef unsigned int *_T1; + typedef unsigned int *MemCopy__T1; - typedef unsigned char *_T2; + typedef unsigned char *MemCopy__T2; - _T1 pwb; - _T1 pwa; - _T2 pbb; - _T2 pba; + MemCopy__T1 pwb; + MemCopy__T1 pwa; + MemCopy__T2 pbb; + MemCopy__T2 pba; while (length >= sizeof (unsigned int )) { - pwa = static_cast<_T1> (from); - pwb = static_cast<_T1> (to); + pwa = static_cast (from); + pwb = static_cast (to); (*pwb) = (*pwa); from = reinterpret_cast (reinterpret_cast (from)+sizeof (unsigned int )); to = reinterpret_cast (reinterpret_cast (to)+sizeof (unsigned int )); @@ -78,8 +78,8 @@ extern "C" void MemUtils_MemCopy (void * from, unsigned int length, void * to) } while (length > 0) { - pba = static_cast<_T2> (from); - pbb = static_cast<_T2> (to); + pba = static_cast (from); + pbb = static_cast (to); (*pbb) = (*pba); from = reinterpret_cast (reinterpret_cast (from)+sizeof (unsigned char )); to = reinterpret_cast (reinterpret_cast (to)+sizeof (unsigned char )); @@ -94,21 +94,21 @@ extern "C" void MemUtils_MemCopy (void * from, unsigned int length, void * to) extern "C" void MemUtils_MemZero (void * a, unsigned int length) { - typedef unsigned int *_T3; + typedef unsigned int *MemZero__T3; - typedef unsigned char *_T4; + typedef unsigned char *MemZero__T4; - _T3 pwa; - _T4 pba; + MemZero__T3 pwa; + MemZero__T4 pba; - pwa = static_cast<_T3> (a); + pwa = static_cast (a); while (length >= sizeof (unsigned int )) { (*pwa) = (unsigned int ) (0); pwa += sizeof (unsigned int ); length -= sizeof (unsigned int ); } - pba = static_cast<_T4> ((void *) (pwa)); + pba = static_cast ((void *) (pwa)); while (length >= sizeof (unsigned char )) { (*pba) = (unsigned char ) (0); diff --git a/gcc/m2/mc-boot/GNumberIO.c b/gcc/m2/mc-boot/GNumberIO.c index eded30be0e9..6b90074a158 100644 --- a/gcc/m2/mc-boot/GNumberIO.c +++ b/gcc/m2/mc-boot/GNumberIO.c @@ -80,10 +80,10 @@ extern "C" void NumberIO_StrToOctInt (const char *a_, unsigned int _a_high, int extern "C" void NumberIO_ReadCard (unsigned int *x) { - typedef struct _T1_a _T1; + typedef struct ReadCard__T1_a ReadCard__T1; - struct _T1_a { char array[MaxLineLength+1]; }; - _T1 a; + struct ReadCard__T1_a { char array[MaxLineLength+1]; }; + ReadCard__T1 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToCard ((const char *) &a.array[0], MaxLineLength, x); @@ -91,10 +91,10 @@ extern "C" void NumberIO_ReadCard (unsigned int *x) extern "C" void NumberIO_WriteCard (unsigned int x, unsigned int n) { - typedef struct _T2_a _T2; + typedef struct WriteCard__T2_a WriteCard__T2; - struct _T2_a { char array[MaxLineLength+1]; }; - _T2 a; + struct WriteCard__T2_a { char array[MaxLineLength+1]; }; + WriteCard__T2 a; NumberIO_CardToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -102,10 +102,10 @@ extern "C" void NumberIO_WriteCard (unsigned int x, unsigned int n) extern "C" void NumberIO_ReadHex (unsigned int *x) { - typedef struct _T3_a _T3; + typedef struct ReadHex__T3_a ReadHex__T3; - struct _T3_a { char array[MaxLineLength+1]; }; - _T3 a; + struct ReadHex__T3_a { char array[MaxLineLength+1]; }; + ReadHex__T3 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToHex ((const char *) &a.array[0], MaxLineLength, x); @@ -113,10 +113,10 @@ extern "C" void NumberIO_ReadHex (unsigned int *x) extern "C" void NumberIO_WriteHex (unsigned int x, unsigned int n) { - typedef struct _T4_a _T4; + typedef struct WriteHex__T4_a WriteHex__T4; - struct _T4_a { char array[MaxLineLength+1]; }; - _T4 a; + struct WriteHex__T4_a { char array[MaxLineLength+1]; }; + WriteHex__T4 a; NumberIO_HexToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -124,10 +124,10 @@ extern "C" void NumberIO_WriteHex (unsigned int x, unsigned int n) extern "C" void NumberIO_ReadInt (int *x) { - typedef struct _T5_a _T5; + typedef struct ReadInt__T5_a ReadInt__T5; - struct _T5_a { char array[MaxLineLength+1]; }; - _T5 a; + struct ReadInt__T5_a { char array[MaxLineLength+1]; }; + ReadInt__T5 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToInt ((const char *) &a.array[0], MaxLineLength, x); @@ -135,10 +135,10 @@ extern "C" void NumberIO_ReadInt (int *x) extern "C" void NumberIO_WriteInt (int x, unsigned int n) { - typedef struct _T6_a _T6; + typedef struct WriteInt__T6_a WriteInt__T6; - struct _T6_a { char array[MaxLineLength+1]; }; - _T6 a; + struct WriteInt__T6_a { char array[MaxLineLength+1]; }; + WriteInt__T6 a; NumberIO_IntToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -146,13 +146,13 @@ extern "C" void NumberIO_WriteInt (int x, unsigned int n) extern "C" void NumberIO_CardToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T7_a _T7; + typedef struct CardToStr__T7_a CardToStr__T7; - struct _T7_a { unsigned int array[MaxDigits-1+1]; }; + struct CardToStr__T7_a { unsigned int array[MaxDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T7 buf; + CardToStr__T7 buf; i = 0; do { @@ -244,13 +244,13 @@ extern "C" void NumberIO_StrToCard (const char *a_, unsigned int _a_high, unsign extern "C" void NumberIO_HexToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T8_a _T8; + typedef struct HexToStr__T8_a HexToStr__T8; - struct _T8_a { unsigned int array[MaxHexDigits-1+1]; }; + struct HexToStr__T8_a { unsigned int array[MaxHexDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T8 buf; + HexToStr__T8 buf; i = 0; do { @@ -306,14 +306,14 @@ extern "C" void NumberIO_StrToHex (const char *a_, unsigned int _a_high, unsigne extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T9_a _T9; + typedef struct IntToStr__T9_a IntToStr__T9; - struct _T9_a { unsigned int array[MaxDigits-1+1]; }; + struct IntToStr__T9_a { unsigned int array[MaxDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int c; unsigned int Higha; - _T9 buf; + IntToStr__T9 buf; unsigned int Negative; if (x < 0) @@ -442,10 +442,10 @@ extern "C" void NumberIO_StrToInt (const char *a_, unsigned int _a_high, int *x) extern "C" void NumberIO_ReadOct (unsigned int *x) { - typedef struct _T10_a _T10; + typedef struct ReadOct__T10_a ReadOct__T10; - struct _T10_a { char array[MaxLineLength+1]; }; - _T10 a; + struct ReadOct__T10_a { char array[MaxLineLength+1]; }; + ReadOct__T10 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToOct ((const char *) &a.array[0], MaxLineLength, x); @@ -453,10 +453,10 @@ extern "C" void NumberIO_ReadOct (unsigned int *x) extern "C" void NumberIO_WriteOct (unsigned int x, unsigned int n) { - typedef struct _T11_a _T11; + typedef struct WriteOct__T11_a WriteOct__T11; - struct _T11_a { char array[MaxLineLength+1]; }; - _T11 a; + struct WriteOct__T11_a { char array[MaxLineLength+1]; }; + WriteOct__T11 a; NumberIO_OctToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -464,13 +464,13 @@ extern "C" void NumberIO_WriteOct (unsigned int x, unsigned int n) extern "C" void NumberIO_OctToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T12_a _T12; + typedef struct OctToStr__T12_a OctToStr__T12; - struct _T12_a { unsigned int array[MaxOctDigits-1+1]; }; + struct OctToStr__T12_a { unsigned int array[MaxOctDigits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T12 buf; + OctToStr__T12 buf; i = 0; do { @@ -519,10 +519,10 @@ extern "C" void NumberIO_StrToOct (const char *a_, unsigned int _a_high, unsigne extern "C" void NumberIO_ReadBin (unsigned int *x) { - typedef struct _T13_a _T13; + typedef struct ReadBin__T13_a ReadBin__T13; - struct _T13_a { char array[MaxLineLength+1]; }; - _T13 a; + struct ReadBin__T13_a { char array[MaxLineLength+1]; }; + ReadBin__T13 a; StrIO_ReadString ((char *) &a.array[0], MaxLineLength); NumberIO_StrToBin ((const char *) &a.array[0], MaxLineLength, x); @@ -530,10 +530,10 @@ extern "C" void NumberIO_ReadBin (unsigned int *x) extern "C" void NumberIO_WriteBin (unsigned int x, unsigned int n) { - typedef struct _T14_a _T14; + typedef struct WriteBin__T14_a WriteBin__T14; - struct _T14_a { char array[MaxLineLength+1]; }; - _T14 a; + struct WriteBin__T14_a { char array[MaxLineLength+1]; }; + WriteBin__T14 a; NumberIO_BinToStr (x, n, (char *) &a.array[0], MaxLineLength); StrIO_WriteString ((const char *) &a.array[0], MaxLineLength); @@ -541,13 +541,13 @@ extern "C" void NumberIO_WriteBin (unsigned int x, unsigned int n) extern "C" void NumberIO_BinToStr (unsigned int x, unsigned int n, char *a, unsigned int _a_high) { - typedef struct _T15_a _T15; + typedef struct BinToStr__T15_a BinToStr__T15; - struct _T15_a { unsigned int array[MaxBits-1+1]; }; + struct BinToStr__T15_a { unsigned int array[MaxBits-1+1]; }; unsigned int i; unsigned int j; unsigned int Higha; - _T15 buf; + BinToStr__T15 buf; i = 0; do { diff --git a/gcc/m2/mc-boot/GPushBackInput.c b/gcc/m2/mc-boot/GPushBackInput.c index 1209e957ee6..b0ede086be4 100644 --- a/gcc/m2/mc-boot/GPushBackInput.c +++ b/gcc/m2/mc-boot/GPushBackInput.c @@ -56,14 +56,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define MaxPushBackStack 8192 # define MaxFileName 4096 -typedef struct _T2_a _T2; +typedef struct PushBackInput__T2_a PushBackInput__T2; -typedef struct _T3_a _T3; +typedef struct PushBackInput__T3_a PushBackInput__T3; -struct _T2_a { char array[MaxFileName+1]; }; -struct _T3_a { char array[MaxPushBackStack+1]; }; -static _T2 FileName; -static _T3 CharStack; +struct PushBackInput__T2_a { char array[MaxFileName+1]; }; +struct PushBackInput__T3_a { char array[MaxPushBackStack+1]; }; +static PushBackInput__T2 FileName; +static PushBackInput__T3 CharStack; static unsigned int ExitStatus; static unsigned int Column; static unsigned int StackPtr; @@ -384,11 +384,11 @@ extern "C" void PushBackInput_WarnError (const char *a_, unsigned int _a_high) extern "C" void PushBackInput_WarnString (DynamicStrings_String s) { - typedef char *_T1; + typedef char *WarnString__T1; - _T1 p; + WarnString__T1 p; - p = static_cast<_T1> (DynamicStrings_string (s)); + p = static_cast (DynamicStrings_string (s)); StrIO_WriteString ((const char *) &FileName.array[0], MaxFileName); StdIO_Write (':'); NumberIO_WriteCard (LineNo, 0); diff --git a/gcc/m2/mc-boot/GRTExceptions.c b/gcc/m2/mc-boot/GRTExceptions.c index 4b6a7f267e9..046e681b065 100644 --- a/gcc/m2/mc-boot/GRTExceptions.c +++ b/gcc/m2/mc-boot/GRTExceptions.c @@ -61,39 +61,39 @@ extern void throw (unsigned int); typedef struct RTExceptions_ProcedureHandler_p RTExceptions_ProcedureHandler; # define MaxBuffer 4096 -typedef struct _T1_r _T1; +typedef struct RTExceptions__T1_r RTExceptions__T1; -typedef char *PtrToChar; +typedef char *RTExceptions_PtrToChar; -typedef struct _T2_a _T2; +typedef struct RTExceptions__T2_a RTExceptions__T2; -typedef struct _T3_r _T3; +typedef struct RTExceptions__T3_r RTExceptions__T3; -typedef _T3 *Handler; +typedef RTExceptions__T3 *RTExceptions_Handler; -typedef _T1 *RTExceptions_EHBlock; +typedef RTExceptions__T1 *RTExceptions_EHBlock; typedef void (*RTExceptions_ProcedureHandler_t) (void); struct RTExceptions_ProcedureHandler_p { RTExceptions_ProcedureHandler_t proc; }; -struct _T2_a { char array[MaxBuffer+1]; }; -struct _T1_r { - _T2 buffer; - unsigned int number; - Handler handlers; - RTExceptions_EHBlock right; - }; - -struct _T3_r { - RTExceptions_ProcedureHandler p; - unsigned int n; - Handler right; - Handler left; - Handler stack; - }; +struct RTExceptions__T2_a { char array[MaxBuffer+1]; }; +struct RTExceptions__T1_r { + RTExceptions__T2 buffer; + unsigned int number; + RTExceptions_Handler handlers; + RTExceptions_EHBlock right; + }; + +struct RTExceptions__T3_r { + RTExceptions_ProcedureHandler p; + unsigned int n; + RTExceptions_Handler right; + RTExceptions_Handler left; + RTExceptions_Handler stack; + }; static unsigned int inException; -static Handler freeHandler; +static RTExceptions_Handler freeHandler; static RTExceptions_EHBlock freeEHB; static RTExceptions_EHBlock currentEHB; static void * currentSource; @@ -232,7 +232,7 @@ static void ErrorString (const char *a_, unsigned int _a_high); findHandler - */ -static Handler findHandler (RTExceptions_EHBlock e, unsigned int number); +static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number); /* InvokeHandler - invokes the associated handler for the current @@ -291,37 +291,37 @@ static RTExceptions_EHBlock New (void); NewHandler - returns a new handler. */ -static Handler NewHandler (void); +static RTExceptions_Handler NewHandler (void); /* KillHandler - returns, NIL, and places, h, onto the free list. */ -static Handler KillHandler (Handler h); +static RTExceptions_Handler KillHandler (RTExceptions_Handler h); /* KillHandlers - kills all handlers in the list. */ -static Handler KillHandlers (Handler h); +static RTExceptions_Handler KillHandlers (RTExceptions_Handler h); /* InitHandler - */ -static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned int number, RTExceptions_ProcedureHandler proc); +static RTExceptions_Handler InitHandler (RTExceptions_Handler h, RTExceptions_Handler l, RTExceptions_Handler r, RTExceptions_Handler s, unsigned int number, RTExceptions_ProcedureHandler proc); /* SubHandler - */ -static void SubHandler (Handler h); +static void SubHandler (RTExceptions_Handler h); /* AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, Handler h); +static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h); /* indexf - raise an index out of bounds exception. @@ -446,9 +446,9 @@ static void ErrorString (const char *a_, unsigned int _a_high) findHandler - */ -static Handler findHandler (RTExceptions_EHBlock e, unsigned int number) +static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number) { - Handler h; + RTExceptions_Handler h; h = e->handlers->right; while ((h != e->handlers) && (number != h->n)) @@ -475,7 +475,7 @@ static Handler findHandler (RTExceptions_EHBlock e, unsigned int number) static void InvokeHandler (void) { - Handler h; + RTExceptions_Handler h; h = findHandler (currentEHB, currentEHB->number); if (h == NULL) @@ -520,11 +520,11 @@ static void addChar (char ch, unsigned int *i) static void * stripPath (void * s) { - PtrToChar f; - PtrToChar p; + RTExceptions_PtrToChar f; + RTExceptions_PtrToChar p; - p = static_cast (s); - f = static_cast (s); + p = static_cast (s); + f = static_cast (s); while ((*p) != ASCII_nul) { if ((*p) == '/') @@ -550,9 +550,9 @@ static void * stripPath (void * s) static void addFile (void * s, unsigned int *i) { - PtrToChar p; + RTExceptions_PtrToChar p; - p = static_cast (stripPath (s)); + p = static_cast (stripPath (s)); while ((p != NULL) && ((*p) != ASCII_nul)) { addChar ((*p), i); @@ -568,9 +568,9 @@ static void addFile (void * s, unsigned int *i) static void addStr (void * s, unsigned int *i) { - PtrToChar p; + RTExceptions_PtrToChar p; - p = static_cast (s); + p = static_cast (s); while ((p != NULL) && ((*p) != ASCII_nul)) { addChar ((*p), i); @@ -608,7 +608,7 @@ static RTExceptions_EHBlock New (void) if (freeEHB == NULL) { - Storage_ALLOCATE ((void **) &e, sizeof (_T1)); + Storage_ALLOCATE ((void **) &e, sizeof (RTExceptions__T1)); } else { @@ -625,13 +625,13 @@ static RTExceptions_EHBlock New (void) NewHandler - returns a new handler. */ -static Handler NewHandler (void) +static RTExceptions_Handler NewHandler (void) { - Handler h; + RTExceptions_Handler h; if (freeHandler == NULL) { - Storage_ALLOCATE ((void **) &h, sizeof (_T3)); + Storage_ALLOCATE ((void **) &h, sizeof (RTExceptions__T3)); } else { @@ -648,7 +648,7 @@ static Handler NewHandler (void) KillHandler - returns, NIL, and places, h, onto the free list. */ -static Handler KillHandler (Handler h) +static RTExceptions_Handler KillHandler (RTExceptions_Handler h) { h->right = freeHandler; freeHandler = h; @@ -662,7 +662,7 @@ static Handler KillHandler (Handler h) KillHandlers - kills all handlers in the list. */ -static Handler KillHandlers (Handler h) +static RTExceptions_Handler KillHandlers (RTExceptions_Handler h) { h->left->right = freeHandler; freeHandler = h; @@ -676,7 +676,7 @@ static Handler KillHandlers (Handler h) InitHandler - */ -static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned int number, RTExceptions_ProcedureHandler proc) +static RTExceptions_Handler InitHandler (RTExceptions_Handler h, RTExceptions_Handler l, RTExceptions_Handler r, RTExceptions_Handler s, unsigned int number, RTExceptions_ProcedureHandler proc) { h->p = proc; h->n = number; @@ -693,7 +693,7 @@ static Handler InitHandler (Handler h, Handler l, Handler r, Handler s, unsigned SubHandler - */ -static void SubHandler (Handler h) +static void SubHandler (RTExceptions_Handler h) { h->right->left = h->left; h->left->right = h->right; @@ -704,7 +704,7 @@ static void SubHandler (Handler h) AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, Handler h) +static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) { h->right = e->handlers; h->left = e->handlers->left; @@ -885,7 +885,7 @@ static void Init (void) static void TidyUp (void) { - Handler f; + RTExceptions_Handler f; RTExceptions_EHBlock e; if (currentEHB != NULL) @@ -896,13 +896,13 @@ static void TidyUp (void) { f = freeHandler; freeHandler = freeHandler->right; - Storage_DEALLOCATE ((void **) &f, sizeof (_T3)); + Storage_DEALLOCATE ((void **) &f, sizeof (RTExceptions__T3)); } while (freeEHB != NULL) { e = freeEHB; freeEHB = freeEHB->right; - Storage_DEALLOCATE ((void **) &e, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &e, sizeof (RTExceptions__T1)); } } @@ -1044,8 +1044,8 @@ extern "C" RTExceptions_EHBlock RTExceptions_KillExceptionBlock (RTExceptions_EH extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int number, RTExceptions_ProcedureHandler p) { - Handler h; - Handler i; + RTExceptions_Handler h; + RTExceptions_Handler i; h = findHandler (e, number); if (h == NULL) @@ -1071,8 +1071,8 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int number) { - Handler h; - Handler i; + RTExceptions_Handler h; + RTExceptions_Handler i; h = findHandler (e, number); if (h != NULL) diff --git a/gcc/m2/mc-boot/GRTint.c b/gcc/m2/mc-boot/GRTint.c index b65623932d3..fd73d328894 100644 --- a/gcc/m2/mc-boot/GRTint.c +++ b/gcc/m2/mc-boot/GRTint.c @@ -63,34 +63,34 @@ typedef struct RTint_DispatchVector_p RTint_DispatchVector; # define Microseconds 1000000 # define DebugTime 0 # define Debugging FALSE -typedef struct _T1_r _T1; +typedef struct RTint__T1_r RTint__T1; -typedef _T1 *Vector; +typedef RTint__T1 *RTint_Vector; -typedef struct _T2_a _T2; +typedef struct RTint__T2_a RTint__T2; -typedef enum {input, output, time_} VectorType; +typedef enum {RTint_input, RTint_output, RTint_time} RTint_VectorType; typedef void (*RTint_DispatchVector_t) (unsigned int, unsigned int, void *); struct RTint_DispatchVector_p { RTint_DispatchVector_t proc; }; -struct _T1_r { - VectorType type; - unsigned int priority; - void *arg; - Vector pending; - Vector exists; - unsigned int no; - int File; - Selective_Timeval rel; - Selective_Timeval abs_; - unsigned int queued; - }; - -struct _T2_a { Vector array[(7)-(COROUTINES_UnassignedPriority)+1]; }; +struct RTint__T1_r { + RTint_VectorType type; + unsigned int priority; + void *arg; + RTint_Vector pending; + RTint_Vector exists; + unsigned int no; + int File; + Selective_Timeval rel; + Selective_Timeval abs_; + unsigned int queued; + }; + +struct RTint__T2_a { RTint_Vector array[(7)-(COROUTINES_UnassignedPriority)+1]; }; static unsigned int VecNo; -static Vector Exists; -static _T2 Pending; +static RTint_Vector Exists; +static RTint__T2 Pending; static int lock; static unsigned int initialized; @@ -182,19 +182,19 @@ static int Min (int i, int j); which is associated with file descriptor, fd. */ -static Vector FindVector (int fd, VectorType t); +static RTint_Vector FindVector (int fd, RTint_VectorType t); /* FindVectorNo - searches the Exists list for vector, vec. */ -static Vector FindVectorNo (unsigned int vec); +static RTint_Vector FindVectorNo (unsigned int vec); /* FindPendingVector - searches the pending list for vector, vec. */ -static Vector FindPendingVector (unsigned int vec); +static RTint_Vector FindPendingVector (unsigned int vec); /* AddFd - adds the file descriptor, fd, to set, s, updating, max. @@ -286,9 +286,9 @@ static int Min (int i, int j) which is associated with file descriptor, fd. */ -static Vector FindVector (int fd, VectorType t) +static RTint_Vector FindVector (int fd, RTint_VectorType t) { - Vector v; + RTint_Vector v; v = Exists; while (v != NULL) @@ -309,9 +309,9 @@ static Vector FindVector (int fd, VectorType t) FindVectorNo - searches the Exists list for vector, vec. */ -static Vector FindVectorNo (unsigned int vec) +static RTint_Vector FindVectorNo (unsigned int vec) { - Vector v; + RTint_Vector v; v = Exists; while ((v != NULL) && (v->no != vec)) @@ -328,10 +328,10 @@ static Vector FindVectorNo (unsigned int vec) FindPendingVector - searches the pending list for vector, vec. */ -static Vector FindPendingVector (unsigned int vec) +static RTint_Vector FindPendingVector (unsigned int vec) { unsigned int i; - Vector v; + RTint_Vector v; for (i=COROUTINES_UnassignedPriority; i<=7; i++) { @@ -375,7 +375,7 @@ static void AddFd (Selective_SetOfFd *s, int *max, int fd) static void DumpPendingQueue (void) { COROUTINES_PROTECTION p; - Vector v; + RTint_Vector v; unsigned int s; unsigned int m; @@ -386,11 +386,11 @@ static void DumpPendingQueue (void) v = Pending.array[p-(COROUTINES_UnassignedPriority)]; while (v != NULL) { - if ((v->type == input) || (v->type == output)) + if ((v->type == RTint_input) || (v->type == RTint_output)) { libc_printf ((const char *) "(fd=%d) (vec=%d)", 16, v->File, v->no); } - else if (v->type == time_) + else if (v->type == RTint_time) { /* avoid dangling else. */ Selective_GetTime (v->rel, &s, &m); @@ -507,7 +507,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch { int r; unsigned int p; - Vector v; + RTint_Vector v; unsigned int b4s; unsigned int b4m; unsigned int afs; @@ -524,7 +524,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch { switch (v->type) { - case input: + case RTint_input: if (((v->File < maxFd) && ((*i) != NULL)) && (Selective_FdIsSet (v->File, (*i)))) { if (Debugging) @@ -539,7 +539,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch } break; - case output: + case RTint_output: if (((v->File < maxFd) && ((*o) != NULL)) && (Selective_FdIsSet (v->File, (*o)))) { if (Debugging) @@ -554,7 +554,7 @@ static unsigned int activatePending (unsigned int untilInterrupt, RTint_Dispatch } break; - case time_: + case RTint_time: if (untilInterrupt && ((*t) != NULL)) { r = Selective_GetTimeOfDay (after); @@ -636,19 +636,19 @@ static void init (void) extern "C" unsigned int RTint_InitInputVector (int fd, unsigned int pri) { - Vector v; + RTint_Vector v; if (Debugging) { libc_printf ((const char *) "InitInputVector fd = %d priority = %d\\n", 39, fd, pri); } RTco_wait (lock); - v = FindVector (fd, input); + v = FindVector (fd, RTint_input); if (v == NULL) { - Storage_ALLOCATE ((void **) &v, sizeof (_T1)); + Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); VecNo += 1; - v->type = input; + v->type = RTint_input; v->priority = pri; v->arg = NULL; v->pending = NULL; @@ -676,13 +676,13 @@ extern "C" unsigned int RTint_InitInputVector (int fd, unsigned int pri) extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) { - Vector v; + RTint_Vector v; RTco_wait (lock); - v = FindVector (fd, output); + v = FindVector (fd, RTint_output); if (v == NULL) { - Storage_ALLOCATE ((void **) &v, sizeof (_T1)); + Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); if (v == NULL) { M2RTS_HALT (-1); @@ -691,7 +691,7 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) else { VecNo += 1; - v->type = output; + v->type = RTint_output; v->priority = pri; v->arg = NULL; v->pending = NULL; @@ -720,10 +720,10 @@ extern "C" unsigned int RTint_InitOutputVector (int fd, unsigned int pri) extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int secs, unsigned int pri) { - Vector v; + RTint_Vector v; RTco_wait (lock); - Storage_ALLOCATE ((void **) &v, sizeof (_T1)); + Storage_ALLOCATE ((void **) &v, sizeof (RTint__T1)); if (v == NULL) { M2RTS_HALT (-1); @@ -733,7 +733,7 @@ extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int s { VecNo += 1; Assertion_Assert (micro < Microseconds); - v->type = time_; + v->type = RTint_time; v->priority = pri; v->arg = NULL; v->pending = NULL; @@ -758,7 +758,7 @@ extern "C" unsigned int RTint_InitTimeVector (unsigned int micro, unsigned int s extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, unsigned int secs) { - Vector v; + RTint_Vector v; Assertion_Assert (micro < Microseconds); RTco_wait (lock); @@ -784,7 +784,7 @@ extern "C" void RTint_ReArmTimeVector (unsigned int vec, unsigned int micro, uns extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsigned int *secs) { - Vector v; + RTint_Vector v; RTco_wait (lock); v = FindVectorNo (vec); @@ -809,7 +809,7 @@ extern "C" void RTint_GetTimeVector (unsigned int vec, unsigned int *micro, unsi extern "C" void * RTint_AttachVector (unsigned int vec, void * p) { - Vector v; + RTint_Vector v; void * l; RTco_wait (lock); @@ -842,7 +842,7 @@ extern "C" void * RTint_AttachVector (unsigned int vec, void * p) extern "C" void RTint_IncludeVector (unsigned int vec) { - Vector v; + RTint_Vector v; unsigned int m; unsigned int s; int r; @@ -863,7 +863,7 @@ extern "C" void RTint_IncludeVector (unsigned int vec) ', vec, v^.File) ; */ v->pending = Pending.array[v->priority-(COROUTINES_UnassignedPriority)]; Pending.array[v->priority-(COROUTINES_UnassignedPriority)] = v; - if ((v->type == time_) && ! v->queued) + if ((v->type == RTint_time) && ! v->queued) { v->queued = TRUE; r = Selective_GetTimeOfDay (v->abs_); @@ -895,8 +895,8 @@ extern "C" void RTint_IncludeVector (unsigned int vec) extern "C" void RTint_ExcludeVector (unsigned int vec) { - Vector v; - Vector u; + RTint_Vector v; + RTint_Vector u; RTco_wait (lock); v = FindPendingVector (vec); @@ -921,7 +921,7 @@ extern "C" void RTint_ExcludeVector (unsigned int vec) } u->pending = v->pending; } - if (v->type == time_) + if (v->type == RTint_time) { v->queued = FALSE; } @@ -946,7 +946,7 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector Selective_Timeval after; Selective_Timeval b4; Selective_Timeval t; - Vector v; + RTint_Vector v; Selective_SetOfFd i; Selective_SetOfFd o; unsigned int b4s; @@ -979,15 +979,15 @@ extern "C" void RTint_Listen (unsigned int untilInterrupt, RTint_DispatchVector { switch (v->type) { - case input: + case RTint_input: AddFd (&i, &maxFd, v->File); break; - case output: + case RTint_output: AddFd (&o, &maxFd, v->File); break; - case time_: + case RTint_time: if (IsGreaterEqual (t, v->abs_)) { Selective_GetTime (v->abs_, &s, &m); diff --git a/gcc/m2/mc-boot/GSArgs.c b/gcc/m2/mc-boot/GSArgs.c index 8c747d6cd83..81fa51da63a 100644 --- a/gcc/m2/mc-boot/GSArgs.c +++ b/gcc/m2/mc-boot/GSArgs.c @@ -52,9 +52,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # include "GUnixArgs.h" # include "GDynamicStrings.h" -typedef char *PtrToChar; +typedef char *SArgs_PtrToChar; -typedef PtrToChar *PtrToPtrToChar; +typedef SArgs_PtrToChar *SArgs_PtrToPtrToChar; /* @@ -84,13 +84,13 @@ extern "C" unsigned int SArgs_Narg (void); extern "C" unsigned int SArgs_GetArg (DynamicStrings_String *s, unsigned int n) { int i; - PtrToPtrToChar ppc; + SArgs_PtrToPtrToChar ppc; i = (int ) (n); if (i < (UnixArgs_GetArgC ())) { /* ppc := ADDRESS (VAL (PtrToPtrToChar, ArgV) + (i * CARDINAL (TSIZE(PtrToChar)))) ; */ - ppc = static_cast ((void *) (((PtrToChar) (UnixArgs_GetArgV ()))+(n*sizeof (PtrToChar)))); + ppc = static_cast ((void *) (((SArgs_PtrToChar) (UnixArgs_GetArgV ()))+(n*sizeof (SArgs_PtrToChar)))); (*s) = DynamicStrings_InitStringCharStar (reinterpret_cast ((*ppc))); return TRUE; } diff --git a/gcc/m2/mc-boot/GStdIO.c b/gcc/m2/mc-boot/GStdIO.c index 8aab393a0e3..3a575f7562f 100644 --- a/gcc/m2/mc-boot/GStdIO.c +++ b/gcc/m2/mc-boot/GStdIO.c @@ -45,9 +45,9 @@ typedef struct StdIO_ProcWrite_p StdIO_ProcWrite; typedef struct StdIO_ProcRead_p StdIO_ProcRead; # define MaxStack 40 -typedef struct _T1_a _T1; +typedef struct StdIO__T1_a StdIO__T1; -typedef struct _T2_a _T2; +typedef struct StdIO__T2_a StdIO__T2; typedef void (*StdIO_ProcWrite_t) (char); struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; @@ -55,11 +55,11 @@ struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; typedef void (*StdIO_ProcRead_t) (char *); struct StdIO_ProcRead_p { StdIO_ProcRead_t proc; }; -struct _T1_a { StdIO_ProcWrite array[MaxStack+1]; }; -struct _T2_a { StdIO_ProcRead array[MaxStack+1]; }; -static _T1 StackW; +struct StdIO__T1_a { StdIO_ProcWrite array[MaxStack+1]; }; +struct StdIO__T2_a { StdIO_ProcRead array[MaxStack+1]; }; +static StdIO__T1 StackW; static unsigned int StackWPtr; -static _T2 StackR; +static StdIO__T2 StackR; static unsigned int StackRPtr; /* diff --git a/gcc/m2/mc-boot/GTimeString.c b/gcc/m2/mc-boot/GTimeString.c index 512c5850624..440e82cc811 100644 --- a/gcc/m2/mc-boot/GTimeString.c +++ b/gcc/m2/mc-boot/GTimeString.c @@ -60,12 +60,12 @@ extern "C" void TimeString_GetTimeString (char *a, unsigned int _a_high); extern "C" void TimeString_GetTimeString (char *a, unsigned int _a_high) { - typedef char *_T1; + typedef char *GetTimeString__T1; - _T1 Addr; + GetTimeString__T1 Addr; unsigned int i; - Addr = static_cast<_T1> (wrapc_strtime ()); + Addr = static_cast (wrapc_strtime ()); i = 0; if (Addr != NULL) { diff --git a/gcc/m2/mc-boot/Galists.c b/gcc/m2/mc-boot/Galists.c index ec4d76058c9..9cd425a14a7 100644 --- a/gcc/m2/mc-boot/Galists.c +++ b/gcc/m2/mc-boot/Galists.c @@ -49,21 +49,21 @@ along with GNU Modula-2; see the file COPYING3. If not see typedef struct alists_performOperation_p alists_performOperation; # define MaxnoOfelements 5 -typedef struct _T1_r _T1; +typedef struct alists__T1_r alists__T1; -typedef struct _T2_a _T2; +typedef struct alists__T2_a alists__T2; -typedef _T1 *alists_alist; +typedef alists__T1 *alists_alist; typedef void (*alists_performOperation_t) (void *); struct alists_performOperation_p { alists_performOperation_t proc; }; -struct _T2_a { void * array[MaxnoOfelements-1+1]; }; -struct _T1_r { - unsigned int noOfelements; - _T2 elements; - alists_alist next; - }; +struct alists__T2_a { void * array[MaxnoOfelements-1+1]; }; +struct alists__T1_r { + unsigned int noOfelements; + alists__T2 elements; + alists_alist next; + }; /* @@ -158,7 +158,7 @@ static void removeItem (alists_alist p, alists_alist l, unsigned int i) if ((l->noOfelements == 0) && (p != NULL)) { p->next = l->next; - Storage_DEALLOCATE ((void **) &l, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &l, sizeof (alists__T1)); } } @@ -171,7 +171,7 @@ extern "C" alists_alist alists_initList (void) { alists_alist l; - Storage_ALLOCATE ((void **) &l, sizeof (_T1)); + Storage_ALLOCATE ((void **) &l, sizeof (alists__T1)); l->noOfelements = 0; l->next = NULL; return l; @@ -192,7 +192,7 @@ extern "C" void alists_killList (alists_alist *l) { alists_killList (&(*l)->next); } - Storage_DEALLOCATE ((void **) &(*l), sizeof (_T1)); + Storage_DEALLOCATE ((void **) &(*l), sizeof (alists__T1)); } } diff --git a/gcc/m2/mc-boot/Gdecl.c b/gcc/m2/mc-boot/Gdecl.c index 0e10b1fb9b2..47cdc9fa796 100644 --- a/gcc/m2/mc-boot/Gdecl.c +++ b/gcc/m2/mc-boot/Gdecl.c @@ -47,9 +47,9 @@ typedef unsigned int nameKey_Name; # define nameKey_NulName 0 typedef struct mcPretty_writeProc_p mcPretty_writeProc; -typedef struct _T8_r _T8; +typedef struct symbolKey__T8_r symbolKey__T8; -typedef _T8 *symbolKey_symbolTree; +typedef symbolKey__T8 *symbolKey_symbolTree; typedef struct mcPretty_writeLnProc_p mcPretty_writeLnProc; @@ -59,11 +59,11 @@ extern FIO_File FIO_StdOut; typedef struct symbolKey_performOperation_p symbolKey_performOperation; # define ASCII_tab ASCII_ht -typedef struct _T13_r _T13; +typedef struct alists__T13_r alists__T13; -typedef _T13 *alists_alist; +typedef alists__T13 *alists_alist; -typedef struct _T14_a _T14; +typedef struct alists__T14_a alists__T14; # define ASCII_ht (char) 011 # define ASCII_lf ASCII_nl @@ -126,9 +126,9 @@ typedef struct libc_timeb_r libc_timeb; typedef struct libc_exitP_p libc_exitP; -typedef struct _T11_r _T11; +typedef struct mcError__T11_r mcError__T11; -typedef _T11 *mcError_error; +typedef mcError__T11 *mcError_error; extern int mcLexBuf_currentinteger; extern unsigned int mcLexBuf_currentcolumn; @@ -150,179 +150,180 @@ typedef struct StdIO_ProcRead_p StdIO_ProcRead; # define forceCompoundStatement TRUE # define enableDefForCStrings FALSE # define enableMemsetOnAllocation TRUE -typedef struct nodeRec_r nodeRec; +# define forceQualified TRUE +typedef struct decl_nodeRec_r decl_nodeRec; -typedef struct intrinsicT_r intrinsicT; +typedef struct decl_intrinsicT_r decl_intrinsicT; -typedef struct fixupInfo_r fixupInfo; +typedef struct decl_fixupInfo_r decl_fixupInfo; -typedef struct explistT_r explistT; +typedef struct decl_explistT_r decl_explistT; -typedef struct setvalueT_r setvalueT; +typedef struct decl_setvalueT_r decl_setvalueT; -typedef struct identlistT_r identlistT; +typedef struct decl_identlistT_r decl_identlistT; -typedef struct funccallT_r funccallT; +typedef struct decl_funccallT_r decl_funccallT; -typedef struct commentT_r commentT; +typedef struct decl_commentT_r decl_commentT; -typedef struct stmtT_r stmtT; +typedef struct decl_stmtT_r decl_stmtT; -typedef struct returnT_r returnT; +typedef struct decl_returnT_r decl_returnT; -typedef struct exitT_r exitT; +typedef struct decl_exitT_r decl_exitT; -typedef struct vardeclT_r vardeclT; +typedef struct decl_vardeclT_r decl_vardeclT; -typedef struct typeT_r typeT; +typedef struct decl_typeT_r decl_typeT; -typedef struct recordT_r recordT; +typedef struct decl_recordT_r decl_recordT; -typedef struct varientT_r varientT; +typedef struct decl_varientT_r decl_varientT; -typedef struct varT_r varT; +typedef struct decl_varT_r decl_varT; -typedef struct enumerationT_r enumerationT; +typedef struct decl_enumerationT_r decl_enumerationT; -typedef struct subrangeT_r subrangeT; +typedef struct decl_subrangeT_r decl_subrangeT; -typedef struct subscriptT_r subscriptT; +typedef struct decl_subscriptT_r decl_subscriptT; -typedef struct arrayT_r arrayT; +typedef struct decl_arrayT_r decl_arrayT; -typedef struct stringT_r stringT; +typedef struct decl_stringT_r decl_stringT; -typedef struct literalT_r literalT; +typedef struct decl_literalT_r decl_literalT; -typedef struct constT_r constT; +typedef struct decl_constT_r decl_constT; -typedef struct varparamT_r varparamT; +typedef struct decl_varparamT_r decl_varparamT; -typedef struct paramT_r paramT; +typedef struct decl_paramT_r decl_paramT; -typedef struct varargsT_r varargsT; +typedef struct decl_varargsT_r decl_varargsT; -typedef struct optargT_r optargT; +typedef struct decl_optargT_r decl_optargT; -typedef struct pointerT_r pointerT; +typedef struct decl_pointerT_r decl_pointerT; -typedef struct recordfieldT_r recordfieldT; +typedef struct decl_recordfieldT_r decl_recordfieldT; -typedef struct varientfieldT_r varientfieldT; +typedef struct decl_varientfieldT_r decl_varientfieldT; -typedef struct enumerationfieldT_r enumerationfieldT; +typedef struct decl_enumerationfieldT_r decl_enumerationfieldT; -typedef struct setT_r setT; +typedef struct decl_setT_r decl_setT; -typedef struct componentrefT_r componentrefT; +typedef struct decl_componentrefT_r decl_componentrefT; -typedef struct pointerrefT_r pointerrefT; +typedef struct decl_pointerrefT_r decl_pointerrefT; -typedef struct arrayrefT_r arrayrefT; +typedef struct decl_arrayrefT_r decl_arrayrefT; -typedef struct commentPair_r commentPair; +typedef struct decl_commentPair_r decl_commentPair; -typedef struct assignmentT_r assignmentT; +typedef struct decl_assignmentT_r decl_assignmentT; -typedef struct ifT_r ifT; +typedef struct decl_ifT_r decl_ifT; -typedef struct elsifT_r elsifT; +typedef struct decl_elsifT_r decl_elsifT; -typedef struct loopT_r loopT; +typedef struct decl_loopT_r decl_loopT; -typedef struct whileT_r whileT; +typedef struct decl_whileT_r decl_whileT; -typedef struct repeatT_r repeatT; +typedef struct decl_repeatT_r decl_repeatT; -typedef struct caseT_r caseT; +typedef struct decl_caseT_r decl_caseT; -typedef struct caselabellistT_r caselabellistT; +typedef struct decl_caselabellistT_r decl_caselabellistT; -typedef struct caselistT_r caselistT; +typedef struct decl_caselistT_r decl_caselistT; -typedef struct rangeT_r rangeT; +typedef struct decl_rangeT_r decl_rangeT; -typedef struct forT_r forT; +typedef struct decl_forT_r decl_forT; -typedef struct statementT_r statementT; +typedef struct decl_statementT_r decl_statementT; -typedef struct scopeT_r scopeT; +typedef struct decl_scopeT_r decl_scopeT; -typedef struct procedureT_r procedureT; +typedef struct decl_procedureT_r decl_procedureT; -typedef struct proctypeT_r proctypeT; +typedef struct decl_proctypeT_r decl_proctypeT; -typedef struct binaryT_r binaryT; +typedef struct decl_binaryT_r decl_binaryT; -typedef struct unaryT_r unaryT; +typedef struct decl_unaryT_r decl_unaryT; -typedef struct moduleT_r moduleT; +typedef struct decl_moduleT_r decl_moduleT; -typedef struct defT_r defT; +typedef struct decl_defT_r decl_defT; -typedef struct impT_r impT; +typedef struct decl_impT_r decl_impT; -typedef struct where_r where; +typedef struct decl_where_r decl_where; -typedef struct nodeProcedure_p nodeProcedure; +typedef struct decl_nodeProcedure_p decl_nodeProcedure; -typedef struct cnameT_r cnameT; +typedef struct decl_cnameT_r decl_cnameT; # define MaxBuf 127 # define maxNoOfElements 5 -typedef enum {explist, funccall, exit_, return_, stmtseq, comment, halt, new_, dispose, inc, dec, incl, excl, length, nil, true_, false_, address, loc, byte, word, csizet, cssizet, char_, cardinal, longcard, shortcard, integer, longint, shortint, real, longreal, shortreal, bitset, boolean, proc, ztype, rtype, complex_, longcomplex, shortcomplex, type, record, varient, var, enumeration, subrange, array, subscript, string, const_, literal, varparam, param, varargs, optarg_, pointer, recordfield, varientfield, enumerationfield, set, proctype, procedure, def, imp, module, loop, while_, for_, repeat, case_, caselabellist, caselist, range, assignment, if_, elsif, constexp, neg, cast, val, plus, sub, div_, mod, mult, divide, in, adr, size, tsize, ord, float_, trunc_, chr, abs_, cap, high, throw_, unreachable, cmplx, re, im, min, max, componentref, pointerref, arrayref, deref, equal, notequal, less, greater, greequal, lessequal, lsl, lsr, lor, land, lnot, lxor, and_, or_, not_, identlist, vardecl, setvalue} nodeT; +typedef enum {decl_explist, decl_funccall, decl_exit, decl_return, decl_stmtseq, decl_comment, decl_halt, decl_new, decl_dispose, decl_inc, decl_dec, decl_incl, decl_excl, decl_length, decl_nil, decl_true, decl_false, decl_address, decl_loc, decl_byte, decl_word, decl_csizet, decl_cssizet, decl_char, decl_cardinal, decl_longcard, decl_shortcard, decl_integer, decl_longint, decl_shortint, decl_real, decl_longreal, decl_shortreal, decl_bitset, decl_boolean, decl_proc, decl_ztype, decl_rtype, decl_complex, decl_longcomplex, decl_shortcomplex, decl_type, decl_record, decl_varient, decl_var, decl_enumeration, decl_subrange, decl_array, decl_subscript, decl_string, decl_const, decl_literal, decl_varparam, decl_param, decl_varargs, decl_optarg, decl_pointer, decl_recordfield, decl_varientfield, decl_enumerationfield, decl_set, decl_proctype, decl_procedure, decl_def, decl_imp, decl_module, decl_loop, decl_while, decl_for, decl_repeat, decl_case, decl_caselabellist, decl_caselist, decl_range, decl_assignment, decl_if, decl_elsif, decl_constexp, decl_neg, decl_cast, decl_val, decl_plus, decl_sub, decl_div, decl_mod, decl_mult, decl_divide, decl_in, decl_adr, decl_size, decl_tsize, decl_ord, decl_float, decl_trunc, decl_chr, decl_abs, decl_cap, decl_high, decl_throw, decl_unreachable, decl_cmplx, decl_re, decl_im, decl_min, decl_max, decl_componentref, decl_pointerref, decl_arrayref, decl_deref, decl_equal, decl_notequal, decl_less, decl_greater, decl_greequal, decl_lessequal, decl_lsl, decl_lsr, decl_lor, decl_land, decl_lnot, decl_lxor, decl_and, decl_or, decl_not, decl_identlist, decl_vardecl, decl_setvalue} decl_nodeT; # define MaxnoOfelements 5 typedef enum {mcReserved_eoftok, mcReserved_plustok, mcReserved_minustok, mcReserved_timestok, mcReserved_dividetok, mcReserved_becomestok, mcReserved_ambersandtok, mcReserved_periodtok, mcReserved_commatok, mcReserved_semicolontok, mcReserved_lparatok, mcReserved_rparatok, mcReserved_lsbratok, mcReserved_rsbratok, mcReserved_lcbratok, mcReserved_rcbratok, mcReserved_uparrowtok, mcReserved_singlequotetok, mcReserved_equaltok, mcReserved_hashtok, mcReserved_lesstok, mcReserved_greatertok, mcReserved_lessgreatertok, mcReserved_lessequaltok, mcReserved_greaterequaltok, mcReserved_ldirectivetok, mcReserved_rdirectivetok, mcReserved_periodperiodtok, mcReserved_colontok, mcReserved_doublequotestok, mcReserved_bartok, mcReserved_andtok, mcReserved_arraytok, mcReserved_begintok, mcReserved_bytok, mcReserved_casetok, mcReserved_consttok, mcReserved_definitiontok, mcReserved_divtok, mcReserved_dotok, mcReserved_elsetok, mcReserved_elsiftok, mcReserved_endtok, mcReserved_excepttok, mcReserved_exittok, mcReserved_exporttok, mcReserved_finallytok, mcReserved_fortok, mcReserved_fromtok, mcReserved_iftok, mcReserved_implementationtok, mcReserved_importtok, mcReserved_intok, mcReserved_looptok, mcReserved_modtok, mcReserved_moduletok, mcReserved_nottok, mcReserved_oftok, mcReserved_ortok, mcReserved_packedsettok, mcReserved_pointertok, mcReserved_proceduretok, mcReserved_qualifiedtok, mcReserved_unqualifiedtok, mcReserved_recordtok, mcReserved_remtok, mcReserved_repeattok, mcReserved_retrytok, mcReserved_returntok, mcReserved_settok, mcReserved_thentok, mcReserved_totok, mcReserved_typetok, mcReserved_untiltok, mcReserved_vartok, mcReserved_whiletok, mcReserved_withtok, mcReserved_asmtok, mcReserved_volatiletok, mcReserved_periodperiodperiodtok, mcReserved_datetok, mcReserved_linetok, mcReserved_filetok, mcReserved_attributetok, mcReserved_builtintok, mcReserved_inlinetok, mcReserved_integertok, mcReserved_identtok, mcReserved_realtok, mcReserved_stringtok, mcReserved_commenttok} mcReserved_toktype; extern mcReserved_toktype mcLexBuf_currenttoken; -typedef enum {ansiC, ansiCP, pim4} language; +typedef enum {decl_ansiC, decl_ansiCP, decl_pim4} decl_language; -typedef enum {completed, blocked, partial, recursive} dependentState; +typedef enum {decl_completed, decl_blocked, decl_partial, decl_recursive} decl_dependentState; -typedef enum {text, punct, space} outputStates; +typedef enum {decl_text, decl_punct, decl_space} decl_outputStates; -typedef nodeRec *decl_node; +typedef decl_nodeRec *decl_node; -typedef struct _T5_r _T5; +typedef struct Indexing__T5_r Indexing__T5; -typedef struct _T6_r _T6; +typedef struct mcComment__T6_r mcComment__T6; -typedef enum {unknown, procedureHeading, inBody, afterStatement} commentType; +typedef enum {mcComment_unknown, mcComment_procedureHeading, mcComment_inBody, mcComment_afterStatement} mcComment_commentType; -typedef struct stringRecord_r stringRecord; +typedef struct DynamicStrings_stringRecord_r DynamicStrings_stringRecord; -typedef struct _T9_r _T9; +typedef struct wlists__T9_r wlists__T9; -typedef struct _T12_r _T12; +typedef struct mcPretty__T12_r mcPretty__T12; -typedef struct Contents_r Contents; +typedef struct DynamicStrings_Contents_r DynamicStrings_Contents; -typedef struct _T7_a _T7; +typedef struct DynamicStrings__T7_a DynamicStrings__T7; -typedef struct _T10_a _T10; +typedef struct wlists__T10_a wlists__T10; -typedef _T5 *Indexing_Index; +typedef Indexing__T5 *Indexing_Index; -typedef _T6 *mcComment_commentDesc; +typedef mcComment__T6 *mcComment_commentDesc; extern mcComment_commentDesc mcLexBuf_currentcomment; extern mcComment_commentDesc mcLexBuf_lastcomment; -typedef stringRecord *DynamicStrings_String; +typedef DynamicStrings_stringRecord *DynamicStrings_String; -typedef _T9 *wlists_wlist; +typedef wlists__T9 *wlists_wlist; -typedef _T12 *mcPretty_pretty; +typedef mcPretty__T12 *mcPretty_pretty; typedef void (*mcPretty_writeProc_t) (char); struct mcPretty_writeProc_p { mcPretty_writeProc_t proc; }; -struct _T8_r { - nameKey_Name name; - void *key; - symbolKey_symbolTree left; - symbolKey_symbolTree right; - }; +struct symbolKey__T8_r { + nameKey_Name name; + void *key; + symbolKey_symbolTree left; + symbolKey_symbolTree right; + }; typedef void (*mcPretty_writeLnProc_t) (void); struct mcPretty_writeLnProc_p { mcPretty_writeLnProc_t proc; }; @@ -330,7 +331,7 @@ struct mcPretty_writeLnProc_p { mcPretty_writeLnProc_t proc; }; typedef void (*symbolKey_performOperation_t) (void *); struct symbolKey_performOperation_p { symbolKey_performOperation_t proc; }; -struct _T14_a { void * array[MaxnoOfelements-1+1]; }; +struct alists__T14_a { void * array[MaxnoOfelements-1+1]; }; typedef void (*Indexing_IndexProcedure_t) (void *); struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; }; @@ -369,14 +370,14 @@ typedef libc_exitP_t libc_exitP_C; struct libc_exitP_p { libc_exitP_t proc; }; -struct _T11_r { - mcError_error parent; - mcError_error child; - mcError_error next; - unsigned int fatal; - DynamicStrings_String s; - unsigned int token; - }; +struct mcError__T11_r { + mcError_error parent; + mcError_error child; + mcError_error next; + unsigned int fatal; + DynamicStrings_String s; + unsigned int token; + }; typedef void (*alists_performOperation_t) (void *); struct alists_performOperation_p { alists_performOperation_t proc; }; @@ -390,559 +391,559 @@ struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; typedef void (*StdIO_ProcRead_t) (char *); struct StdIO_ProcRead_p { StdIO_ProcRead_t proc; }; -struct fixupInfo_r { - unsigned int count; - Indexing_Index info; - }; - -struct explistT_r { - Indexing_Index exp; - }; +struct decl_fixupInfo_r { + unsigned int count; + Indexing_Index info; + }; -struct setvalueT_r { - decl_node type; - Indexing_Index values; - }; +struct decl_explistT_r { + Indexing_Index exp; + }; -struct identlistT_r { - wlists_wlist names; - unsigned int cnamed; - }; +struct decl_setvalueT_r { + decl_node type; + Indexing_Index values; + }; -struct commentT_r { - mcComment_commentDesc content; - }; +struct decl_identlistT_r { + wlists_wlist names; + unsigned int cnamed; + }; -struct stmtT_r { - Indexing_Index statements; - }; +struct decl_commentT_r { + mcComment_commentDesc content; + }; -struct exitT_r { - decl_node loop; - }; +struct decl_stmtT_r { + Indexing_Index statements; + }; -struct vardeclT_r { - wlists_wlist names; - decl_node type; - decl_node scope; - }; +struct decl_exitT_r { + decl_node loop; + }; -struct typeT_r { - nameKey_Name name; - decl_node type; - decl_node scope; - unsigned int isHidden; - unsigned int isInternal; - }; - -struct recordT_r { - symbolKey_symbolTree localSymbols; - Indexing_Index listOfSons; - decl_node scope; - }; +struct decl_vardeclT_r { + wlists_wlist names; + decl_node type; + decl_node scope; + }; -struct varientT_r { - Indexing_Index listOfSons; - decl_node varient; - decl_node tag; - decl_node scope; - }; +struct decl_typeT_r { + nameKey_Name name; + decl_node type; + decl_node scope; + unsigned int isHidden; + unsigned int isInternal; + }; -struct enumerationT_r { - unsigned int noOfElements; +struct decl_recordT_r { symbolKey_symbolTree localSymbols; Indexing_Index listOfSons; - decl_node low; - decl_node high; decl_node scope; }; -struct subrangeT_r { - decl_node low; - decl_node high; - decl_node type; - decl_node scope; - }; +struct decl_varientT_r { + Indexing_Index listOfSons; + decl_node varient; + decl_node tag; + decl_node scope; + }; -struct subscriptT_r { - decl_node type; - decl_node expr; - }; +struct decl_enumerationT_r { + unsigned int noOfElements; + symbolKey_symbolTree localSymbols; + Indexing_Index listOfSons; + decl_node low; + decl_node high; + decl_node scope; + }; -struct arrayT_r { - decl_node subr; - decl_node type; - decl_node scope; - unsigned int isUnbounded; - }; - -struct stringT_r { - nameKey_Name name; - unsigned int length; - unsigned int isCharCompatible; - DynamicStrings_String cstring; - unsigned int clength; - DynamicStrings_String cchar; - }; +struct decl_subrangeT_r { + decl_node low; + decl_node high; + decl_node type; + decl_node scope; + }; -struct literalT_r { - nameKey_Name name; - decl_node type; - }; +struct decl_subscriptT_r { + decl_node type; + decl_node expr; + }; -struct constT_r { - nameKey_Name name; - decl_node type; - decl_node value; - decl_node scope; - }; +struct decl_arrayT_r { + decl_node subr; + decl_node type; + decl_node scope; + unsigned int isUnbounded; + }; -struct varparamT_r { - decl_node namelist; - decl_node type; - decl_node scope; - unsigned int isUnbounded; - unsigned int isForC; - unsigned int isUsed; - }; +struct decl_stringT_r { + nameKey_Name name; + unsigned int length; + unsigned int isCharCompatible; + DynamicStrings_String cstring; + unsigned int clength; + DynamicStrings_String cchar; + }; -struct paramT_r { - decl_node namelist; - decl_node type; - decl_node scope; - unsigned int isUnbounded; - unsigned int isForC; - unsigned int isUsed; - }; - -struct varargsT_r { - decl_node scope; - }; +struct decl_literalT_r { + nameKey_Name name; + decl_node type; + }; -struct optargT_r { - decl_node namelist; - decl_node type; - decl_node scope; - decl_node init; - }; +struct decl_constT_r { + nameKey_Name name; + decl_node type; + decl_node value; + decl_node scope; + }; -struct pointerT_r { - decl_node type; - decl_node scope; - }; +struct decl_varparamT_r { + decl_node namelist; + decl_node type; + decl_node scope; + unsigned int isUnbounded; + unsigned int isForC; + unsigned int isUsed; + }; -struct varientfieldT_r { - nameKey_Name name; - decl_node parent; - decl_node varient; - unsigned int simple; - Indexing_Index listOfSons; +struct decl_paramT_r { + decl_node namelist; + decl_node type; + decl_node scope; + unsigned int isUnbounded; + unsigned int isForC; + unsigned int isUsed; + }; + +struct decl_varargsT_r { decl_node scope; }; -struct setT_r { - decl_node type; - decl_node scope; - }; +struct decl_optargT_r { + decl_node namelist; + decl_node type; + decl_node scope; + decl_node init; + }; -struct componentrefT_r { - decl_node rec; - decl_node field; - decl_node resultType; +struct decl_pointerT_r { + decl_node type; + decl_node scope; }; -struct pointerrefT_r { - decl_node ptr; - decl_node field; - decl_node resultType; - }; +struct decl_varientfieldT_r { + nameKey_Name name; + decl_node parent; + decl_node varient; + unsigned int simple; + Indexing_Index listOfSons; + decl_node scope; + }; -struct arrayrefT_r { - decl_node array; - decl_node index; - decl_node resultType; +struct decl_setT_r { + decl_node type; + decl_node scope; }; -struct commentPair_r { - decl_node after; - decl_node body; - }; +struct decl_componentrefT_r { + decl_node rec; + decl_node field; + decl_node resultType; + }; + +struct decl_pointerrefT_r { + decl_node ptr; + decl_node field; + decl_node resultType; + }; + +struct decl_arrayrefT_r { + decl_node array; + decl_node index; + decl_node resultType; + }; -struct loopT_r { - decl_node statements; - unsigned int labelno; - }; +struct decl_commentPair_r { + decl_node after; + decl_node body; + }; -struct caseT_r { - decl_node expression; - Indexing_Index caseLabelList; - decl_node else_; - }; +struct decl_loopT_r { + decl_node statements; + unsigned int labelno; + }; + +struct decl_caseT_r { + decl_node expression; + Indexing_Index caseLabelList; + decl_node else_; + }; -struct caselabellistT_r { - decl_node caseList; - decl_node statements; +struct decl_caselabellistT_r { + decl_node caseList; + decl_node statements; + }; + +struct decl_caselistT_r { + Indexing_Index rangePairs; }; -struct caselistT_r { - Indexing_Index rangePairs; +struct decl_rangeT_r { + decl_node lo; + decl_node hi; + }; + +struct decl_forT_r { + decl_node des; + decl_node start; + decl_node end; + decl_node increment; + decl_node statements; }; -struct rangeT_r { - decl_node lo; - decl_node hi; - }; - -struct forT_r { - decl_node des; - decl_node start; - decl_node end; - decl_node increment; - decl_node statements; - }; - -struct statementT_r { - Indexing_Index sequence; - }; +struct decl_statementT_r { + Indexing_Index sequence; + }; -struct scopeT_r { - symbolKey_symbolTree symbols; - Indexing_Index constants; - Indexing_Index types; - Indexing_Index procedures; - Indexing_Index variables; - }; - -struct proctypeT_r { - Indexing_Index parameters; - unsigned int returnopt; - unsigned int vararg; - decl_node optarg_; - decl_node scope; - decl_node returnType; - }; +struct decl_scopeT_r { + symbolKey_symbolTree symbols; + Indexing_Index constants; + Indexing_Index types; + Indexing_Index procedures; + Indexing_Index variables; + }; -struct binaryT_r { - decl_node left; - decl_node right; - decl_node resultType; - }; +struct decl_proctypeT_r { + Indexing_Index parameters; + unsigned int returnopt; + unsigned int vararg; + decl_node optarg_; + decl_node scope; + decl_node returnType; + }; -struct unaryT_r { - decl_node arg; - decl_node resultType; - }; - -struct where_r { - unsigned int defDeclared; - unsigned int modDeclared; - unsigned int firstUsed; - }; - -typedef void (*nodeProcedure_t) (decl_node); -struct nodeProcedure_p { nodeProcedure_t proc; }; - -struct cnameT_r { - nameKey_Name name; - unsigned int init; - }; - -struct _T5_r { - void *ArrayStart; - unsigned int ArraySize; - unsigned int Used; - unsigned int Low; - unsigned int High; - unsigned int Debug; - unsigned int Map; - }; - -struct _T6_r { - commentType type; - DynamicStrings_String content; - nameKey_Name procName; - unsigned int used; - }; - -struct _T7_a { char array[(MaxBuf-1)+1]; }; -struct _T10_a { unsigned int array[maxNoOfElements-1+1]; }; -struct _T13_r { - unsigned int noOfelements; - _T14 elements; - alists_alist next; - }; - -struct intrinsicT_r { - decl_node args; - unsigned int noArgs; - decl_node type; - commentPair intrinsicComment; - unsigned int postUnreachable; +struct decl_binaryT_r { + decl_node left; + decl_node right; + decl_node resultType; + }; + +struct decl_unaryT_r { + decl_node arg; + decl_node resultType; + }; + +struct decl_where_r { + unsigned int defDeclared; + unsigned int modDeclared; + unsigned int firstUsed; }; -struct funccallT_r { - decl_node function; - decl_node args; - decl_node type; - commentPair funccallComment; - }; +typedef void (*decl_nodeProcedure_t) (decl_node); +struct decl_nodeProcedure_p { decl_nodeProcedure_t proc; }; -struct returnT_r { - decl_node exp; - decl_node scope; - commentPair returnComment; - }; +struct decl_cnameT_r { + nameKey_Name name; + unsigned int init; + }; -struct varT_r { - nameKey_Name name; - decl_node type; - decl_node decl; - decl_node scope; - unsigned int isInitialised; - unsigned int isParameter; - unsigned int isVarParameter; - unsigned int isUsed; - cnameT cname; - }; - -struct recordfieldT_r { - nameKey_Name name; - decl_node type; - unsigned int tag; - decl_node parent; - decl_node varient; +struct Indexing__T5_r { + void *ArrayStart; + unsigned int ArraySize; + unsigned int Used; + unsigned int Low; + unsigned int High; + unsigned int Debug; + unsigned int Map; + }; + +struct mcComment__T6_r { + mcComment_commentType type; + DynamicStrings_String content; + nameKey_Name procName; + unsigned int used; + }; + +struct DynamicStrings__T7_a { char array[(MaxBuf-1)+1]; }; +struct wlists__T10_a { unsigned int array[maxNoOfElements-1+1]; }; +struct alists__T13_r { + unsigned int noOfelements; + alists__T14 elements; + alists_alist next; + }; + +struct decl_intrinsicT_r { + decl_node args; + unsigned int noArgs; + decl_node type; + decl_commentPair intrinsicComment; + unsigned int postUnreachable; + }; + +struct decl_funccallT_r { + decl_node function; + decl_node args; + decl_node type; + decl_commentPair funccallComment; + }; + +struct decl_returnT_r { + decl_node exp; decl_node scope; - cnameT cname; + decl_commentPair returnComment; }; -struct enumerationfieldT_r { +struct decl_varT_r { + nameKey_Name name; + decl_node type; + decl_node decl; + decl_node scope; + unsigned int isInitialised; + unsigned int isParameter; + unsigned int isVarParameter; + unsigned int isUsed; + decl_cnameT cname; + }; + +struct decl_recordfieldT_r { nameKey_Name name; decl_node type; + unsigned int tag; + decl_node parent; + decl_node varient; decl_node scope; - unsigned int value; - cnameT cname; + decl_cnameT cname; }; -struct assignmentT_r { - decl_node des; +struct decl_enumerationfieldT_r { + nameKey_Name name; + decl_node type; + decl_node scope; + unsigned int value; + decl_cnameT cname; + }; + +struct decl_assignmentT_r { + decl_node des; + decl_node expr; + decl_commentPair assignComment; + }; + +struct decl_ifT_r { + decl_node expr; + decl_node elsif; + decl_node then; + decl_node else_; + decl_commentPair ifComment; + decl_commentPair elseComment; + decl_commentPair endComment; + }; + +struct decl_elsifT_r { decl_node expr; - commentPair assignComment; + decl_node elsif; + decl_node then; + decl_node else_; + decl_commentPair elseComment; }; -struct ifT_r { - decl_node expr; - decl_node elsif; - decl_node then; - decl_node else_; - commentPair ifComment; - commentPair elseComment; - commentPair endComment; - }; - -struct elsifT_r { - decl_node expr; - decl_node elsif; - decl_node then; - decl_node else_; - commentPair elseComment; - }; - -struct whileT_r { - decl_node expr; - decl_node statements; - commentPair doComment; - commentPair endComment; - }; - -struct repeatT_r { - decl_node expr; - decl_node statements; - commentPair repeatComment; - commentPair untilComment; - }; - -struct procedureT_r { - nameKey_Name name; - scopeT decls; - decl_node scope; - Indexing_Index parameters; - unsigned int isForC; - unsigned int built; - unsigned int checking; - unsigned int returnopt; - unsigned int vararg; - unsigned int noreturnused; - unsigned int noreturn; - unsigned int paramcount; - decl_node optarg_; - decl_node returnType; - decl_node beginStatements; - cnameT cname; - mcComment_commentDesc defComment; - mcComment_commentDesc modComment; - }; - -struct moduleT_r { - nameKey_Name name; - nameKey_Name source; - Indexing_Index importedModules; - fixupInfo constFixup; - fixupInfo enumFixup; - scopeT decls; - decl_node beginStatements; - decl_node finallyStatements; - unsigned int enumsComplete; - unsigned int constsComplete; - unsigned int visited; - commentPair com; - }; +struct decl_whileT_r { + decl_node expr; + decl_node statements; + decl_commentPair doComment; + decl_commentPair endComment; + }; -struct defT_r { - nameKey_Name name; - nameKey_Name source; - unsigned int hasHidden; - unsigned int forC; - Indexing_Index exported; - Indexing_Index importedModules; - fixupInfo constFixup; - fixupInfo enumFixup; - scopeT decls; - unsigned int enumsComplete; - unsigned int constsComplete; - unsigned int visited; - commentPair com; - }; - -struct impT_r { - nameKey_Name name; - nameKey_Name source; - Indexing_Index importedModules; - fixupInfo constFixup; - fixupInfo enumFixup; - decl_node beginStatements; - decl_node finallyStatements; - decl_node definitionModule; - scopeT decls; - unsigned int enumsComplete; - unsigned int constsComplete; - unsigned int visited; - commentPair com; - }; - -struct _T9_r { - unsigned int noOfElements; - _T10 elements; - wlists_wlist next; - }; - -struct _T12_r { - mcPretty_writeProc write_; - mcPretty_writeLnProc writeln; - unsigned int needsSpace; - unsigned int needsIndent; - unsigned int seekPos; - unsigned int curLine; - unsigned int curPos; - unsigned int indent; - mcPretty_pretty stacked; - }; - -struct Contents_r { - _T7 buf; - unsigned int len; - DynamicStrings_String next; - }; +struct decl_repeatT_r { + decl_node expr; + decl_node statements; + decl_commentPair repeatComment; + decl_commentPair untilComment; + }; -typedef struct descriptor_r descriptor; +struct decl_procedureT_r { + nameKey_Name name; + decl_scopeT decls; + decl_node scope; + Indexing_Index parameters; + unsigned int isForC; + unsigned int built; + unsigned int checking; + unsigned int returnopt; + unsigned int vararg; + unsigned int noreturnused; + unsigned int noreturn; + unsigned int paramcount; + decl_node optarg_; + decl_node returnType; + decl_node beginStatements; + decl_cnameT cname; + mcComment_commentDesc defComment; + mcComment_commentDesc modComment; + }; -typedef descriptor *Descriptor; +struct decl_moduleT_r { + nameKey_Name name; + nameKey_Name source; + Indexing_Index importedModules; + decl_fixupInfo constFixup; + decl_fixupInfo enumFixup; + decl_scopeT decls; + decl_node beginStatements; + decl_node finallyStatements; + unsigned int enumsComplete; + unsigned int constsComplete; + unsigned int visited; + decl_commentPair com; + }; -typedef struct DebugInfo_r DebugInfo; +struct decl_defT_r { + nameKey_Name name; + nameKey_Name source; + unsigned int hasHidden; + unsigned int forC; + Indexing_Index exported; + Indexing_Index importedModules; + decl_fixupInfo constFixup; + decl_fixupInfo enumFixup; + decl_scopeT decls; + unsigned int enumsComplete; + unsigned int constsComplete; + unsigned int visited; + decl_commentPair com; + }; -typedef enum {inuse, marked, onlist, poisoned} desState; +struct decl_impT_r { + nameKey_Name name; + nameKey_Name source; + Indexing_Index importedModules; + decl_fixupInfo constFixup; + decl_fixupInfo enumFixup; + decl_node beginStatements; + decl_node finallyStatements; + decl_node definitionModule; + decl_scopeT decls; + unsigned int enumsComplete; + unsigned int constsComplete; + unsigned int visited; + decl_commentPair com; + }; -struct descriptor_r { - unsigned int charStarUsed; - void *charStar; - unsigned int charStarSize; - unsigned int charStarValid; - desState state; - DynamicStrings_String garbage; +struct wlists__T9_r { + unsigned int noOfElements; + wlists__T10 elements; + wlists_wlist next; }; -struct DebugInfo_r { - DynamicStrings_String next; - void *file; - unsigned int line; - void *proc; - }; - -struct nodeRec_r { - nodeT kind; /* case tag */ - union { - intrinsicT intrinsicF; - explistT explistF; - exitT exitF; - returnT returnF; - stmtT stmtF; - commentT commentF; - typeT typeF; - recordT recordF; - varientT varientF; - varT varF; - enumerationT enumerationF; - subrangeT subrangeF; - subscriptT subscriptF; - arrayT arrayF; - stringT stringF; - constT constF; - literalT literalF; - varparamT varparamF; - paramT paramF; - varargsT varargsF; - optargT optargF; - pointerT pointerF; - recordfieldT recordfieldF; - varientfieldT varientfieldF; - enumerationfieldT enumerationfieldF; - setT setF; - proctypeT proctypeF; - procedureT procedureF; - defT defF; - impT impF; - moduleT moduleF; - loopT loopF; - whileT whileF; - forT forF; - repeatT repeatF; - caseT caseF; - caselabellistT caselabellistF; - caselistT caselistF; - rangeT rangeF; - ifT ifF; - elsifT elsifF; - assignmentT assignmentF; - arrayrefT arrayrefF; - pointerrefT pointerrefF; - componentrefT componentrefF; - binaryT binaryF; - unaryT unaryF; - identlistT identlistF; - vardeclT vardeclF; - funccallT funccallF; - setvalueT setvalueF; - }; - where at; - }; +struct mcPretty__T12_r { + mcPretty_writeProc write_; + mcPretty_writeLnProc writeln; + unsigned int needsSpace; + unsigned int needsIndent; + unsigned int seekPos; + unsigned int curLine; + unsigned int curPos; + unsigned int indent; + mcPretty_pretty stacked; + }; -struct stringRecord_r { - Contents contents; - Descriptor head; - DebugInfo debug; +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; + +typedef struct DynamicStrings_DebugInfo_r DynamicStrings_DebugInfo; + +typedef enum {DynamicStrings_inuse, DynamicStrings_marked, DynamicStrings_onlist, DynamicStrings_poisoned} DynamicStrings_desState; + +struct DynamicStrings_descriptor_r { + unsigned int charStarUsed; + void *charStar; + unsigned int charStarSize; + unsigned int charStarValid; + DynamicStrings_desState state; + DynamicStrings_String garbage; + }; + +struct DynamicStrings_DebugInfo_r { + DynamicStrings_String next; + void *file; + unsigned int line; + void *proc; + }; + +struct decl_nodeRec_r { + decl_nodeT kind; /* case tag */ + union { + decl_intrinsicT intrinsicF; + decl_explistT explistF; + decl_exitT exitF; + decl_returnT returnF; + decl_stmtT stmtF; + decl_commentT commentF; + decl_typeT typeF; + decl_recordT recordF; + decl_varientT varientF; + decl_varT varF; + decl_enumerationT enumerationF; + decl_subrangeT subrangeF; + decl_subscriptT subscriptF; + decl_arrayT arrayF; + decl_stringT stringF; + decl_constT constF; + decl_literalT literalF; + decl_varparamT varparamF; + decl_paramT paramF; + decl_varargsT varargsF; + decl_optargT optargF; + decl_pointerT pointerF; + decl_recordfieldT recordfieldF; + decl_varientfieldT varientfieldF; + decl_enumerationfieldT enumerationfieldF; + decl_setT setF; + decl_proctypeT proctypeF; + decl_procedureT procedureF; + decl_defT defF; + decl_impT impF; + decl_moduleT moduleF; + decl_loopT loopF; + decl_whileT whileF; + decl_forT forF; + decl_repeatT repeatF; + decl_caseT caseF; + decl_caselabellistT caselabellistF; + decl_caselistT caselistF; + decl_rangeT rangeF; + decl_ifT ifF; + decl_elsifT elsifF; + decl_assignmentT assignmentF; + decl_arrayrefT arrayrefF; + decl_pointerrefT pointerrefF; + decl_componentrefT componentrefF; + decl_binaryT binaryF; + decl_unaryT unaryF; + decl_identlistT identlistF; + decl_vardeclT vardeclF; + decl_funccallT funccallF; + decl_setvalueT setvalueF; + }; + decl_where at; }; +struct DynamicStrings_stringRecord_r { + DynamicStrings_Contents contents; + DynamicStrings_Descriptor head; + DynamicStrings_DebugInfo debug; + }; + static FIO_File outputFile; -static language lang; +static decl_language lang; static decl_node bitsperunitN; static decl_node bitsperwordN; static decl_node bitspercharN; @@ -1011,7 +1012,7 @@ static Indexing_Index modUniverseI; static symbolKey_symbolTree modUniverse; static symbolKey_symbolTree defUniverse; static symbolKey_symbolTree baseSymbols; -static outputStates outputState; +static decl_outputStates outputState; static mcPretty_pretty doP; static alists_alist todoQ; static alists_alist partialQ; @@ -3407,7 +3408,7 @@ extern "C" void mcPrintf_fprintf4 (FIO_File file, const char *a_, unsigned int _ newNode - create and return a new node of kind k. */ -static decl_node newNode (nodeT k); +static decl_node newNode (decl_nodeT k); /* disposeNode - dispose node, n. @@ -3455,7 +3456,7 @@ static unsigned int isAProcType (decl_node n); initFixupInfo - initialize the fixupInfo record. */ -static fixupInfo initFixupInfo (void); +static decl_fixupInfo initFixupInfo (void); /* makeDef - returns a definition module node named, n. @@ -3485,14 +3486,14 @@ static unsigned int isDefForC (decl_node n); initDecls - initialize the decls, scopeT. */ -static void initDecls (scopeT *decls); +static void initDecls (decl_scopeT *decls); /* addTo - adds node, d, to scope decls and returns, d. It stores, d, in the symbols tree associated with decls. */ -static decl_node addTo (scopeT *decls, decl_node d); +static decl_node addTo (decl_scopeT *decls, decl_node d); /* export - export node, n, from definition module, d. @@ -3523,7 +3524,7 @@ static void completedEnum (decl_node n); setUnary - sets a unary node to contain, arg, a, and type, t. */ -static void setUnary (decl_node u, nodeT k, decl_node a, decl_node t); +static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t); /* putVarBool - assigns the four booleans associated with a variable. @@ -3679,7 +3680,7 @@ static void addEnumToModule (decl_node m, decl_node e); getNextFixup - return the next fixup from from f. */ -static decl_node getNextFixup (fixupInfo *f); +static decl_node getNextFixup (decl_fixupInfo *f); /* doMakeEnum - create an enumeration type and add it to the current module. @@ -3742,19 +3743,19 @@ static decl_node makeVal (decl_node params); */ static decl_node makeCast (decl_node c, decl_node p); -static decl_node makeIntrinsicProc (nodeT k, unsigned int noArgs, decl_node p); +static decl_node makeIntrinsicProc (decl_nodeT k, unsigned int noArgs, decl_node p); /* makeIntrinsicUnaryType - create an intrisic unary type. */ -static decl_node makeIntrinsicUnaryType (nodeT k, decl_node paramList, decl_node returnType); +static decl_node makeIntrinsicUnaryType (decl_nodeT k, decl_node paramList, decl_node returnType); /* makeIntrinsicBinaryType - create an intrisic binary type. */ -static decl_node makeIntrinsicBinaryType (nodeT k, decl_node paramList, decl_node returnType); +static decl_node makeIntrinsicBinaryType (decl_nodeT k, decl_node paramList, decl_node returnType); /* checkIntrinsic - checks to see if the function call to, c, with @@ -3843,7 +3844,7 @@ static unsigned int isBinary (decl_node n); and res as the return type. */ -static decl_node makeUnary (nodeT k, decl_node e, decl_node res); +static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res); /* isLeafString - returns TRUE if n is a leaf node which is a string constant. @@ -3880,20 +3881,20 @@ static decl_node resolveString (decl_node n); foldBinary - */ -static decl_node foldBinary (nodeT k, decl_node l, decl_node r, decl_node res); +static decl_node foldBinary (decl_nodeT k, decl_node l, decl_node r, decl_node res); /* makeBinary - create a binary node with left/right/result type: l, r and resultType. */ -static decl_node makeBinary (nodeT k, decl_node l, decl_node r, decl_node resultType); +static decl_node makeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node resultType); /* doMakeBinary - returns a binary node containing left/right/result values l, r, res, with a node operator, k. */ -static decl_node doMakeBinary (nodeT k, decl_node l, decl_node r, decl_node res); +static decl_node doMakeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node res); /* doMakeComponentRef - @@ -3925,7 +3926,7 @@ static unsigned int isDeref (decl_node n); enumerated below. */ -static decl_node makeBase (nodeT k); +static decl_node makeBase (decl_nodeT k); /* isOrdinal - returns TRUE if, n, is an ordinal type. @@ -4005,6 +4006,12 @@ static void doIncludeC (decl_node n); static decl_node getSymScope (decl_node n); +/* + isQualifiedForced - should the node be written with a module prefix? +*/ + +static unsigned int isQualifiedForced (decl_node n); + /* getFQstring - */ @@ -4063,7 +4070,7 @@ static void doSetSub (mcPretty_pretty p, decl_node left, decl_node right); doPolyBinary - */ -static void doPolyBinary (mcPretty_pretty p, nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r); +static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r); /* doBinary - @@ -4371,13 +4378,13 @@ static void doNameC (mcPretty_pretty p, decl_node n); initCname - */ -static void initCname (cnameT *c); +static void initCname (decl_cnameT *c); /* doCname - */ -static nameKey_Name doCname (nameKey_Name n, cnameT *c, unsigned int scopes); +static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes); /* getDName - @@ -4803,7 +4810,7 @@ static void doSimplify (decl_node n); simplifyTypes - */ -static void simplifyTypes (scopeT s); +static void simplifyTypes (decl_scopeT s); /* outDeclsDefC - @@ -4815,19 +4822,19 @@ static void outDeclsDefC (mcPretty_pretty p, decl_node n); includeConstType - */ -static void includeConstType (scopeT s); +static void includeConstType (decl_scopeT s); /* includeVarProcedure - */ -static void includeVarProcedure (scopeT s); +static void includeVarProcedure (decl_scopeT s); /* includeVar - */ -static void includeVar (scopeT s); +static void includeVar (decl_scopeT s); /* includeExternals - @@ -4889,7 +4896,7 @@ static void foreachModuleDo (decl_node n, symbolKey_performOperation p); outDeclsImpC - */ -static void outDeclsImpC (mcPretty_pretty p, scopeT s); +static void outDeclsImpC (mcPretty_pretty p, decl_scopeT s); /* doStatementSequenceC - @@ -5459,13 +5466,13 @@ static void stop (void); doLocalVarC - */ -static void doLocalVarC (mcPretty_pretty p, scopeT s); +static void doLocalVarC (mcPretty_pretty p, decl_scopeT s); /* doLocalConstTypesC - */ -static void doLocalConstTypesC (mcPretty_pretty p, scopeT s); +static void doLocalConstTypesC (mcPretty_pretty p, decl_scopeT s); /* addParamDone - @@ -5537,31 +5544,31 @@ static void doProcedureC (decl_node n); outProceduresC - */ -static void outProceduresC (mcPretty_pretty p, scopeT s); +static void outProceduresC (mcPretty_pretty p, decl_scopeT s); /* output - */ -static void output (decl_node n, nodeProcedure c, nodeProcedure t, nodeProcedure v); +static void output (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v); /* allDependants - */ -static dependentState allDependants (decl_node n); +static decl_dependentState allDependants (decl_node n); /* walkDependants - */ -static dependentState walkDependants (alists_alist l, decl_node n); +static decl_dependentState walkDependants (alists_alist l, decl_node n); /* walkType - */ -static dependentState walkType (alists_alist l, decl_node n); +static decl_dependentState walkType (alists_alist l, decl_node n); /* db - @@ -5579,7 +5586,7 @@ static void dbt (const char *a_, unsigned int _a_high); dbs - */ -static void dbs (dependentState s, decl_node n); +static void dbs (decl_dependentState s, decl_node n); /* dbq - @@ -5591,13 +5598,13 @@ static void dbq (decl_node n); walkRecord - */ -static dependentState walkRecord (alists_alist l, decl_node n); +static decl_dependentState walkRecord (alists_alist l, decl_node n); /* walkVarient - */ -static dependentState walkVarient (alists_alist l, decl_node n); +static decl_dependentState walkVarient (alists_alist l, decl_node n); /* queueBlocked - @@ -5609,470 +5616,470 @@ static void queueBlocked (decl_node n); walkVar - */ -static dependentState walkVar (alists_alist l, decl_node n); +static decl_dependentState walkVar (alists_alist l, decl_node n); /* walkEnumeration - */ -static dependentState walkEnumeration (alists_alist l, decl_node n); +static decl_dependentState walkEnumeration (alists_alist l, decl_node n); /* walkSubrange - */ -static dependentState walkSubrange (alists_alist l, decl_node n); +static decl_dependentState walkSubrange (alists_alist l, decl_node n); /* walkSubscript - */ -static dependentState walkSubscript (alists_alist l, decl_node n); +static decl_dependentState walkSubscript (alists_alist l, decl_node n); /* walkPointer - */ -static dependentState walkPointer (alists_alist l, decl_node n); +static decl_dependentState walkPointer (alists_alist l, decl_node n); /* walkArray - */ -static dependentState walkArray (alists_alist l, decl_node n); +static decl_dependentState walkArray (alists_alist l, decl_node n); /* walkConst - */ -static dependentState walkConst (alists_alist l, decl_node n); +static decl_dependentState walkConst (alists_alist l, decl_node n); /* walkVarParam - */ -static dependentState walkVarParam (alists_alist l, decl_node n); +static decl_dependentState walkVarParam (alists_alist l, decl_node n); /* walkParam - */ -static dependentState walkParam (alists_alist l, decl_node n); +static decl_dependentState walkParam (alists_alist l, decl_node n); /* walkOptarg - */ -static dependentState walkOptarg (alists_alist l, decl_node n); +static decl_dependentState walkOptarg (alists_alist l, decl_node n); /* walkRecordField - */ -static dependentState walkRecordField (alists_alist l, decl_node n); +static decl_dependentState walkRecordField (alists_alist l, decl_node n); /* walkVarientField - */ -static dependentState walkVarientField (alists_alist l, decl_node n); +static decl_dependentState walkVarientField (alists_alist l, decl_node n); /* walkEnumerationField - */ -static dependentState walkEnumerationField (alists_alist l, decl_node n); +static decl_dependentState walkEnumerationField (alists_alist l, decl_node n); /* walkSet - */ -static dependentState walkSet (alists_alist l, decl_node n); +static decl_dependentState walkSet (alists_alist l, decl_node n); /* walkProcType - */ -static dependentState walkProcType (alists_alist l, decl_node n); +static decl_dependentState walkProcType (alists_alist l, decl_node n); /* walkProcedure - */ -static dependentState walkProcedure (alists_alist l, decl_node n); +static decl_dependentState walkProcedure (alists_alist l, decl_node n); /* walkParameters - */ -static dependentState walkParameters (alists_alist l, Indexing_Index p); +static decl_dependentState walkParameters (alists_alist l, Indexing_Index p); /* walkFuncCall - */ -static dependentState walkFuncCall (alists_alist l, decl_node n); +static decl_dependentState walkFuncCall (alists_alist l, decl_node n); /* walkUnary - */ -static dependentState walkUnary (alists_alist l, decl_node n); +static decl_dependentState walkUnary (alists_alist l, decl_node n); /* walkBinary - */ -static dependentState walkBinary (alists_alist l, decl_node n); +static decl_dependentState walkBinary (alists_alist l, decl_node n); /* walkComponentRef - */ -static dependentState walkComponentRef (alists_alist l, decl_node n); +static decl_dependentState walkComponentRef (alists_alist l, decl_node n); /* walkPointerRef - */ -static dependentState walkPointerRef (alists_alist l, decl_node n); +static decl_dependentState walkPointerRef (alists_alist l, decl_node n); /* walkSetValue - */ -static dependentState walkSetValue (alists_alist l, decl_node n); +static decl_dependentState walkSetValue (alists_alist l, decl_node n); /* doDependants - return the dependentState depending upon whether all dependants have been declared. */ -static dependentState doDependants (alists_alist l, decl_node n); +static decl_dependentState doDependants (alists_alist l, decl_node n); /* tryComplete - returns TRUE if node, n, can be and was completed. */ -static unsigned int tryComplete (decl_node n, nodeProcedure c, nodeProcedure t, nodeProcedure v); +static unsigned int tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v); /* tryCompleteFromPartial - */ -static unsigned int tryCompleteFromPartial (decl_node n, nodeProcedure t); +static unsigned int tryCompleteFromPartial (decl_node n, decl_nodeProcedure t); /* visitIntrinsicFunction - */ -static void visitIntrinsicFunction (alists_alist v, decl_node n, nodeProcedure p); +static void visitIntrinsicFunction (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitUnary - */ -static void visitUnary (alists_alist v, decl_node n, nodeProcedure p); +static void visitUnary (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitBinary - */ -static void visitBinary (alists_alist v, decl_node n, nodeProcedure p); +static void visitBinary (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitBoolean - */ -static void visitBoolean (alists_alist v, decl_node n, nodeProcedure p); +static void visitBoolean (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitScope - */ -static void visitScope (alists_alist v, decl_node n, nodeProcedure p); +static void visitScope (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitType - */ -static void visitType (alists_alist v, decl_node n, nodeProcedure p); +static void visitType (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitIndex - */ -static void visitIndex (alists_alist v, Indexing_Index i, nodeProcedure p); +static void visitIndex (alists_alist v, Indexing_Index i, decl_nodeProcedure p); /* visitRecord - */ -static void visitRecord (alists_alist v, decl_node n, nodeProcedure p); +static void visitRecord (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVarient - */ -static void visitVarient (alists_alist v, decl_node n, nodeProcedure p); +static void visitVarient (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVar - */ -static void visitVar (alists_alist v, decl_node n, nodeProcedure p); +static void visitVar (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitEnumeration - */ -static void visitEnumeration (alists_alist v, decl_node n, nodeProcedure p); +static void visitEnumeration (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitSubrange - */ -static void visitSubrange (alists_alist v, decl_node n, nodeProcedure p); +static void visitSubrange (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitPointer - */ -static void visitPointer (alists_alist v, decl_node n, nodeProcedure p); +static void visitPointer (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitArray - */ -static void visitArray (alists_alist v, decl_node n, nodeProcedure p); +static void visitArray (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitConst - */ -static void visitConst (alists_alist v, decl_node n, nodeProcedure p); +static void visitConst (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVarParam - */ -static void visitVarParam (alists_alist v, decl_node n, nodeProcedure p); +static void visitVarParam (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitParam - */ -static void visitParam (alists_alist v, decl_node n, nodeProcedure p); +static void visitParam (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitOptarg - */ -static void visitOptarg (alists_alist v, decl_node n, nodeProcedure p); +static void visitOptarg (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitRecordField - */ -static void visitRecordField (alists_alist v, decl_node n, nodeProcedure p); +static void visitRecordField (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVarientField - */ -static void visitVarientField (alists_alist v, decl_node n, nodeProcedure p); +static void visitVarientField (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitEnumerationField - */ -static void visitEnumerationField (alists_alist v, decl_node n, nodeProcedure p); +static void visitEnumerationField (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitSet - */ -static void visitSet (alists_alist v, decl_node n, nodeProcedure p); +static void visitSet (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitProcType - */ -static void visitProcType (alists_alist v, decl_node n, nodeProcedure p); +static void visitProcType (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitSubscript - */ -static void visitSubscript (alists_alist v, decl_node n, nodeProcedure p); +static void visitSubscript (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitDecls - */ -static void visitDecls (alists_alist v, scopeT s, nodeProcedure p); +static void visitDecls (alists_alist v, decl_scopeT s, decl_nodeProcedure p); /* visitProcedure - */ -static void visitProcedure (alists_alist v, decl_node n, nodeProcedure p); +static void visitProcedure (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitDef - */ -static void visitDef (alists_alist v, decl_node n, nodeProcedure p); +static void visitDef (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitImp - */ -static void visitImp (alists_alist v, decl_node n, nodeProcedure p); +static void visitImp (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitModule - */ -static void visitModule (alists_alist v, decl_node n, nodeProcedure p); +static void visitModule (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitLoop - */ -static void visitLoop (alists_alist v, decl_node n, nodeProcedure p); +static void visitLoop (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitWhile - */ -static void visitWhile (alists_alist v, decl_node n, nodeProcedure p); +static void visitWhile (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitRepeat - */ -static void visitRepeat (alists_alist v, decl_node n, nodeProcedure p); +static void visitRepeat (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitCase - */ -static void visitCase (alists_alist v, decl_node n, nodeProcedure p); +static void visitCase (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitCaseLabelList - */ -static void visitCaseLabelList (alists_alist v, decl_node n, nodeProcedure p); +static void visitCaseLabelList (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitCaseList - */ -static void visitCaseList (alists_alist v, decl_node n, nodeProcedure p); +static void visitCaseList (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitRange - */ -static void visitRange (alists_alist v, decl_node n, nodeProcedure p); +static void visitRange (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitIf - */ -static void visitIf (alists_alist v, decl_node n, nodeProcedure p); +static void visitIf (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitElsif - */ -static void visitElsif (alists_alist v, decl_node n, nodeProcedure p); +static void visitElsif (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitFor - */ -static void visitFor (alists_alist v, decl_node n, nodeProcedure p); +static void visitFor (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitAssignment - */ -static void visitAssignment (alists_alist v, decl_node n, nodeProcedure p); +static void visitAssignment (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitComponentRef - */ -static void visitComponentRef (alists_alist v, decl_node n, nodeProcedure p); +static void visitComponentRef (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitPointerRef - */ -static void visitPointerRef (alists_alist v, decl_node n, nodeProcedure p); +static void visitPointerRef (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitArrayRef - */ -static void visitArrayRef (alists_alist v, decl_node n, nodeProcedure p); +static void visitArrayRef (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitFunccall - */ -static void visitFunccall (alists_alist v, decl_node n, nodeProcedure p); +static void visitFunccall (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVarDecl - */ -static void visitVarDecl (alists_alist v, decl_node n, nodeProcedure p); +static void visitVarDecl (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitExplist - */ -static void visitExplist (alists_alist v, decl_node n, nodeProcedure p); +static void visitExplist (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitExit - */ -static void visitExit (alists_alist v, decl_node n, nodeProcedure p); +static void visitExit (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitReturn - */ -static void visitReturn (alists_alist v, decl_node n, nodeProcedure p); +static void visitReturn (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitStmtSeq - */ -static void visitStmtSeq (alists_alist v, decl_node n, nodeProcedure p); +static void visitStmtSeq (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitVarargs - */ -static void visitVarargs (alists_alist v, decl_node n, nodeProcedure p); +static void visitVarargs (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitSetValue - */ -static void visitSetValue (alists_alist v, decl_node n, nodeProcedure p); +static void visitSetValue (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitIntrinsic - */ -static void visitIntrinsic (alists_alist v, decl_node n, nodeProcedure p); +static void visitIntrinsic (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitDependants - helper procedure function called from visitNode. @@ -6080,14 +6087,14 @@ static void visitIntrinsic (alists_alist v, decl_node n, nodeProcedure p); visit node, n, dependants. */ -static void visitDependants (alists_alist v, decl_node n, nodeProcedure p); +static void visitDependants (alists_alist v, decl_node n, decl_nodeProcedure p); /* visitNode - visits node, n, if it is not already in the alist, v. It calls p(n) if the node is unvisited. */ -static void visitNode (alists_alist v, decl_node n, nodeProcedure p); +static void visitNode (alists_alist v, decl_node n, decl_nodeProcedure p); /* genKind - returns a string depending upon the kind of node, n. @@ -6129,7 +6136,7 @@ static void outputHiddenComplete (decl_node n); tryPartial - */ -static unsigned int tryPartial (decl_node n, nodeProcedure pt); +static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt); /* outputPartialRecordArrayProcType - @@ -6147,13 +6154,13 @@ static void outputPartial (decl_node n); tryOutputTodo - */ -static void tryOutputTodo (nodeProcedure c, nodeProcedure t, nodeProcedure v, nodeProcedure pt); +static void tryOutputTodo (decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v, decl_nodeProcedure pt); /* tryOutputPartial - */ -static void tryOutputPartial (nodeProcedure t); +static void tryOutputPartial (decl_nodeProcedure t); /* debugList - @@ -6177,13 +6184,13 @@ static void addEnumConst (decl_node n); populateTodo - */ -static void populateTodo (nodeProcedure p); +static void populateTodo (decl_nodeProcedure p); /* topologicallyOut - */ -static void topologicallyOut (nodeProcedure c, nodeProcedure t, nodeProcedure v, nodeProcedure tp, nodeProcedure pc, nodeProcedure pt, nodeProcedure pv); +static void topologicallyOut (decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v, decl_nodeProcedure tp, decl_nodeProcedure pc, decl_nodeProcedure pt, decl_nodeProcedure pv); /* scaffoldStatic - @@ -6249,7 +6256,7 @@ static void outImpC (mcPretty_pretty p, decl_node n); outDeclsModuleC - */ -static void outDeclsModuleC (mcPretty_pretty p, scopeT s); +static void outDeclsModuleC (mcPretty_pretty p, decl_scopeT s); /* outModuleInitC - @@ -6410,7 +6417,7 @@ static void outputPartialM2 (decl_node n); outDeclsDefM2 - */ -static void outDeclsDefM2 (mcPretty_pretty p, scopeT s); +static void outDeclsDefM2 (mcPretty_pretty p, decl_scopeT s); /* outDefM2 - @@ -6422,7 +6429,7 @@ static void outDefM2 (mcPretty_pretty p, decl_node n); outDeclsImpM2 - */ -static void outDeclsImpM2 (mcPretty_pretty p, scopeT s); +static void outDeclsImpM2 (mcPretty_pretty p, decl_scopeT s); /* outImpM2 - @@ -6551,7 +6558,7 @@ static unsigned int isComment (decl_node n); initPair - initialise the commentPair, c. */ -static void initPair (commentPair *c); +static void initPair (decl_commentPair *c); /* dupExplist - @@ -6648,11 +6655,11 @@ static void init (void); newNode - create and return a new node of kind k. */ -static decl_node newNode (nodeT k) +static decl_node newNode (decl_nodeT k) { decl_node d; - Storage_ALLOCATE ((void **) &d, sizeof (nodeRec)); + Storage_ALLOCATE ((void **) &d, sizeof (decl_nodeRec)); if (enableMemsetOnAllocation) { d = static_cast (libc_memset (reinterpret_cast (d), 0, static_cast (sizeof ((*d))))); @@ -6681,7 +6688,7 @@ static decl_node newNode (nodeT k) static void disposeNode (decl_node *n) { - Storage_DEALLOCATE ((void **) &(*n), sizeof (nodeRec)); + Storage_DEALLOCATE ((void **) &(*n), sizeof (decl_nodeRec)); (*n) = NULL; } @@ -6789,9 +6796,9 @@ static unsigned int isAProcType (decl_node n) initFixupInfo - initialize the fixupInfo record. */ -static fixupInfo initFixupInfo (void) +static decl_fixupInfo initFixupInfo (void) { - fixupInfo f; + decl_fixupInfo f; f.count = 0; f.info = Indexing_InitIndex (1); @@ -6809,7 +6816,7 @@ static decl_node makeDef (nameKey_Name n) { decl_node d; - d = newNode (def); + d = newNode (decl_def); d->defF.name = n; d->defF.source = nameKey_NulName; d->defF.hasHidden = FALSE; @@ -6837,7 +6844,7 @@ static decl_node makeImp (nameKey_Name n) { decl_node d; - d = newNode (imp); + d = newNode (decl_imp); d->impF.name = n; d->impF.source = nameKey_NulName; d->impF.importedModules = Indexing_InitIndex (1); @@ -6865,7 +6872,7 @@ static decl_node makeModule (nameKey_Name n) { decl_node d; - d = newNode (module); + d = newNode (decl_module); d->moduleF.name = n; d->moduleF.source = nameKey_NulName; d->moduleF.importedModules = Indexing_InitIndex (1); @@ -6900,7 +6907,7 @@ static unsigned int isDefForC (decl_node n) initDecls - initialize the decls, scopeT. */ -static void initDecls (scopeT *decls) +static void initDecls (decl_scopeT *decls) { (*decls).symbols = symbolKey_initTree (); (*decls).constants = Indexing_InitIndex (1); @@ -6915,7 +6922,7 @@ static void initDecls (scopeT *decls) It stores, d, in the symbols tree associated with decls. */ -static decl_node addTo (scopeT *decls, decl_node d) +static decl_node addTo (decl_scopeT *decls, decl_node d) { nameKey_Name n; @@ -7078,29 +7085,29 @@ static void completedEnum (decl_node n) setUnary - sets a unary node to contain, arg, a, and type, t. */ -static void setUnary (decl_node u, nodeT k, decl_node a, decl_node t) +static void setUnary (decl_node u, decl_nodeT k, decl_node a, decl_node t) { switch (k) { - case constexp: - case deref: - case chr: - case cap: - case abs_: - case float_: - case trunc_: - case ord: - case high: - case throw_: - case re: - case im: - case not_: - case neg: - case adr: - case size: - case tsize: - case min: - case max: + case decl_constexp: + case decl_deref: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_float: + case decl_trunc: + case decl_ord: + case decl_high: + case decl_throw: + case decl_re: + case decl_im: + case decl_not: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_min: + case decl_max: u->kind = k; u->unaryF.arg = a; u->unaryF.resultType = t; @@ -7138,7 +7145,7 @@ static decl_node checkPtr (decl_node n) DynamicStrings_String s; decl_node p; - if (lang == ansiCP) + if (lang == decl_ansiCP) { if (decl_isPointer (n)) { @@ -7161,7 +7168,7 @@ static decl_node checkPtr (decl_node n) static unsigned int isVarDecl (decl_node n) { - return n->kind == vardecl; + return n->kind == decl_vardecl; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -7257,7 +7264,7 @@ static decl_node makeOptParameter (decl_node l, decl_node type, decl_node init) { decl_node n; - n = newNode (optarg_); + n = newNode (decl_optarg); n->optargF.namelist = l; n->optargF.type = type; n->optargF.init = init; @@ -7287,7 +7294,7 @@ static unsigned int setwatch (decl_node n) static unsigned int runwatch (void) { - return globalNode->kind == identlist; + return globalNode->kind == decl_identlist; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -7299,7 +7306,7 @@ static unsigned int runwatch (void) static unsigned int isIdentList (decl_node n) { - return n->kind == identlist; + return n->kind == decl_identlist; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -7360,7 +7367,7 @@ static decl_node makeVarientField (decl_node v, decl_node p) { decl_node n; - n = newNode (varientfield); + n = newNode (decl_varientfield); n->varientfieldF.name = nameKey_NulName; n->varientfieldF.parent = p; n->varientfieldF.varient = v; @@ -7385,7 +7392,7 @@ static void putFieldVarient (decl_node f, decl_node v) mcDebug_assert (decl_isVarientField (f)); switch (v->kind) { - case varient: + case decl_varient: Indexing_IncludeIndiceIntoIndex (v->varientF.listOfSons, reinterpret_cast (f)); break; @@ -7396,7 +7403,7 @@ static void putFieldVarient (decl_node f, decl_node v) } switch (f->kind) { - case varientfield: + case decl_varientfield: f->varientfieldF.varient = v; break; @@ -7420,10 +7427,10 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type, decl_node n; decl_node p; - n = newNode (recordfield); + n = newNode (decl_recordfield); switch (r->kind) { - case record: + case decl_record: Indexing_IncludeIndiceIntoIndex (r->recordF.listOfSons, reinterpret_cast (n)); /* ensure that field, n, is in the parents Local Symbols. */ if (tag != nameKey_NulName) @@ -7441,10 +7448,10 @@ static decl_node putFieldRecord (decl_node r, nameKey_Name tag, decl_node type, } break; - case varientfield: + case decl_varientfield: Indexing_IncludeIndiceIntoIndex (r->varientfieldF.listOfSons, reinterpret_cast (n)); p = getParent (r); - mcDebug_assert (p->kind == record); + mcDebug_assert (p->kind == decl_record); if (tag != nameKey_NulName) { symbolKey_putSymKey (p->recordF.localSymbols, tag, reinterpret_cast (n)); @@ -7505,7 +7512,7 @@ static void putVarientTag (decl_node v, decl_node tag) mcDebug_assert (decl_isVarient (v)); switch (v->kind) { - case varient: + case decl_varient: v->varientF.tag = tag; break; @@ -7525,11 +7532,11 @@ static decl_node getParent (decl_node n) { switch (n->kind) { - case recordfield: + case decl_recordfield: return n->recordfieldF.parent; break; - case varientfield: + case decl_varientfield: return n->varientfieldF.parent; break; @@ -7550,14 +7557,14 @@ static decl_node getParent (decl_node n) static decl_node getRecord (decl_node n) { - mcDebug_assert (n->kind != varient); /* if this fails then we need to add parent field to varient. */ + mcDebug_assert (n->kind != decl_varient); /* if this fails then we need to add parent field to varient. */ switch (n->kind) { - case record: + case decl_record: return n; /* if this fails then we need to add parent field to varient. */ break; - case varientfield: + case decl_varientfield: return getRecord (getParent (n)); break; @@ -7578,7 +7585,7 @@ static decl_node getRecord (decl_node n) static unsigned int isConstExp (decl_node c) { mcDebug_assert (c != NULL); - return c->kind == constexp; + return c->kind == decl_constexp; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -7614,7 +7621,7 @@ static void addEnumToModule (decl_node m, decl_node e) getNextFixup - return the next fixup from from f. */ -static decl_node getNextFixup (fixupInfo *f) +static decl_node getNextFixup (decl_fixupInfo *f) { (*f).count += 1; return static_cast (Indexing_GetIndice ((*f).info, (*f).count)); @@ -7631,7 +7638,7 @@ static decl_node doMakeEnum (void) { decl_node e; - e = newNode (enumeration); + e = newNode (decl_enumeration); e->enumerationF.noOfElements = 0; e->enumerationF.localSymbols = symbolKey_initTree (); e->enumerationF.scope = decl_getDeclScope (); @@ -7658,7 +7665,7 @@ static decl_node doMakeEnumField (decl_node e, nameKey_Name n) f = decl_lookupSym (n); if (f == NULL) { - f = newNode (enumerationfield); + f = newNode (decl_enumerationfield); symbolKey_putSymKey (e->enumerationF.localSymbols, n, reinterpret_cast (f)); Indexing_IncludeIndiceIntoIndex (e->enumerationF.listOfSons, reinterpret_cast (f)); f->enumerationfieldF.name = n; @@ -7729,15 +7736,15 @@ static unsigned int getConstExpComplete (decl_node n) { switch (n->kind) { - case def: + case decl_def: return n->defF.constsComplete; break; - case imp: + case decl_imp: return n->impF.constsComplete; break; - case module: + case decl_module: return n->moduleF.constsComplete; break; @@ -7784,7 +7791,7 @@ static decl_node doMakeConstExp (void) { decl_node c; - c = makeUnary (constexp, NULL, NULL); + c = makeUnary (decl_constexp, NULL, NULL); addConstToModule (currentModule, c); return c; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7801,24 +7808,24 @@ static unsigned int isAnyType (decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case address: - case loc: - case byte: - case word: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case complex_: - case longcomplex: - case shortcomplex: - case bitset: - case boolean: - case proc: - case type: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_bitset: + case decl_boolean: + case decl_proc: + case decl_type: return TRUE; break; @@ -7841,7 +7848,7 @@ static decl_node makeVal (decl_node params) mcDebug_assert (decl_isExpList (params)); if ((expListLen (params)) == 2) { - return makeBinary (val, getExpList (params, 1), getExpList (params, 2), getExpList (params, 1)); + return makeBinary (decl_val, getExpList (params, 1), getExpList (params, 2), getExpList (params, 1)); } else { @@ -7862,7 +7869,7 @@ static decl_node makeCast (decl_node c, decl_node p) mcDebug_assert (decl_isExpList (p)); if ((expListLen (p)) == 1) { - return makeBinary (cast, c, getExpList (p, 1), c); + return makeBinary (decl_cast, c, getExpList (p, 1), c); } else { @@ -7873,7 +7880,7 @@ static decl_node makeCast (decl_node c, decl_node p) __builtin_unreachable (); } -static decl_node makeIntrinsicProc (nodeT k, unsigned int noArgs, decl_node p) +static decl_node makeIntrinsicProc (decl_nodeT k, unsigned int noArgs, decl_node p) { decl_node f; @@ -7884,7 +7891,7 @@ static decl_node makeIntrinsicProc (nodeT k, unsigned int noArgs, decl_node p) f->intrinsicF.args = p; f->intrinsicF.noArgs = noArgs; f->intrinsicF.type = NULL; - f->intrinsicF.postUnreachable = k == halt; + f->intrinsicF.postUnreachable = k == decl_halt; initPair (&f->intrinsicF.intrinsicComment); return f; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7896,7 +7903,7 @@ static decl_node makeIntrinsicProc (nodeT k, unsigned int noArgs, decl_node p) makeIntrinsicUnaryType - create an intrisic unary type. */ -static decl_node makeIntrinsicUnaryType (nodeT k, decl_node paramList, decl_node returnType) +static decl_node makeIntrinsicUnaryType (decl_nodeT k, decl_node paramList, decl_node returnType) { return makeUnary (k, getExpList (paramList, 1), returnType); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7908,7 +7915,7 @@ static decl_node makeIntrinsicUnaryType (nodeT k, decl_node paramList, decl_node makeIntrinsicBinaryType - create an intrisic binary type. */ -static decl_node makeIntrinsicBinaryType (nodeT k, decl_node paramList, decl_node returnType) +static decl_node makeIntrinsicBinaryType (decl_nodeT k, decl_node paramList, decl_node returnType) { return makeBinary (k, getExpList (paramList, 1), getExpList (paramList, 2), returnType); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -7932,17 +7939,17 @@ static decl_node checkIntrinsic (decl_node c, decl_node n) else if (c == maxN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (max, n, NULL); + return makeIntrinsicUnaryType (decl_max, n, NULL); } else if (c == minN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (min, n, NULL); + return makeIntrinsicUnaryType (decl_min, n, NULL); } else if (c == haltN) { /* avoid dangling else. */ - return makeIntrinsicProc (halt, expListLen (n), n); + return makeIntrinsicProc (decl_halt, expListLen (n), n); } else if (c == valN) { @@ -7952,108 +7959,108 @@ static decl_node checkIntrinsic (decl_node c, decl_node n) else if (c == adrN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (adr, n, addressN); + return makeIntrinsicUnaryType (decl_adr, n, addressN); } else if (c == sizeN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (size, n, cardinalN); + return makeIntrinsicUnaryType (decl_size, n, cardinalN); } else if (c == tsizeN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (tsize, n, cardinalN); + return makeIntrinsicUnaryType (decl_tsize, n, cardinalN); } else if (c == floatN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (float_, n, realN); + return makeIntrinsicUnaryType (decl_float, n, realN); } else if (c == truncN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (trunc_, n, integerN); + return makeIntrinsicUnaryType (decl_trunc, n, integerN); } else if (c == ordN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (ord, n, cardinalN); + return makeIntrinsicUnaryType (decl_ord, n, cardinalN); } else if (c == chrN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (chr, n, charN); + return makeIntrinsicUnaryType (decl_chr, n, charN); } else if (c == capN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (cap, n, charN); + return makeIntrinsicUnaryType (decl_cap, n, charN); } else if (c == absN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (abs_, n, NULL); + return makeIntrinsicUnaryType (decl_abs, n, NULL); } else if (c == imN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (im, n, NULL); + return makeIntrinsicUnaryType (decl_im, n, NULL); } else if (c == reN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (re, n, NULL); + return makeIntrinsicUnaryType (decl_re, n, NULL); } else if (c == cmplxN) { /* avoid dangling else. */ - return makeIntrinsicBinaryType (cmplx, n, NULL); + return makeIntrinsicBinaryType (decl_cmplx, n, NULL); } else if (c == highN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (high, n, cardinalN); + return makeIntrinsicUnaryType (decl_high, n, cardinalN); } else if (c == incN) { /* avoid dangling else. */ - return makeIntrinsicProc (inc, expListLen (n), n); + return makeIntrinsicProc (decl_inc, expListLen (n), n); } else if (c == decN) { /* avoid dangling else. */ - return makeIntrinsicProc (dec, expListLen (n), n); + return makeIntrinsicProc (decl_dec, expListLen (n), n); } else if (c == inclN) { /* avoid dangling else. */ - return makeIntrinsicProc (incl, expListLen (n), n); + return makeIntrinsicProc (decl_incl, expListLen (n), n); } else if (c == exclN) { /* avoid dangling else. */ - return makeIntrinsicProc (excl, expListLen (n), n); + return makeIntrinsicProc (decl_excl, expListLen (n), n); } else if (c == newN) { /* avoid dangling else. */ - return makeIntrinsicProc (new_, 1, n); + return makeIntrinsicProc (decl_new, 1, n); } else if (c == disposeN) { /* avoid dangling else. */ - return makeIntrinsicProc (dispose, 1, n); + return makeIntrinsicProc (decl_dispose, 1, n); } else if (c == lengthN) { /* avoid dangling else. */ - return makeIntrinsicUnaryType (length, n, cardinalN); + return makeIntrinsicUnaryType (decl_length, n, cardinalN); } else if (c == throwN) { /* avoid dangling else. */ keyc_useThrow (); - return makeIntrinsicProc (throw_, 1, n); + return makeIntrinsicProc (decl_throw, 1, n); } return NULL; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -8093,7 +8100,7 @@ static void checkCHeaders (decl_node c) static unsigned int isFuncCall (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == funccall; + return n->kind == decl_funccall; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -8263,25 +8270,25 @@ static unsigned int isUnary (decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case length: - case re: - case im: - case deref: - case high: - case chr: - case cap: - case abs_: - case ord: - case float_: - case trunc_: - case constexp: - case not_: - case neg: - case adr: - case size: - case tsize: - case min: - case max: + case decl_length: + case decl_re: + case decl_im: + case decl_deref: + case decl_high: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_ord: + case decl_float: + case decl_trunc: + case decl_constexp: + case decl_not: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_min: + case decl_max: return TRUE; break; @@ -8304,24 +8311,24 @@ static unsigned int isBinary (decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case cmplx: - case and_: - case or_: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: - case val: - case cast: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: + case decl_cmplx: + case decl_and: + case decl_or: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: + case decl_val: + case decl_cast: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: return TRUE; break; @@ -8340,11 +8347,11 @@ static unsigned int isBinary (decl_node n) and res as the return type. */ -static decl_node makeUnary (nodeT k, decl_node e, decl_node res) +static decl_node makeUnary (decl_nodeT k, decl_node e, decl_node res) { decl_node n; - if (k == plus) + if (k == decl_plus) { return e; } @@ -8353,26 +8360,26 @@ static decl_node makeUnary (nodeT k, decl_node e, decl_node res) n = newNode (k); switch (n->kind) { - case min: - case max: - case throw_: - case re: - case im: - case deref: - case high: - case chr: - case cap: - case abs_: - case ord: - case float_: - case trunc_: - case length: - case constexp: - case not_: - case neg: - case adr: - case size: - case tsize: + case decl_min: + case decl_max: + case decl_throw: + case decl_re: + case decl_im: + case decl_deref: + case decl_high: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_ord: + case decl_float: + case decl_trunc: + case decl_length: + case decl_constexp: + case decl_not: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: n->unaryF.arg = e; n->unaryF.resultType = res; break; @@ -8411,7 +8418,7 @@ static DynamicStrings_String getLiteralStringContents (decl_node n) DynamicStrings_String content; DynamicStrings_String s; - mcDebug_assert (n->kind == literal); + mcDebug_assert (n->kind == decl_literal); s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (n->literalF.name)); content = NULL; if (n->literalF.type == charN) @@ -8517,7 +8524,7 @@ static decl_node resolveString (decl_node n) n = n->unaryF.arg; } } - if (n->kind == plus) + if (n->kind == decl_plus) { n = decl_makeString (addNames (resolveString (n->binaryF.left), resolveString (n->binaryF.right))); } @@ -8531,14 +8538,14 @@ static decl_node resolveString (decl_node n) foldBinary - */ -static decl_node foldBinary (nodeT k, decl_node l, decl_node r, decl_node res) +static decl_node foldBinary (decl_nodeT k, decl_node l, decl_node r, decl_node res) { decl_node n; DynamicStrings_String ls; DynamicStrings_String rs; n = NULL; - if (((k == plus) && (isLeafString (l))) && (isLeafString (r))) + if (((k == decl_plus) && (isLeafString (l))) && (isLeafString (r))) { ls = getStringContents (l); rs = getStringContents (r); @@ -8557,7 +8564,7 @@ static decl_node foldBinary (nodeT k, decl_node l, decl_node r, decl_node res) makeBinary - create a binary node with left/right/result type: l, r and resultType. */ -static decl_node makeBinary (nodeT k, decl_node l, decl_node r, decl_node resultType) +static decl_node makeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node resultType) { decl_node n; @@ -8577,31 +8584,31 @@ static decl_node makeBinary (nodeT k, decl_node l, decl_node r, decl_node result l, r, res, with a node operator, k. */ -static decl_node doMakeBinary (nodeT k, decl_node l, decl_node r, decl_node res) +static decl_node doMakeBinary (decl_nodeT k, decl_node l, decl_node r, decl_node res) { decl_node n; n = newNode (k); switch (n->kind) { - case cmplx: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: - case and_: - case or_: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: + case decl_cmplx: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: + case decl_and: + case decl_or: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: n->binaryF.left = l; n->binaryF.right = r; n->binaryF.resultType = res; @@ -8626,7 +8633,7 @@ static decl_node doMakeComponentRef (decl_node rec, decl_node field) { decl_node n; - n = newNode (componentref); + n = newNode (decl_componentref); n->componentrefF.rec = rec; n->componentrefF.field = field; n->componentrefF.resultType = decl_getType (field); @@ -8643,7 +8650,7 @@ static decl_node doMakeComponentRef (decl_node rec, decl_node field) static unsigned int isComponentRef (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == componentref; + return n->kind == decl_componentref; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -8656,7 +8663,7 @@ static unsigned int isComponentRef (decl_node n) static unsigned int isArrayRef (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == arrayref; + return n->kind == decl_arrayref; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -8669,7 +8676,7 @@ static unsigned int isArrayRef (decl_node n) static unsigned int isDeref (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == deref; + return n->kind == decl_deref; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -8681,64 +8688,64 @@ static unsigned int isDeref (decl_node n) enumerated below. */ -static decl_node makeBase (nodeT k) +static decl_node makeBase (decl_nodeT k) { decl_node n; n = newNode (k); switch (k) { - case new_: - case dispose: - case length: - case inc: - case dec: - case incl: - case excl: - case nil: - case true_: - case false_: - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case boolean: - case proc: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: - case adr: - case chr: - case cap: - case abs_: - case float_: - case trunc_: - case ord: - case high: - case throw_: - case re: - case im: - case cmplx: - case size: - case tsize: - case val: - case min: - case max: + case decl_new: + case decl_dispose: + case decl_length: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: + case decl_nil: + case decl_true: + case decl_false: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_boolean: + case decl_proc: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_adr: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_float: + case decl_trunc: + case decl_ord: + case decl_high: + case decl_throw: + case decl_re: + case decl_im: + case decl_cmplx: + case decl_size: + case decl_tsize: + case decl_val: + case decl_min: + case decl_max: break; @@ -8761,20 +8768,20 @@ static unsigned int isOrdinal (decl_node n) { switch (n->kind) { - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case char_: - case integer: - case longint: - case shortint: - case cardinal: - case longcard: - case shortcard: - case bitset: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_char: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_bitset: return TRUE; break; @@ -8874,336 +8881,336 @@ static decl_node doGetExprType (decl_node n) { switch (n->kind) { - case max: - case min: + case decl_max: + case decl_min: return getMaxMinType (n->unaryF.arg); break; - case cast: - case val: + case decl_cast: + case decl_val: return doSetExprType (&n->binaryF.resultType, n->binaryF.left); break; - case halt: - case new_: - case dispose: + case decl_halt: + case decl_new: + case decl_dispose: return NULL; break; - case inc: - case dec: - case incl: - case excl: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: return NULL; break; - case nil: + case decl_nil: return addressN; break; - case true_: - case false_: + case decl_true: + case decl_false: return booleanN; break; - case address: + case decl_address: return n; break; - case loc: + case decl_loc: return n; break; - case byte: + case decl_byte: return n; break; - case word: + case decl_word: return n; break; - case csizet: + case decl_csizet: return n; break; - case cssizet: + case decl_cssizet: return n; break; - case boolean: + case decl_boolean: /* base types. */ return n; break; - case proc: + case decl_proc: return n; break; - case char_: + case decl_char: return n; break; - case cardinal: + case decl_cardinal: return n; break; - case longcard: + case decl_longcard: return n; break; - case shortcard: + case decl_shortcard: return n; break; - case integer: + case decl_integer: return n; break; - case longint: + case decl_longint: return n; break; - case shortint: + case decl_shortint: return n; break; - case real: + case decl_real: return n; break; - case longreal: + case decl_longreal: return n; break; - case shortreal: + case decl_shortreal: return n; break; - case bitset: + case decl_bitset: return n; break; - case ztype: + case decl_ztype: return n; break; - case rtype: + case decl_rtype: return n; break; - case complex_: + case decl_complex: return n; break; - case longcomplex: + case decl_longcomplex: return n; break; - case shortcomplex: + case decl_shortcomplex: return n; break; - case type: + case decl_type: /* language features and compound type attributes. */ return n->typeF.type; break; - case record: + case decl_record: return n; break; - case varient: + case decl_varient: return n; break; - case var: + case decl_var: return n->varF.type; break; - case enumeration: + case decl_enumeration: return n; break; - case subrange: + case decl_subrange: return n->subrangeF.type; break; - case array: + case decl_array: return n->arrayF.type; break; - case string: + case decl_string: return charN; break; - case const_: + case decl_const: return doSetExprType (&n->constF.type, getExprType (n->constF.value)); break; - case literal: + case decl_literal: return n->literalF.type; break; - case varparam: + case decl_varparam: return n->varparamF.type; break; - case param: + case decl_param: return n->paramF.type; break; - case optarg_: + case decl_optarg: return n->optargF.type; break; - case pointer: + case decl_pointer: return n->pointerF.type; break; - case recordfield: + case decl_recordfield: return n->recordfieldF.type; break; - case varientfield: + case decl_varientfield: return n; break; - case enumerationfield: + case decl_enumerationfield: return n->enumerationfieldF.type; break; - case set: + case decl_set: return n->setF.type; break; - case proctype: + case decl_proctype: return n->proctypeF.returnType; break; - case subscript: + case decl_subscript: return n->subscriptF.type; break; - case procedure: + case decl_procedure: /* blocks. */ return n->procedureF.returnType; break; - case throw_: + case decl_throw: return NULL; break; - case unreachable: + case decl_unreachable: return NULL; break; - case def: - case imp: - case module: - case loop: - case while_: - case for_: - case repeat: - case if_: - case elsif: - case assignment: + case decl_def: + case decl_imp: + case decl_module: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ M2RTS_HALT (-1); __builtin_unreachable (); break; - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: /* expressions. */ return doSetExprType (&n->binaryF.resultType, mixTypes (getExprType (n->binaryF.left), getExprType (n->binaryF.right))); break; - case in: - case and_: - case or_: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_in: + case decl_and: + case decl_or: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: return doSetExprType (&n->binaryF.resultType, booleanN); break; - case cmplx: + case decl_cmplx: return doSetExprType (&n->binaryF.resultType, complexN); break; - case abs_: - case constexp: - case deref: - case neg: + case decl_abs: + case decl_constexp: + case decl_deref: + case decl_neg: return doSetExprType (&n->unaryF.resultType, getExprType (n->unaryF.arg)); break; - case adr: + case decl_adr: return doSetExprType (&n->unaryF.resultType, addressN); break; - case size: - case tsize: + case decl_size: + case decl_tsize: return doSetExprType (&n->unaryF.resultType, cardinalN); break; - case high: - case ord: + case decl_high: + case decl_ord: return doSetExprType (&n->unaryF.resultType, cardinalN); break; - case float_: + case decl_float: return doSetExprType (&n->unaryF.resultType, realN); break; - case trunc_: + case decl_trunc: return doSetExprType (&n->unaryF.resultType, integerN); break; - case chr: + case decl_chr: return doSetExprType (&n->unaryF.resultType, charN); break; - case cap: + case decl_cap: return doSetExprType (&n->unaryF.resultType, charN); break; - case not_: + case decl_not: return doSetExprType (&n->unaryF.resultType, booleanN); break; - case re: + case decl_re: return doSetExprType (&n->unaryF.resultType, realN); break; - case im: + case decl_im: return doSetExprType (&n->unaryF.resultType, realN); break; - case arrayref: + case decl_arrayref: return n->arrayrefF.resultType; break; - case componentref: + case decl_componentref: return n->componentrefF.resultType; break; - case pointerref: + case decl_pointerref: return n->pointerrefF.resultType; break; - case funccall: + case decl_funccall: return doSetExprType (&n->funccallF.type, doGetFuncType (n)); break; - case setvalue: + case decl_setvalue: return n->setvalueF.type; break; @@ -9335,19 +9342,19 @@ static decl_node getSymScope (decl_node n) { switch (n->kind) { - case const_: + case decl_const: return n->constF.scope; break; - case type: + case decl_type: return n->typeF.scope; break; - case var: + case decl_var: return n->varF.scope; break; - case procedure: + case decl_procedure: return n->procedureF.scope; break; @@ -9363,6 +9370,18 @@ static decl_node getSymScope (decl_node n) } +/* + isQualifiedForced - should the node be written with a module prefix? +*/ + +static unsigned int isQualifiedForced (decl_node n) +{ + return forceQualified && (((((decl_isType (n)) || (decl_isRecord (n))) || (decl_isArray (n))) || (decl_isEnumeration (n))) || (decl_isEnumerationField (n))); + /* static analysis guarentees a RETURN statement will be used before here. */ + __builtin_unreachable (); +} + + /* getFQstring - */ @@ -9372,12 +9391,25 @@ static DynamicStrings_String getFQstring (decl_node n) DynamicStrings_String i; DynamicStrings_String s; - if ((! (decl_isExported (n))) || (mcOptions_getIgnoreFQ ())) /* OR isDefForC (getScope (n)) */ + if ((decl_getScope (n)) == NULL) + { + return DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); + } + else if (isQualifiedForced (n)) { + /* avoid dangling else. */ + i = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); + s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (decl_getScope (n)))); + return FormatStrings_Sprintf2 (DynamicStrings_InitString ((const char *) "%s_%s", 5), (const unsigned char *) &s, (sizeof (s)-1), (const unsigned char *) &i, (sizeof (i)-1)); + } + else if ((! (decl_isExported (n))) || (mcOptions_getIgnoreFQ ())) + { + /* avoid dangling else. */ return DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); } else { + /* avoid dangling else. */ i = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (decl_getScope (n)))); return FormatStrings_Sprintf2 (DynamicStrings_InitString ((const char *) "%s_%s", 5), (const unsigned char *) &s, (sizeof (s)-1), (const unsigned char *) &i, (sizeof (i)-1)); @@ -9396,12 +9428,26 @@ static DynamicStrings_String getFQDstring (decl_node n, unsigned int scopes) DynamicStrings_String i; DynamicStrings_String s; - if ((! (decl_isExported (n))) || (mcOptions_getIgnoreFQ ())) + if ((decl_getScope (n)) == NULL) { return DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (getDName (n, scopes))); } + else if (isQualifiedForced (n)) + { + /* avoid dangling else. */ + /* we assume a qualified name will never conflict. */ + i = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); + s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (decl_getScope (n)))); + return FormatStrings_Sprintf2 (DynamicStrings_InitString ((const char *) "%s_%s", 5), (const unsigned char *) &s, (sizeof (s)-1), (const unsigned char *) &i, (sizeof (i)-1)); + } + else if ((! (decl_isExported (n))) || (mcOptions_getIgnoreFQ ())) + { + /* avoid dangling else. */ + return DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (getDName (n, scopes))); + } else { + /* avoid dangling else. */ /* we assume a qualified name will never conflict. */ i = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (n))); s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (decl_getSymName (decl_getScope (n)))); @@ -9478,154 +9524,154 @@ static unsigned int needsParen (decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case nil: - case true_: - case false_: + case decl_nil: + case decl_true: + case decl_false: return FALSE; break; - case constexp: + case decl_constexp: return needsParen (n->unaryF.arg); break; - case neg: + case decl_neg: return needsParen (n->unaryF.arg); break; - case not_: + case decl_not: return needsParen (n->unaryF.arg); break; - case adr: - case size: - case tsize: - case ord: - case float_: - case trunc_: - case chr: - case cap: - case high: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_ord: + case decl_float: + case decl_trunc: + case decl_chr: + case decl_cap: + case decl_high: return FALSE; break; - case deref: + case decl_deref: return FALSE; break; - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: return TRUE; break; - case componentref: + case decl_componentref: return FALSE; break; - case pointerref: + case decl_pointerref: return FALSE; break; - case cast: + case decl_cast: return TRUE; break; - case val: + case decl_val: return TRUE; break; - case abs_: + case decl_abs: return FALSE; break; - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: return TRUE; break; - case literal: - case const_: - case enumerationfield: - case string: + case decl_literal: + case decl_const: + case decl_enumerationfield: + case decl_string: return FALSE; break; - case max: + case decl_max: return TRUE; break; - case min: + case decl_min: return TRUE; break; - case var: + case decl_var: return FALSE; break; - case arrayref: + case decl_arrayref: return FALSE; break; - case and_: - case or_: + case decl_and: + case decl_or: return TRUE; break; - case funccall: + case decl_funccall: return TRUE; break; - case recordfield: + case decl_recordfield: return FALSE; break; - case loc: - case byte: - case word: - case type: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case complex_: - case longcomplex: - case shortcomplex: - case bitset: - case boolean: - case proc: + case decl_loc: + case decl_byte: + case decl_word: + case decl_type: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_bitset: + case decl_boolean: + case decl_proc: return FALSE; break; - case setvalue: + case decl_setvalue: return FALSE; break; - case address: + case decl_address: return TRUE; break; - case procedure: + case decl_procedure: return FALSE; break; - case length: - case cmplx: - case re: - case im: + case decl_length: + case decl_cmplx: + case decl_re: + case decl_im: return TRUE; break; @@ -9711,7 +9757,7 @@ static void doSetSub (mcPretty_pretty p, decl_node left, decl_node right) doPolyBinary - */ -static void doPolyBinary (mcPretty_pretty p, nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r) +static void doPolyBinary (mcPretty_pretty p, decl_nodeT op, decl_node left, decl_node right, unsigned int l, unsigned int r) { decl_node lt; decl_node rt; @@ -9722,19 +9768,19 @@ static void doPolyBinary (mcPretty_pretty p, nodeT op, decl_node left, decl_node { switch (op) { - case plus: + case decl_plus: doBinary (p, (const char *) "|", 1, left, right, l, r, FALSE); break; - case sub: + case decl_sub: doSetSub (p, left, right); break; - case mult: + case decl_mult: doBinary (p, (const char *) "&", 1, left, right, l, r, FALSE); break; - case divide: + case decl_divide: doBinary (p, (const char *) "^", 1, left, right, l, r, FALSE); break; @@ -9748,19 +9794,19 @@ static void doPolyBinary (mcPretty_pretty p, nodeT op, decl_node left, decl_node { switch (op) { - case plus: + case decl_plus: doBinary (p, (const char *) "+", 1, left, right, l, r, FALSE); break; - case sub: + case decl_sub: doBinary (p, (const char *) "-", 1, left, right, l, r, FALSE); break; - case mult: + case decl_mult: doBinary (p, (const char *) "*", 1, left, right, l, r, FALSE); break; - case divide: + case decl_divide: doBinary (p, (const char *) "/", 1, left, right, l, r, FALSE); break; @@ -9852,193 +9898,193 @@ static decl_node doGetLastOp (decl_node a, decl_node b) { switch (b->kind) { - case nil: + case decl_nil: return a; break; - case true_: + case decl_true: return a; break; - case false_: + case decl_false: return a; break; - case constexp: + case decl_constexp: return doGetLastOp (b, b->unaryF.arg); break; - case neg: + case decl_neg: return doGetLastOp (b, b->unaryF.arg); break; - case not_: + case decl_not: return doGetLastOp (b, b->unaryF.arg); break; - case adr: + case decl_adr: return doGetLastOp (b, b->unaryF.arg); break; - case size: + case decl_size: return doGetLastOp (b, b->unaryF.arg); break; - case tsize: + case decl_tsize: return doGetLastOp (b, b->unaryF.arg); break; - case ord: + case decl_ord: return doGetLastOp (b, b->unaryF.arg); break; - case float_: - case trunc_: + case decl_float: + case decl_trunc: return doGetLastOp (b, b->unaryF.arg); break; - case chr: + case decl_chr: return doGetLastOp (b, b->unaryF.arg); break; - case cap: + case decl_cap: return doGetLastOp (b, b->unaryF.arg); break; - case high: + case decl_high: return doGetLastOp (b, b->unaryF.arg); break; - case deref: + case decl_deref: return doGetLastOp (b, b->unaryF.arg); break; - case re: - case im: + case decl_re: + case decl_im: return doGetLastOp (b, b->unaryF.arg); break; - case equal: + case decl_equal: return doGetLastOp (b, b->binaryF.right); break; - case notequal: + case decl_notequal: return doGetLastOp (b, b->binaryF.right); break; - case less: + case decl_less: return doGetLastOp (b, b->binaryF.right); break; - case greater: + case decl_greater: return doGetLastOp (b, b->binaryF.right); break; - case greequal: + case decl_greequal: return doGetLastOp (b, b->binaryF.right); break; - case lessequal: + case decl_lessequal: return doGetLastOp (b, b->binaryF.right); break; - case componentref: + case decl_componentref: return doGetLastOp (b, b->componentrefF.field); break; - case pointerref: + case decl_pointerref: return doGetLastOp (b, b->pointerrefF.field); break; - case cast: + case decl_cast: return doGetLastOp (b, b->binaryF.right); break; - case val: + case decl_val: return doGetLastOp (b, b->binaryF.right); break; - case plus: + case decl_plus: return doGetLastOp (b, b->binaryF.right); break; - case sub: + case decl_sub: return doGetLastOp (b, b->binaryF.right); break; - case div_: + case decl_div: return doGetLastOp (b, b->binaryF.right); break; - case mod: + case decl_mod: return doGetLastOp (b, b->binaryF.right); break; - case mult: + case decl_mult: return doGetLastOp (b, b->binaryF.right); break; - case divide: + case decl_divide: return doGetLastOp (b, b->binaryF.right); break; - case in: + case decl_in: return doGetLastOp (b, b->binaryF.right); break; - case and_: + case decl_and: return doGetLastOp (b, b->binaryF.right); break; - case or_: + case decl_or: return doGetLastOp (b, b->binaryF.right); break; - case cmplx: + case decl_cmplx: return doGetLastOp (b, b->binaryF.right); break; - case literal: + case decl_literal: return a; break; - case const_: + case decl_const: return a; break; - case enumerationfield: + case decl_enumerationfield: return a; break; - case string: + case decl_string: return a; break; - case max: + case decl_max: return doGetLastOp (b, b->unaryF.arg); break; - case min: + case decl_min: return doGetLastOp (b, b->unaryF.arg); break; - case var: + case decl_var: return a; break; - case arrayref: + case decl_arrayref: return a; break; - case funccall: + case decl_funccall: return a; break; - case procedure: + case decl_procedure: return a; break; - case recordfield: + case decl_recordfield: return a; break; @@ -10433,252 +10479,252 @@ static void doExprC (mcPretty_pretty p, decl_node n) t = getExprType (n); switch (n->kind) { - case nil: + case decl_nil: outNull (p); break; - case true_: + case decl_true: outTrue (p); break; - case false_: + case decl_false: outFalse (p); break; - case constexp: + case decl_constexp: doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE); break; - case neg: + case decl_neg: doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE); break; - case not_: + case decl_not: doUnary (p, (const char *) "!", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, TRUE); break; - case val: + case decl_val: doValC (p, n); break; - case adr: + case decl_adr: doAdrC (p, n); break; - case size: - case tsize: + case decl_size: + case decl_tsize: doSizeC (p, n); break; - case float_: + case decl_float: doConvertC (p, n, (const char *) "(double)", 8); break; - case trunc_: + case decl_trunc: doConvertC (p, n, (const char *) "(int)", 5); break; - case ord: + case decl_ord: doConvertC (p, n, (const char *) "(unsigned int)", 14); break; - case chr: + case decl_chr: doConvertC (p, n, (const char *) "(char)", 6); break; - case cap: + case decl_cap: doCapC (p, n); break; - case abs_: + case decl_abs: doAbsC (p, n); break; - case high: + case decl_high: doFuncHighC (p, n->unaryF.arg); break; - case length: + case decl_length: doLengthC (p, n); break; - case min: + case decl_min: doMinC (p, n); break; - case max: + case decl_max: doMaxC (p, n); break; - case throw_: + case decl_throw: doThrowC (p, n); break; - case unreachable: + case decl_unreachable: doUnreachableC (p, n); break; - case re: + case decl_re: doReC (p, n); break; - case im: + case decl_im: doImC (p, n); break; - case cmplx: + case decl_cmplx: doCmplx (p, n); break; - case deref: + case decl_deref: doDeRefC (p, n->unaryF.arg); break; - case equal: + case decl_equal: doBinary (p, (const char *) "==", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, TRUE); break; - case notequal: + case decl_notequal: doBinary (p, (const char *) "!=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, TRUE); break; - case less: + case decl_less: doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case greater: + case decl_greater: doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case greequal: + case decl_greequal: doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case lessequal: + case decl_lessequal: doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case componentref: + case decl_componentref: doComponentRefC (p, n->componentrefF.rec, n->componentrefF.field); break; - case pointerref: + case decl_pointerref: doPointerRefC (p, n->pointerrefF.ptr, n->pointerrefF.field); break; - case cast: + case decl_cast: doCastC (p, n->binaryF.left, n->binaryF.right); break; - case plus: - doPolyBinary (p, plus, n->binaryF.left, n->binaryF.right, FALSE, FALSE); + case decl_plus: + doPolyBinary (p, decl_plus, n->binaryF.left, n->binaryF.right, FALSE, FALSE); break; - case sub: - doPolyBinary (p, sub, n->binaryF.left, n->binaryF.right, FALSE, FALSE); + case decl_sub: + doPolyBinary (p, decl_sub, n->binaryF.left, n->binaryF.right, FALSE, FALSE); break; - case div_: + case decl_div: doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case mod: + case decl_mod: doBinary (p, (const char *) "%", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case mult: - doPolyBinary (p, mult, n->binaryF.left, n->binaryF.right, FALSE, FALSE); + case decl_mult: + doPolyBinary (p, decl_mult, n->binaryF.left, n->binaryF.right, FALSE, FALSE); break; - case divide: - doPolyBinary (p, divide, n->binaryF.left, n->binaryF.right, FALSE, FALSE); + case decl_divide: + doPolyBinary (p, decl_divide, n->binaryF.left, n->binaryF.right, FALSE, FALSE); break; - case in: + case decl_in: doInC (p, n->binaryF.left, n->binaryF.right); break; - case and_: + case decl_and: doBinary (p, (const char *) "&&", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case or_: + case decl_or: doBinary (p, (const char *) "||", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case literal: + case decl_literal: doLiteralC (p, n); break; - case const_: + case decl_const: doConstExpr (p, n); break; - case enumerationfield: + case decl_enumerationfield: doEnumerationField (p, n); break; - case string: + case decl_string: doStringC (p, n); break; - case var: + case decl_var: doVar (p, n); break; - case arrayref: + case decl_arrayref: doArrayRef (p, n); break; - case funccall: + case decl_funccall: doFuncExprC (p, n); break; - case procedure: + case decl_procedure: doProcedure (p, n); break; - case recordfield: + case decl_recordfield: doRecordfield (p, n); break; - case setvalue: + case decl_setvalue: doSetValueC (p, n); break; - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case complex_: - case longcomplex: - case shortcomplex: - case real: - case longreal: - case shortreal: - case bitset: - case boolean: - case proc: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_boolean: + case decl_proc: doBaseC (p, n); break; - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: doSystemC (p, n); break; - case type: + case decl_type: doTypeNameC (p, n); break; - case pointer: + case decl_pointer: doTypeNameC (p, n); break; @@ -10719,171 +10765,171 @@ static void doExprM2 (mcPretty_pretty p, decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case nil: + case decl_nil: outText (p, (const char *) "NIL", 3); break; - case true_: + case decl_true: outText (p, (const char *) "TRUE", 4); break; - case false_: + case decl_false: outText (p, (const char *) "FALSE", 5); break; - case constexp: + case decl_constexp: doUnary (p, (const char *) "", 0, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE); break; - case neg: + case decl_neg: doUnary (p, (const char *) "-", 1, n->unaryF.arg, n->unaryF.resultType, FALSE, FALSE); break; - case not_: + case decl_not: doUnary (p, (const char *) "NOT", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case adr: + case decl_adr: doUnary (p, (const char *) "ADR", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case size: + case decl_size: doUnary (p, (const char *) "SIZE", 4, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case tsize: + case decl_tsize: doUnary (p, (const char *) "TSIZE", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case float_: + case decl_float: doUnary (p, (const char *) "FLOAT", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case trunc_: + case decl_trunc: doUnary (p, (const char *) "TRUNC", 5, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case ord: + case decl_ord: doUnary (p, (const char *) "ORD", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case chr: + case decl_chr: doUnary (p, (const char *) "CHR", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case cap: + case decl_cap: doUnary (p, (const char *) "CAP", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case high: + case decl_high: doUnary (p, (const char *) "HIGH", 4, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case re: + case decl_re: doUnary (p, (const char *) "RE", 2, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case im: + case decl_im: doUnary (p, (const char *) "IM", 2, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case deref: + case decl_deref: doPostUnary (p, (const char *) "^", 1, n->unaryF.arg); break; - case equal: + case decl_equal: doBinary (p, (const char *) "=", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case notequal: + case decl_notequal: doBinary (p, (const char *) "#", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case less: + case decl_less: doBinary (p, (const char *) "<", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case greater: + case decl_greater: doBinary (p, (const char *) ">", 1, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case greequal: + case decl_greequal: doBinary (p, (const char *) ">=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case lessequal: + case decl_lessequal: doBinary (p, (const char *) "<=", 2, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case componentref: + case decl_componentref: doBinary (p, (const char *) ".", 1, n->componentrefF.rec, n->componentrefF.field, FALSE, FALSE, FALSE); break; - case pointerref: + case decl_pointerref: doBinary (p, (const char *) "^.", 2, n->pointerrefF.ptr, n->pointerrefF.field, FALSE, FALSE, FALSE); break; - case cast: + case decl_cast: doPreBinary (p, (const char *) "CAST", 4, n->binaryF.left, n->binaryF.right, TRUE, TRUE); break; - case val: + case decl_val: doPreBinary (p, (const char *) "VAL", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE); break; - case cmplx: + case decl_cmplx: doPreBinary (p, (const char *) "CMPLX", 5, n->binaryF.left, n->binaryF.right, TRUE, TRUE); break; - case plus: + case decl_plus: doBinary (p, (const char *) "+", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE); break; - case sub: + case decl_sub: doBinary (p, (const char *) "-", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE); break; - case div_: + case decl_div: doBinary (p, (const char *) "DIV", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case mod: + case decl_mod: doBinary (p, (const char *) "MOD", 3, n->binaryF.left, n->binaryF.right, TRUE, TRUE, FALSE); break; - case mult: + case decl_mult: doBinary (p, (const char *) "*", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE); break; - case divide: + case decl_divide: doBinary (p, (const char *) "/", 1, n->binaryF.left, n->binaryF.right, FALSE, FALSE, FALSE); break; - case literal: + case decl_literal: doLiteral (p, n); break; - case const_: + case decl_const: doConstExpr (p, n); break; - case enumerationfield: + case decl_enumerationfield: doEnumerationField (p, n); break; - case string: + case decl_string: doString (p, n); break; - case max: + case decl_max: doUnary (p, (const char *) "MAX", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case min: + case decl_min: doUnary (p, (const char *) "MIN", 3, n->unaryF.arg, n->unaryF.resultType, TRUE, TRUE); break; - case var: + case decl_var: doVar (p, n); break; @@ -10990,7 +11036,7 @@ static void doLiteral (mcPretty_pretty p, decl_node n) static unsigned int isString (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == string; + return n->kind == decl_string; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -11473,7 +11519,7 @@ static void doNameC (mcPretty_pretty p, decl_node n) initCname - */ -static void initCname (cnameT *c) +static void initCname (decl_cnameT *c) { (*c).init = FALSE; } @@ -11483,7 +11529,7 @@ static void initCname (cnameT *c) doCname - */ -static nameKey_Name doCname (nameKey_Name n, cnameT *c, unsigned int scopes) +static nameKey_Name doCname (nameKey_Name n, decl_cnameT *c, unsigned int scopes) { DynamicStrings_String s; @@ -11522,19 +11568,19 @@ static nameKey_Name getDName (decl_node n, unsigned int scopes) m = decl_getSymName (n); switch (n->kind) { - case procedure: + case decl_procedure: return doCname (m, &n->procedureF.cname, scopes); break; - case var: + case decl_var: return doCname (m, &n->varF.cname, scopes); break; - case recordfield: + case decl_recordfield: return doCname (m, &n->recordfieldF.cname, scopes); break; - case enumerationfield: + case decl_enumerationfield: return doCname (m, &n->enumerationfieldF.cname, scopes); break; @@ -11643,7 +11689,7 @@ static void doParamConstCast (mcPretty_pretty p, decl_node n) decl_node ptype; ptype = decl_getType (n); - if (((decl_isArray (ptype)) && (decl_isUnbounded (ptype))) && (lang == ansiCP)) + if (((decl_isArray (ptype)) && (decl_isUnbounded (ptype))) && (lang == decl_ansiCP)) { outText (p, (const char *) "const", 5); mcPretty_setNeedSpace (p); @@ -12447,22 +12493,22 @@ static unsigned int isBase (decl_node n) { switch (n->kind) { - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case complex_: - case longcomplex: - case shortcomplex: - case real: - case longreal: - case shortreal: - case bitset: - case boolean: - case proc: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_boolean: + case decl_proc: return TRUE; break; @@ -12484,67 +12530,67 @@ static void doBaseC (mcPretty_pretty p, decl_node n) { switch (n->kind) { - case char_: + case decl_char: outText (p, (const char *) "char", 4); break; - case cardinal: + case decl_cardinal: outText (p, (const char *) "unsigned int", 12); break; - case longcard: + case decl_longcard: outText (p, (const char *) "long unsigned int", 17); break; - case shortcard: + case decl_shortcard: outText (p, (const char *) "short unsigned int", 18); break; - case integer: + case decl_integer: outText (p, (const char *) "int", 3); break; - case longint: + case decl_longint: outText (p, (const char *) "long int", 8); break; - case shortint: + case decl_shortint: outText (p, (const char *) "short int", 9); break; - case complex_: + case decl_complex: outText (p, (const char *) "double complex", 14); break; - case longcomplex: + case decl_longcomplex: outText (p, (const char *) "long double complex", 19); break; - case shortcomplex: + case decl_shortcomplex: outText (p, (const char *) "float complex", 13); break; - case real: + case decl_real: outText (p, (const char *) "double", 6); break; - case longreal: + case decl_longreal: outText (p, (const char *) "long double", 11); break; - case shortreal: + case decl_shortreal: outText (p, (const char *) "float", 5); break; - case bitset: + case decl_bitset: outText (p, (const char *) "unsigned int", 12); break; - case boolean: + case decl_boolean: outText (p, (const char *) "unsigned int", 12); break; - case proc: + case decl_proc: outText (p, (const char *) "PROC", 4); break; @@ -12565,27 +12611,27 @@ static unsigned int isSystem (decl_node n) { switch (n->kind) { - case address: + case decl_address: return TRUE; break; - case loc: + case decl_loc: return TRUE; break; - case byte: + case decl_byte: return TRUE; break; - case word: + case decl_word: return TRUE; break; - case csizet: + case decl_csizet: return TRUE; break; - case cssizet: + case decl_cssizet: return TRUE; break; @@ -12607,32 +12653,32 @@ static void doSystemC (mcPretty_pretty p, decl_node n) { switch (n->kind) { - case address: + case decl_address: outText (p, (const char *) "void *", 6); break; - case loc: + case decl_loc: outText (p, (const char *) "unsigned char", 13); mcPretty_setNeedSpace (p); break; - case byte: + case decl_byte: outText (p, (const char *) "unsigned char", 13); mcPretty_setNeedSpace (p); break; - case word: + case decl_word: outText (p, (const char *) "unsigned int", 12); mcPretty_setNeedSpace (p); break; - case csizet: + case decl_csizet: outText (p, (const char *) "size_t", 6); mcPretty_setNeedSpace (p); keyc_useSize_t (); break; - case cssizet: + case decl_cssizet: outText (p, (const char *) "ssize_t", 7); mcPretty_setNeedSpace (p); keyc_useSSize_t (); @@ -13193,7 +13239,7 @@ static void doVarC (decl_node n) static void doExternCP (mcPretty_pretty p) { - if (lang == ansiCP) + if (lang == decl_ansiCP) { outText (p, (const char *) "extern \"C\"", 10); mcPretty_setNeedSpace (p); @@ -13734,7 +13780,7 @@ static void doSimplify (decl_node n) simplifyTypes - */ -static void simplifyTypes (scopeT s) +static void simplifyTypes (decl_scopeT s) { do { simplified = TRUE; @@ -13750,16 +13796,16 @@ static void simplifyTypes (scopeT s) static void outDeclsDefC (mcPretty_pretty p, decl_node n) { - scopeT s; + decl_scopeT s; s = n->defF.decls; simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); /* try and output types, constants before variables and procedures. */ includeDefVarProcedure (n); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); Indexing_ForeachIndiceInIndexDo (s.procedures, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doPrototypeC}); } @@ -13768,7 +13814,7 @@ static void outDeclsDefC (mcPretty_pretty p, decl_node n) includeConstType - */ -static void includeConstType (scopeT s) +static void includeConstType (decl_scopeT s) { Indexing_ForeachIndiceInIndexDo (s.constants, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) addTodo}); Indexing_ForeachIndiceInIndexDo (s.types, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) addTypesTodo}); @@ -13779,7 +13825,7 @@ static void includeConstType (scopeT s) includeVarProcedure - */ -static void includeVarProcedure (scopeT s) +static void includeVarProcedure (decl_scopeT s) { Indexing_ForeachIndiceInIndexDo (s.procedures, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) addTodo}); Indexing_ForeachIndiceInIndexDo (s.variables, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) addVariablesTodo}); @@ -13790,7 +13836,7 @@ static void includeVarProcedure (scopeT s) includeVar - */ -static void includeVar (scopeT s) +static void includeVar (decl_scopeT s) { Indexing_ForeachIndiceInIndexDo (s.variables, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) addTodo}); } @@ -13805,7 +13851,7 @@ static void includeExternals (decl_node n) alists_alist l; l = alists_initList (); - visitNode (l, n, (nodeProcedure) {(nodeProcedure_t) addExported}); + visitNode (l, n, (decl_nodeProcedure) {(decl_nodeProcedure_t) addExported}); alists_killList (&l); } @@ -13961,15 +14007,15 @@ static void foreachModuleDo (decl_node n, symbolKey_performOperation p) outDeclsImpC - */ -static void outDeclsImpC (mcPretty_pretty p, scopeT s) +static void outDeclsImpC (mcPretty_pretty p, decl_scopeT s) { simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); /* try and output types, constants before variables and procedures. */ includeVarProcedure (s); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); } @@ -14110,13 +14156,13 @@ static unsigned int isZtypeEquivalent (decl_node type) { switch (type->kind) { - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case ztype: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_ztype: return TRUE; break; @@ -14153,9 +14199,9 @@ static void doExprCastC (mcPretty_pretty p, decl_node e, decl_node type) decl_node stype; stype = decl_skipType (type); - if ((! (isEquivalentType (type, getExprType (e)))) && (! ((e->kind == nil) && ((decl_isPointer (stype)) || (stype->kind == address))))) + if ((! (isEquivalentType (type, getExprType (e)))) && (! ((e->kind == decl_nil) && ((decl_isPointer (stype)) || (stype->kind == decl_address))))) { - if (lang == ansiCP) + if (lang == decl_ansiCP) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ /* potentially a cast is required. */ @@ -14634,7 +14680,7 @@ static void doForIncC (mcPretty_pretty p, decl_node s) static void doForInc (mcPretty_pretty p, decl_node s) { - if (lang == ansiCP) + if (lang == decl_ansiCP) { doForIncCP (p, s); } @@ -14830,7 +14876,7 @@ static void doFuncUnbounded (mcPretty_pretty p, decl_node actual, decl_node form mcDebug_assert (decl_isUnbounded (formal)); outText (p, (const char *) "(", 1); - if ((lang == ansiCP) && (decl_isParam (formalParam))) + if ((lang == decl_ansiCP) && (decl_isParam (formalParam))) { outText (p, (const char *) "const", 5); mcPretty_setNeedSpace (p); @@ -14978,7 +15024,7 @@ static unsigned int needsCast (decl_node at, decl_node ft) { at = decl_skipType (at); ft = decl_skipType (ft); - if (((((((((((((at == nilN) || (at->kind == nil)) || (at == ft)) || (typePair (at, ft, cardinalN, wordN))) || (typePair (at, ft, cardinalN, ztypeN))) || (typePair (at, ft, integerN, ztypeN))) || (typePair (at, ft, longcardN, ztypeN))) || (typePair (at, ft, shortcardN, ztypeN))) || (typePair (at, ft, longintN, ztypeN))) || (typePair (at, ft, shortintN, ztypeN))) || (typePair (at, ft, realN, rtypeN))) || (typePair (at, ft, longrealN, rtypeN))) || (typePair (at, ft, shortrealN, rtypeN))) + if (((((((((((((at == nilN) || (at->kind == decl_nil)) || (at == ft)) || (typePair (at, ft, cardinalN, wordN))) || (typePair (at, ft, cardinalN, ztypeN))) || (typePair (at, ft, integerN, ztypeN))) || (typePair (at, ft, longcardN, ztypeN))) || (typePair (at, ft, shortcardN, ztypeN))) || (typePair (at, ft, longintN, ztypeN))) || (typePair (at, ft, shortintN, ztypeN))) || (typePair (at, ft, realN, rtypeN))) || (typePair (at, ft, longrealN, rtypeN))) || (typePair (at, ft, shortrealN, rtypeN))) { return FALSE; } @@ -15008,7 +15054,7 @@ static unsigned int checkSystemCast (mcPretty_pretty p, decl_node actual, decl_n if (needsCast (at, ft)) { /* avoid gcc warning by using compound statement even if not strictly necessary. */ - if (lang == ansiCP) + if (lang == decl_ansiCP) { if ((isString (actual)) && ((decl_skipType (ft)) == addressN)) { @@ -15396,7 +15442,7 @@ static void doAdrArgC (mcPretty_pretty p, decl_node n) /* avoid dangling else. */ if (isString (n)) { - if (lang == ansiCP) + if (lang == decl_ansiCP) { outText (p, (const char *) "const_cast (reinterpret_cast", 48); outText (p, (const char *) "(", 1); @@ -15435,7 +15481,7 @@ static void doAdrC (mcPretty_pretty p, decl_node n) static void doInc (mcPretty_pretty p, decl_node n) { mcDebug_assert (isIntrinsic (n)); - if (lang == ansiCP) + if (lang == decl_ansiCP) { doIncDecCP (p, n, (const char *) "+", 1); } @@ -15453,7 +15499,7 @@ static void doInc (mcPretty_pretty p, decl_node n) static void doDec (mcPretty_pretty p, decl_node n) { mcDebug_assert (isIntrinsic (n)); - if (lang == ansiCP) + if (lang == decl_ansiCP) { doIncDecCP (p, n, (const char *) "-", 1); } @@ -15922,15 +15968,15 @@ static unsigned int isIntrinsic (decl_node n) { switch (n->kind) { - case unreachable: - case throw_: - case inc: - case dec: - case incl: - case excl: - case new_: - case dispose: - case halt: + case decl_unreachable: + case decl_throw: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: + case decl_new: + case decl_dispose: + case decl_halt: return TRUE; break; @@ -15950,7 +15996,7 @@ static unsigned int isIntrinsic (decl_node n) static void doHalt (mcPretty_pretty p, decl_node n) { - mcDebug_assert (n->kind == halt); + mcDebug_assert (n->kind == decl_halt); if ((n->intrinsicF.args == NULL) || ((expListLen (n->intrinsicF.args)) == 0)) { outText (p, (const char *) "M2RTS_HALT", 10); @@ -15977,17 +16023,17 @@ static void doCreal (mcPretty_pretty p, decl_node t) { switch (t->kind) { - case complex_: + case decl_complex: keyc_useComplex (); outText (p, (const char *) "creal", 5); break; - case longcomplex: + case decl_longcomplex: keyc_useComplex (); outText (p, (const char *) "creall", 6); break; - case shortcomplex: + case decl_shortcomplex: keyc_useComplex (); outText (p, (const char *) "crealf", 6); break; @@ -16008,17 +16054,17 @@ static void doCimag (mcPretty_pretty p, decl_node t) { switch (t->kind) { - case complex_: + case decl_complex: keyc_useComplex (); outText (p, (const char *) "cimag", 5); break; - case longcomplex: + case decl_longcomplex: keyc_useComplex (); outText (p, (const char *) "cimagl", 6); break; - case shortcomplex: + case decl_shortcomplex: keyc_useComplex (); outText (p, (const char *) "cimagf", 6); break; @@ -16039,7 +16085,7 @@ static void doReC (mcPretty_pretty p, decl_node n) { decl_node t; - mcDebug_assert (n->kind == re); + mcDebug_assert (n->kind == decl_re); if (n->unaryF.arg != NULL) { t = getExprType (n->unaryF.arg); @@ -16065,7 +16111,7 @@ static void doImC (mcPretty_pretty p, decl_node n) { decl_node t; - mcDebug_assert (n->kind == im); + mcDebug_assert (n->kind == decl_im); if (n->unaryF.arg != NULL) { t = getExprType (n->unaryF.arg); @@ -16118,39 +16164,39 @@ static void doIntrinsicC (mcPretty_pretty p, decl_node n) doCommentC (p, n->intrinsicF.intrinsicComment.body); switch (n->kind) { - case unreachable: + case decl_unreachable: doUnreachableC (p, n); break; - case throw_: + case decl_throw: doThrowC (p, n); break; - case halt: + case decl_halt: doHalt (p, n); break; - case inc: + case decl_inc: doInc (p, n); break; - case dec: + case decl_dec: doDec (p, n); break; - case incl: + case decl_incl: doInclC (p, n); break; - case excl: + case decl_excl: doExclC (p, n); break; - case new_: + case decl_new: doNewC (p, n); break; - case dispose: + case decl_dispose: doDisposeC (p, n); break; @@ -16172,23 +16218,23 @@ static unsigned int isIntrinsicFunction (decl_node n) { switch (n->kind) { - case val: - case adr: - case size: - case tsize: - case float_: - case trunc_: - case ord: - case chr: - case cap: - case abs_: - case high: - case length: - case min: - case max: - case re: - case im: - case cmplx: + case decl_val: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_float: + case decl_trunc: + case decl_ord: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_high: + case decl_length: + case decl_min: + case decl_max: + case decl_re: + case decl_im: + case decl_cmplx: return TRUE; break; @@ -16388,7 +16434,7 @@ static void doException (mcPretty_pretty p, const char *a_, unsigned int _a_high memcpy (a, a_, _a_high+1); keyc_useException (); - if (lang == ansiCP) + if (lang == decl_ansiCP) { doExceptionCP (p, (const char *) a, _a_high, n); } @@ -16856,11 +16902,11 @@ static void stop (void) doLocalVarC - */ -static void doLocalVarC (mcPretty_pretty p, scopeT s) +static void doLocalVarC (mcPretty_pretty p, decl_scopeT s) { includeVarProcedure (s); debugLists (); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); } @@ -16868,12 +16914,12 @@ static void doLocalVarC (mcPretty_pretty p, scopeT s) doLocalConstTypesC - */ -static void doLocalConstTypesC (mcPretty_pretty p, scopeT s) +static void doLocalConstTypesC (mcPretty_pretty p, decl_scopeT s) { simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); } @@ -16908,7 +16954,7 @@ static void includeParameters (decl_node n) static unsigned int isHalt (decl_node n) { - return n->kind == halt; + return n->kind == decl_halt; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17143,7 +17189,7 @@ static void doProcedureC (decl_node n) outProceduresC - */ -static void outProceduresC (mcPretty_pretty p, scopeT s) +static void outProceduresC (mcPretty_pretty p, decl_scopeT s) { doP = p; if (debugDecl) @@ -17158,7 +17204,7 @@ static void outProceduresC (mcPretty_pretty p, scopeT s) output - */ -static void output (decl_node n, nodeProcedure c, nodeProcedure t, nodeProcedure v) +static void output (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v) { if (decl_isConst (n)) { @@ -17181,10 +17227,10 @@ static void output (decl_node n, nodeProcedure c, nodeProcedure t, nodeProcedure allDependants - */ -static dependentState allDependants (decl_node n) +static decl_dependentState allDependants (decl_node n) { alists_alist l; - dependentState s; + decl_dependentState s; l = alists_initList (); s = walkDependants (l, n); @@ -17199,16 +17245,16 @@ static dependentState allDependants (decl_node n) walkDependants - */ -static dependentState walkDependants (alists_alist l, decl_node n) +static decl_dependentState walkDependants (alists_alist l, decl_node n) { if ((n == NULL) || (alists_isItemInList (doneQ, reinterpret_cast (n)))) { - return completed; + return decl_completed; } else if (alists_isItemInList (l, reinterpret_cast (n))) { /* avoid dangling else. */ - return recursive; + return decl_recursive; } else { @@ -17225,25 +17271,25 @@ static dependentState walkDependants (alists_alist l, decl_node n) walkType - */ -static dependentState walkType (alists_alist l, decl_node n) +static decl_dependentState walkType (alists_alist l, decl_node n) { decl_node t; t = decl_getType (n); if (alists_isItemInList (doneQ, reinterpret_cast (t))) { - return completed; + return decl_completed; } else if (alists_isItemInList (partialQ, reinterpret_cast (t))) { /* avoid dangling else. */ - return blocked; + return decl_blocked; } else { /* avoid dangling else. */ queueBlocked (t); - return blocked; + return decl_blocked; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -17294,25 +17340,25 @@ static void dbt (const char *a_, unsigned int _a_high) dbs - */ -static void dbs (dependentState s, decl_node n) +static void dbs (decl_dependentState s, decl_node n) { if (mcOptions_getDebugTopological ()) { switch (s) { - case completed: + case decl_completed: outText (doP, (const char *) "{completed ", 11); break; - case blocked: + case decl_blocked: outText (doP, (const char *) "{blocked ", 9); break; - case partial: + case decl_partial: outText (doP, (const char *) "{partial ", 9); break; - case recursive: + case decl_recursive: outText (doP, (const char *) "{recursive ", 11); break; @@ -17364,9 +17410,9 @@ static void dbq (decl_node n) walkRecord - */ -static dependentState walkRecord (alists_alist l, decl_node n) +static decl_dependentState walkRecord (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; unsigned int o; unsigned int i; unsigned int t; @@ -17388,7 +17434,7 @@ static dependentState walkRecord (alists_alist l, decl_node n) { /* do nothing as it is a tag selector processed in the varient. */ s = walkDependants (l, q); - if (s != completed) + if (s != decl_completed) { dbs (s, q); addTodo (n); @@ -17403,7 +17449,7 @@ static dependentState walkRecord (alists_alist l, decl_node n) db ((const char *) "{completed", 10, n); dbt ((const char *) "}\\n", 3); mcPretty_setindent (doP, o); - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17413,16 +17459,16 @@ static dependentState walkRecord (alists_alist l, decl_node n) walkVarient - */ -static dependentState walkVarient (alists_alist l, decl_node n) +static decl_dependentState walkVarient (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; unsigned int i; unsigned int t; decl_node q; db ((const char *) "\\nwalking", 9, n); s = walkDependants (l, n->varientF.tag); - if (s != completed) + if (s != decl_completed) { dbs (s, n->varientF.tag); dbq (n->varientF.tag); @@ -17436,7 +17482,7 @@ static dependentState walkVarient (alists_alist l, decl_node n) q = static_cast (Indexing_GetIndice (n->varientF.listOfSons, i)); db ((const char *) "", 0, q); s = walkDependants (l, q); - if (s != completed) + if (s != decl_completed) { dbs (s, q); db ((const char *) "\\n", 2, NULL); @@ -17446,7 +17492,7 @@ static dependentState walkVarient (alists_alist l, decl_node n) } db ((const char *) "{completed", 10, n); dbt ((const char *) "}\\n", 3); - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17469,19 +17515,19 @@ static void queueBlocked (decl_node n) walkVar - */ -static dependentState walkVar (alists_alist l, decl_node n) +static decl_dependentState walkVar (alists_alist l, decl_node n) { decl_node t; t = decl_getType (n); if (alists_isItemInList (doneQ, reinterpret_cast (t))) { - return completed; + return decl_completed; } else { queueBlocked (t); - return blocked; + return decl_blocked; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -17492,21 +17538,21 @@ static dependentState walkVar (alists_alist l, decl_node n) walkEnumeration - */ -static dependentState walkEnumeration (alists_alist l, decl_node n) +static decl_dependentState walkEnumeration (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; unsigned int i; unsigned int t; decl_node q; i = Indexing_LowIndice (n->enumerationF.listOfSons); t = Indexing_HighIndice (n->enumerationF.listOfSons); - s = completed; + s = decl_completed; while (i <= t) { q = static_cast (Indexing_GetIndice (n->enumerationF.listOfSons, i)); s = walkDependants (l, q); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17522,26 +17568,26 @@ static dependentState walkEnumeration (alists_alist l, decl_node n) walkSubrange - */ -static dependentState walkSubrange (alists_alist l, decl_node n) +static decl_dependentState walkSubrange (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->subrangeF.low); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->subrangeF.high); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->subrangeF.type); - if (s != completed) + if (s != decl_completed) { return s; } - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17551,21 +17597,21 @@ static dependentState walkSubrange (alists_alist l, decl_node n) walkSubscript - */ -static dependentState walkSubscript (alists_alist l, decl_node n) +static decl_dependentState walkSubscript (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->subscriptF.expr); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->subscriptF.type); - if (s != completed) + if (s != decl_completed) { return s; } - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17575,7 +17621,7 @@ static dependentState walkSubscript (alists_alist l, decl_node n) walkPointer - */ -static dependentState walkPointer (alists_alist l, decl_node n) +static decl_dependentState walkPointer (alists_alist l, decl_node n) { decl_node t; @@ -17584,7 +17630,7 @@ static dependentState walkPointer (alists_alist l, decl_node n) if ((alists_isItemInList (partialQ, reinterpret_cast (t))) || (alists_isItemInList (doneQ, reinterpret_cast (t)))) { /* pointer to partial can always generate a complete type. */ - return completed; + return decl_completed; } return walkType (l, n); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -17596,19 +17642,19 @@ static dependentState walkPointer (alists_alist l, decl_node n) walkArray - */ -static dependentState walkArray (alists_alist l, decl_node n) +static decl_dependentState walkArray (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; /* an array can only be declared if its data type has already been emitted. */ if (! (alists_isItemInList (doneQ, reinterpret_cast (n->arrayF.type)))) { s = walkDependants (l, n->arrayF.type); queueBlocked (n->arrayF.type); - if (s == completed) + if (s == decl_completed) { /* downgrade the completed to partial as it has not yet been written. */ - return partial; + return decl_partial; } else { @@ -17625,21 +17671,21 @@ static dependentState walkArray (alists_alist l, decl_node n) walkConst - */ -static dependentState walkConst (alists_alist l, decl_node n) +static decl_dependentState walkConst (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->constF.type); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->constF.value); - if (s != completed) + if (s != decl_completed) { return s; } - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17649,7 +17695,7 @@ static dependentState walkConst (alists_alist l, decl_node n) walkVarParam - */ -static dependentState walkVarParam (alists_alist l, decl_node n) +static decl_dependentState walkVarParam (alists_alist l, decl_node n) { decl_node t; @@ -17657,7 +17703,7 @@ static dependentState walkVarParam (alists_alist l, decl_node n) if (alists_isItemInList (partialQ, reinterpret_cast (t))) { /* parameter can be issued from a partial. */ - return completed; + return decl_completed; } return walkDependants (l, t); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -17669,7 +17715,7 @@ static dependentState walkVarParam (alists_alist l, decl_node n) walkParam - */ -static dependentState walkParam (alists_alist l, decl_node n) +static decl_dependentState walkParam (alists_alist l, decl_node n) { decl_node t; @@ -17677,7 +17723,7 @@ static dependentState walkParam (alists_alist l, decl_node n) if (alists_isItemInList (partialQ, reinterpret_cast (t))) { /* parameter can be issued from a partial. */ - return completed; + return decl_completed; } return walkDependants (l, t); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -17689,7 +17735,7 @@ static dependentState walkParam (alists_alist l, decl_node n) walkOptarg - */ -static dependentState walkOptarg (alists_alist l, decl_node n) +static decl_dependentState walkOptarg (alists_alist l, decl_node n) { decl_node t; @@ -17697,7 +17743,7 @@ static dependentState walkOptarg (alists_alist l, decl_node n) if (alists_isItemInList (partialQ, reinterpret_cast (t))) { /* parameter can be issued from a partial. */ - return completed; + return decl_completed; } return walkDependants (l, t); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -17709,33 +17755,33 @@ static dependentState walkOptarg (alists_alist l, decl_node n) walkRecordField - */ -static dependentState walkRecordField (alists_alist l, decl_node n) +static decl_dependentState walkRecordField (alists_alist l, decl_node n) { decl_node t; - dependentState s; + decl_dependentState s; mcDebug_assert (decl_isRecordField (n)); t = decl_getType (n); if (alists_isItemInList (partialQ, reinterpret_cast (t))) { - dbs (partial, n); - return partial; + dbs (decl_partial, n); + return decl_partial; } else if (alists_isItemInList (doneQ, reinterpret_cast (t))) { /* avoid dangling else. */ - dbs (completed, n); - return completed; + dbs (decl_completed, n); + return decl_completed; } else { /* avoid dangling else. */ addTodo (t); - dbs (blocked, n); + dbs (decl_blocked, n); dbq (n); dbq (t); /* s := walkDependants (l, t) */ - return blocked; + return decl_blocked; } /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); @@ -17746,21 +17792,21 @@ static dependentState walkRecordField (alists_alist l, decl_node n) walkVarientField - */ -static dependentState walkVarientField (alists_alist l, decl_node n) +static decl_dependentState walkVarientField (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; unsigned int i; unsigned int t; decl_node q; i = Indexing_LowIndice (n->varientfieldF.listOfSons); t = Indexing_HighIndice (n->varientfieldF.listOfSons); - s = completed; + s = decl_completed; while (i <= t) { q = static_cast (Indexing_GetIndice (n->varientfieldF.listOfSons, i)); s = walkDependants (l, q); - if (s != completed) + if (s != decl_completed) { dbs (s, n); return s; @@ -17779,9 +17825,9 @@ static dependentState walkVarientField (alists_alist l, decl_node n) walkEnumerationField - */ -static dependentState walkEnumerationField (alists_alist l, decl_node n) +static decl_dependentState walkEnumerationField (alists_alist l, decl_node n) { - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17791,7 +17837,7 @@ static dependentState walkEnumerationField (alists_alist l, decl_node n) walkSet - */ -static dependentState walkSet (alists_alist l, decl_node n) +static decl_dependentState walkSet (alists_alist l, decl_node n) { return walkDependants (l, decl_getType (n)); /* static analysis guarentees a RETURN statement will be used before here. */ @@ -17803,9 +17849,9 @@ static dependentState walkSet (alists_alist l, decl_node n) walkProcType - */ -static dependentState walkProcType (alists_alist l, decl_node n) +static decl_dependentState walkProcType (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; decl_node t; t = decl_getType (n); @@ -17815,7 +17861,7 @@ static dependentState walkProcType (alists_alist l, decl_node n) { /* proctype can be generated from partial types. */ s = walkDependants (l, t); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17830,12 +17876,12 @@ static dependentState walkProcType (alists_alist l, decl_node n) walkProcedure - */ -static dependentState walkProcedure (alists_alist l, decl_node n) +static decl_dependentState walkProcedure (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, decl_getType (n)); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17849,9 +17895,9 @@ static dependentState walkProcedure (alists_alist l, decl_node n) walkParameters - */ -static dependentState walkParameters (alists_alist l, Indexing_Index p) +static decl_dependentState walkParameters (alists_alist l, Indexing_Index p) { - dependentState s; + decl_dependentState s; unsigned int i; unsigned int h; decl_node q; @@ -17862,13 +17908,13 @@ static dependentState walkParameters (alists_alist l, Indexing_Index p) { q = static_cast (Indexing_GetIndice (p, i)); s = walkDependants (l, q); - if (s != completed) + if (s != decl_completed) { return s; } i += 1; } - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17878,9 +17924,9 @@ static dependentState walkParameters (alists_alist l, Indexing_Index p) walkFuncCall - */ -static dependentState walkFuncCall (alists_alist l, decl_node n) +static decl_dependentState walkFuncCall (alists_alist l, decl_node n) { - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -17890,12 +17936,12 @@ static dependentState walkFuncCall (alists_alist l, decl_node n) walkUnary - */ -static dependentState walkUnary (alists_alist l, decl_node n) +static decl_dependentState walkUnary (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->unaryF.arg); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17909,17 +17955,17 @@ static dependentState walkUnary (alists_alist l, decl_node n) walkBinary - */ -static dependentState walkBinary (alists_alist l, decl_node n) +static decl_dependentState walkBinary (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->binaryF.left); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->binaryF.right); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17933,17 +17979,17 @@ static dependentState walkBinary (alists_alist l, decl_node n) walkComponentRef - */ -static dependentState walkComponentRef (alists_alist l, decl_node n) +static decl_dependentState walkComponentRef (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->componentrefF.rec); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->componentrefF.field); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17957,17 +18003,17 @@ static dependentState walkComponentRef (alists_alist l, decl_node n) walkPointerRef - */ -static dependentState walkPointerRef (alists_alist l, decl_node n) +static decl_dependentState walkPointerRef (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; s = walkDependants (l, n->pointerrefF.ptr); - if (s != completed) + if (s != decl_completed) { return s; } s = walkDependants (l, n->pointerrefF.field); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17981,15 +18027,15 @@ static dependentState walkPointerRef (alists_alist l, decl_node n) walkSetValue - */ -static dependentState walkSetValue (alists_alist l, decl_node n) +static decl_dependentState walkSetValue (alists_alist l, decl_node n) { - dependentState s; + decl_dependentState s; unsigned int i; unsigned int j; mcDebug_assert (decl_isSetValue (n)); s = walkDependants (l, n->setvalueF.type); - if (s != completed) + if (s != decl_completed) { return s; } @@ -17998,13 +18044,13 @@ static dependentState walkSetValue (alists_alist l, decl_node n) while (i <= j) { s = walkDependants (l, reinterpret_cast (Indexing_GetIndice (n->setvalueF.values, i))); - if (s != completed) + if (s != decl_completed) { return s; } i += 1; } - return completed; + return decl_completed; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -18015,197 +18061,197 @@ static dependentState walkSetValue (alists_alist l, decl_node n) all dependants have been declared. */ -static dependentState doDependants (alists_alist l, decl_node n) +static decl_dependentState doDependants (alists_alist l, decl_node n) { switch (n->kind) { - case throw_: - case varargs: - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case boolean: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: - case proc: + case decl_throw: + case decl_varargs: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_boolean: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_proc: /* base types. */ - return completed; + return decl_completed; break; - case type: + case decl_type: /* language features and compound type attributes. */ return walkType (l, n); break; - case record: + case decl_record: return walkRecord (l, n); break; - case varient: + case decl_varient: return walkVarient (l, n); break; - case var: + case decl_var: return walkVar (l, n); break; - case enumeration: + case decl_enumeration: return walkEnumeration (l, n); break; - case subrange: + case decl_subrange: return walkSubrange (l, n); break; - case pointer: + case decl_pointer: return walkPointer (l, n); break; - case array: + case decl_array: return walkArray (l, n); break; - case string: - return completed; + case decl_string: + return decl_completed; break; - case const_: + case decl_const: return walkConst (l, n); break; - case literal: - return completed; + case decl_literal: + return decl_completed; break; - case varparam: + case decl_varparam: return walkVarParam (l, n); break; - case param: + case decl_param: return walkParam (l, n); break; - case optarg_: + case decl_optarg: return walkOptarg (l, n); break; - case recordfield: + case decl_recordfield: return walkRecordField (l, n); break; - case varientfield: + case decl_varientfield: return walkVarientField (l, n); break; - case enumerationfield: + case decl_enumerationfield: return walkEnumerationField (l, n); break; - case set: + case decl_set: return walkSet (l, n); break; - case proctype: + case decl_proctype: return walkProcType (l, n); break; - case subscript: + case decl_subscript: return walkSubscript (l, n); break; - case procedure: + case decl_procedure: /* blocks. */ return walkProcedure (l, n); break; - case def: - case imp: - case module: - case loop: - case while_: - case for_: - case repeat: - case if_: - case elsif: - case assignment: + case decl_def: + case decl_imp: + case decl_module: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ M2RTS_HALT (-1); __builtin_unreachable (); break; - case componentref: + case decl_componentref: /* expressions. */ return walkComponentRef (l, n); break; - case pointerref: + case decl_pointerref: return walkPointerRef (l, n); break; - case not_: - case abs_: - case min: - case max: - case chr: - case cap: - case ord: - case float_: - case trunc_: - case high: + case decl_not: + case decl_abs: + case decl_min: + case decl_max: + case decl_chr: + case decl_cap: + case decl_ord: + case decl_float: + case decl_trunc: + case decl_high: return walkUnary (l, n); break; - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: return walkBinary (l, n); break; - case constexp: - case neg: - case adr: - case size: - case tsize: - case deref: + case decl_constexp: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_deref: return walkUnary (l, n); break; - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: return walkBinary (l, n); break; - case funccall: + case decl_funccall: return walkFuncCall (l, n); break; - case setvalue: + case decl_setvalue: return walkSetValue (l, n); break; @@ -18223,7 +18269,7 @@ static dependentState doDependants (alists_alist l, decl_node n) tryComplete - returns TRUE if node, n, can be and was completed. */ -static unsigned int tryComplete (decl_node n, nodeProcedure c, nodeProcedure t, nodeProcedure v) +static unsigned int tryComplete (decl_node n, decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v) { if (decl_isEnumeration (n)) { @@ -18238,7 +18284,7 @@ static unsigned int tryComplete (decl_node n, nodeProcedure c, nodeProcedure t, outputHidden (n); return TRUE; } - else if ((allDependants (n)) == completed) + else if ((allDependants (n)) == decl_completed) { /* avoid dangling else. */ output (n, c, t, v); @@ -18254,15 +18300,15 @@ static unsigned int tryComplete (decl_node n, nodeProcedure c, nodeProcedure t, tryCompleteFromPartial - */ -static unsigned int tryCompleteFromPartial (decl_node n, nodeProcedure t) +static unsigned int tryCompleteFromPartial (decl_node n, decl_nodeProcedure t) { - if ((((decl_isType (n)) && ((decl_getType (n)) != NULL)) && (decl_isPointer (decl_getType (n)))) && ((allDependants (decl_getType (n))) == completed)) + if ((((decl_isType (n)) && ((decl_getType (n)) != NULL)) && (decl_isPointer (decl_getType (n)))) && ((allDependants (decl_getType (n))) == decl_completed)) { /* alists.includeItemIntoList (partialQ, getType (n)) ; */ outputHiddenComplete (n); return TRUE; } - else if ((allDependants (n)) == completed) + else if ((allDependants (n)) == decl_completed) { /* avoid dangling else. */ (*t.proc) (n); @@ -18278,33 +18324,33 @@ static unsigned int tryCompleteFromPartial (decl_node n, nodeProcedure t) visitIntrinsicFunction - */ -static void visitIntrinsicFunction (alists_alist v, decl_node n, nodeProcedure p) +static void visitIntrinsicFunction (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isIntrinsicFunction (n)); switch (n->kind) { - case val: - case cmplx: + case decl_val: + case decl_cmplx: visitNode (v, n->binaryF.left, p); visitNode (v, n->binaryF.right, p); visitNode (v, n->binaryF.resultType, p); break; - case length: - case adr: - case size: - case tsize: - case float_: - case trunc_: - case ord: - case chr: - case cap: - case abs_: - case high: - case min: - case max: - case re: - case im: + case decl_length: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_float: + case decl_trunc: + case decl_ord: + case decl_chr: + case decl_cap: + case decl_abs: + case decl_high: + case decl_min: + case decl_max: + case decl_re: + case decl_im: visitNode (v, n->unaryF.arg, p); visitNode (v, n->unaryF.resultType, p); break; @@ -18321,7 +18367,7 @@ static void visitIntrinsicFunction (alists_alist v, decl_node n, nodeProcedure p visitUnary - */ -static void visitUnary (alists_alist v, decl_node n, nodeProcedure p) +static void visitUnary (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isUnary (n)); visitNode (v, n->unaryF.arg, p); @@ -18333,7 +18379,7 @@ static void visitUnary (alists_alist v, decl_node n, nodeProcedure p) visitBinary - */ -static void visitBinary (alists_alist v, decl_node n, nodeProcedure p) +static void visitBinary (alists_alist v, decl_node n, decl_nodeProcedure p) { visitNode (v, n->binaryF.left, p); visitNode (v, n->binaryF.right, p); @@ -18345,7 +18391,7 @@ static void visitBinary (alists_alist v, decl_node n, nodeProcedure p) visitBoolean - */ -static void visitBoolean (alists_alist v, decl_node n, nodeProcedure p) +static void visitBoolean (alists_alist v, decl_node n, decl_nodeProcedure p) { visitNode (v, falseN, p); visitNode (v, trueN, p); @@ -18356,7 +18402,7 @@ static void visitBoolean (alists_alist v, decl_node n, nodeProcedure p) visitScope - */ -static void visitScope (alists_alist v, decl_node n, nodeProcedure p) +static void visitScope (alists_alist v, decl_node n, decl_nodeProcedure p) { if (mustVisitScope) { @@ -18369,7 +18415,7 @@ static void visitScope (alists_alist v, decl_node n, nodeProcedure p) visitType - */ -static void visitType (alists_alist v, decl_node n, nodeProcedure p) +static void visitType (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isType (n)); visitNode (v, n->typeF.type, p); @@ -18381,7 +18427,7 @@ static void visitType (alists_alist v, decl_node n, nodeProcedure p) visitIndex - */ -static void visitIndex (alists_alist v, Indexing_Index i, nodeProcedure p) +static void visitIndex (alists_alist v, Indexing_Index i, decl_nodeProcedure p) { unsigned int j; unsigned int h; @@ -18400,7 +18446,7 @@ static void visitIndex (alists_alist v, Indexing_Index i, nodeProcedure p) visitRecord - */ -static void visitRecord (alists_alist v, decl_node n, nodeProcedure p) +static void visitRecord (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isRecord (n)); visitScope (v, n->recordF.scope, p); @@ -18412,7 +18458,7 @@ static void visitRecord (alists_alist v, decl_node n, nodeProcedure p) visitVarient - */ -static void visitVarient (alists_alist v, decl_node n, nodeProcedure p) +static void visitVarient (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isVarient (n)); visitIndex (v, n->varientF.listOfSons, p); @@ -18426,7 +18472,7 @@ static void visitVarient (alists_alist v, decl_node n, nodeProcedure p) visitVar - */ -static void visitVar (alists_alist v, decl_node n, nodeProcedure p) +static void visitVar (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isVar (n)); visitNode (v, n->varF.type, p); @@ -18439,7 +18485,7 @@ static void visitVar (alists_alist v, decl_node n, nodeProcedure p) visitEnumeration - */ -static void visitEnumeration (alists_alist v, decl_node n, nodeProcedure p) +static void visitEnumeration (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isEnumeration (n)); visitIndex (v, n->enumerationF.listOfSons, p); @@ -18451,7 +18497,7 @@ static void visitEnumeration (alists_alist v, decl_node n, nodeProcedure p) visitSubrange - */ -static void visitSubrange (alists_alist v, decl_node n, nodeProcedure p) +static void visitSubrange (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isSubrange (n)); visitNode (v, n->subrangeF.low, p); @@ -18465,7 +18511,7 @@ static void visitSubrange (alists_alist v, decl_node n, nodeProcedure p) visitPointer - */ -static void visitPointer (alists_alist v, decl_node n, nodeProcedure p) +static void visitPointer (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isPointer (n)); visitNode (v, n->pointerF.type, p); @@ -18477,7 +18523,7 @@ static void visitPointer (alists_alist v, decl_node n, nodeProcedure p) visitArray - */ -static void visitArray (alists_alist v, decl_node n, nodeProcedure p) +static void visitArray (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isArray (n)); visitNode (v, n->arrayF.subr, p); @@ -18490,7 +18536,7 @@ static void visitArray (alists_alist v, decl_node n, nodeProcedure p) visitConst - */ -static void visitConst (alists_alist v, decl_node n, nodeProcedure p) +static void visitConst (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isConst (n)); visitNode (v, n->constF.type, p); @@ -18503,7 +18549,7 @@ static void visitConst (alists_alist v, decl_node n, nodeProcedure p) visitVarParam - */ -static void visitVarParam (alists_alist v, decl_node n, nodeProcedure p) +static void visitVarParam (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isVarParam (n)); visitNode (v, n->varparamF.namelist, p); @@ -18516,7 +18562,7 @@ static void visitVarParam (alists_alist v, decl_node n, nodeProcedure p) visitParam - */ -static void visitParam (alists_alist v, decl_node n, nodeProcedure p) +static void visitParam (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isParam (n)); visitNode (v, n->paramF.namelist, p); @@ -18529,7 +18575,7 @@ static void visitParam (alists_alist v, decl_node n, nodeProcedure p) visitOptarg - */ -static void visitOptarg (alists_alist v, decl_node n, nodeProcedure p) +static void visitOptarg (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isOptarg (n)); visitNode (v, n->optargF.namelist, p); @@ -18543,7 +18589,7 @@ static void visitOptarg (alists_alist v, decl_node n, nodeProcedure p) visitRecordField - */ -static void visitRecordField (alists_alist v, decl_node n, nodeProcedure p) +static void visitRecordField (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isRecordField (n)); visitNode (v, n->recordfieldF.type, p); @@ -18557,7 +18603,7 @@ static void visitRecordField (alists_alist v, decl_node n, nodeProcedure p) visitVarientField - */ -static void visitVarientField (alists_alist v, decl_node n, nodeProcedure p) +static void visitVarientField (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isVarientField (n)); visitNode (v, n->varientfieldF.parent, p); @@ -18571,7 +18617,7 @@ static void visitVarientField (alists_alist v, decl_node n, nodeProcedure p) visitEnumerationField - */ -static void visitEnumerationField (alists_alist v, decl_node n, nodeProcedure p) +static void visitEnumerationField (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isEnumerationField (n)); visitNode (v, n->enumerationfieldF.type, p); @@ -18583,7 +18629,7 @@ static void visitEnumerationField (alists_alist v, decl_node n, nodeProcedure p) visitSet - */ -static void visitSet (alists_alist v, decl_node n, nodeProcedure p) +static void visitSet (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isSet (n)); visitNode (v, n->setF.type, p); @@ -18595,7 +18641,7 @@ static void visitSet (alists_alist v, decl_node n, nodeProcedure p) visitProcType - */ -static void visitProcType (alists_alist v, decl_node n, nodeProcedure p) +static void visitProcType (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isProcType (n)); visitIndex (v, n->proctypeF.parameters, p); @@ -18609,7 +18655,7 @@ static void visitProcType (alists_alist v, decl_node n, nodeProcedure p) visitSubscript - */ -static void visitSubscript (alists_alist v, decl_node n, nodeProcedure p) +static void visitSubscript (alists_alist v, decl_node n, decl_nodeProcedure p) { } @@ -18618,7 +18664,7 @@ static void visitSubscript (alists_alist v, decl_node n, nodeProcedure p) visitDecls - */ -static void visitDecls (alists_alist v, scopeT s, nodeProcedure p) +static void visitDecls (alists_alist v, decl_scopeT s, decl_nodeProcedure p) { visitIndex (v, s.constants, p); visitIndex (v, s.types, p); @@ -18631,7 +18677,7 @@ static void visitDecls (alists_alist v, scopeT s, nodeProcedure p) visitProcedure - */ -static void visitProcedure (alists_alist v, decl_node n, nodeProcedure p) +static void visitProcedure (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isProcedure (n)); visitDecls (v, n->procedureF.decls, p); @@ -18647,7 +18693,7 @@ static void visitProcedure (alists_alist v, decl_node n, nodeProcedure p) visitDef - */ -static void visitDef (alists_alist v, decl_node n, nodeProcedure p) +static void visitDef (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isDef (n)); visitDecls (v, n->defF.decls, p); @@ -18658,7 +18704,7 @@ static void visitDef (alists_alist v, decl_node n, nodeProcedure p) visitImp - */ -static void visitImp (alists_alist v, decl_node n, nodeProcedure p) +static void visitImp (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isImp (n)); visitDecls (v, n->impF.decls, p); @@ -18672,7 +18718,7 @@ static void visitImp (alists_alist v, decl_node n, nodeProcedure p) visitModule - */ -static void visitModule (alists_alist v, decl_node n, nodeProcedure p) +static void visitModule (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isModule (n)); visitDecls (v, n->moduleF.decls, p); @@ -18685,7 +18731,7 @@ static void visitModule (alists_alist v, decl_node n, nodeProcedure p) visitLoop - */ -static void visitLoop (alists_alist v, decl_node n, nodeProcedure p) +static void visitLoop (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isLoop (n)); visitNode (v, n->loopF.statements, p); @@ -18696,7 +18742,7 @@ static void visitLoop (alists_alist v, decl_node n, nodeProcedure p) visitWhile - */ -static void visitWhile (alists_alist v, decl_node n, nodeProcedure p) +static void visitWhile (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isWhile (n)); visitNode (v, n->whileF.expr, p); @@ -18708,7 +18754,7 @@ static void visitWhile (alists_alist v, decl_node n, nodeProcedure p) visitRepeat - */ -static void visitRepeat (alists_alist v, decl_node n, nodeProcedure p) +static void visitRepeat (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isRepeat (n)); visitNode (v, n->repeatF.expr, p); @@ -18720,7 +18766,7 @@ static void visitRepeat (alists_alist v, decl_node n, nodeProcedure p) visitCase - */ -static void visitCase (alists_alist v, decl_node n, nodeProcedure p) +static void visitCase (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isCase (n)); visitNode (v, n->caseF.expression, p); @@ -18733,7 +18779,7 @@ static void visitCase (alists_alist v, decl_node n, nodeProcedure p) visitCaseLabelList - */ -static void visitCaseLabelList (alists_alist v, decl_node n, nodeProcedure p) +static void visitCaseLabelList (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isCaseLabelList (n)); visitNode (v, n->caselabellistF.caseList, p); @@ -18745,7 +18791,7 @@ static void visitCaseLabelList (alists_alist v, decl_node n, nodeProcedure p) visitCaseList - */ -static void visitCaseList (alists_alist v, decl_node n, nodeProcedure p) +static void visitCaseList (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isCaseList (n)); visitIndex (v, n->caselistF.rangePairs, p); @@ -18756,7 +18802,7 @@ static void visitCaseList (alists_alist v, decl_node n, nodeProcedure p) visitRange - */ -static void visitRange (alists_alist v, decl_node n, nodeProcedure p) +static void visitRange (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isRange (n)); visitNode (v, n->rangeF.lo, p); @@ -18768,7 +18814,7 @@ static void visitRange (alists_alist v, decl_node n, nodeProcedure p) visitIf - */ -static void visitIf (alists_alist v, decl_node n, nodeProcedure p) +static void visitIf (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isIf (n)); visitNode (v, n->ifF.expr, p); @@ -18782,7 +18828,7 @@ static void visitIf (alists_alist v, decl_node n, nodeProcedure p) visitElsif - */ -static void visitElsif (alists_alist v, decl_node n, nodeProcedure p) +static void visitElsif (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isElsif (n)); visitNode (v, n->elsifF.expr, p); @@ -18796,7 +18842,7 @@ static void visitElsif (alists_alist v, decl_node n, nodeProcedure p) visitFor - */ -static void visitFor (alists_alist v, decl_node n, nodeProcedure p) +static void visitFor (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isFor (n)); visitNode (v, n->forF.des, p); @@ -18811,7 +18857,7 @@ static void visitFor (alists_alist v, decl_node n, nodeProcedure p) visitAssignment - */ -static void visitAssignment (alists_alist v, decl_node n, nodeProcedure p) +static void visitAssignment (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isAssignment (n)); visitNode (v, n->assignmentF.des, p); @@ -18823,7 +18869,7 @@ static void visitAssignment (alists_alist v, decl_node n, nodeProcedure p) visitComponentRef - */ -static void visitComponentRef (alists_alist v, decl_node n, nodeProcedure p) +static void visitComponentRef (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isComponentRef (n)); visitNode (v, n->componentrefF.rec, p); @@ -18836,7 +18882,7 @@ static void visitComponentRef (alists_alist v, decl_node n, nodeProcedure p) visitPointerRef - */ -static void visitPointerRef (alists_alist v, decl_node n, nodeProcedure p) +static void visitPointerRef (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isPointerRef (n)); visitNode (v, n->pointerrefF.ptr, p); @@ -18849,7 +18895,7 @@ static void visitPointerRef (alists_alist v, decl_node n, nodeProcedure p) visitArrayRef - */ -static void visitArrayRef (alists_alist v, decl_node n, nodeProcedure p) +static void visitArrayRef (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isArrayRef (n)); visitNode (v, n->arrayrefF.array, p); @@ -18862,7 +18908,7 @@ static void visitArrayRef (alists_alist v, decl_node n, nodeProcedure p) visitFunccall - */ -static void visitFunccall (alists_alist v, decl_node n, nodeProcedure p) +static void visitFunccall (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isFuncCall (n)); visitNode (v, n->funccallF.function, p); @@ -18875,7 +18921,7 @@ static void visitFunccall (alists_alist v, decl_node n, nodeProcedure p) visitVarDecl - */ -static void visitVarDecl (alists_alist v, decl_node n, nodeProcedure p) +static void visitVarDecl (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isVarDecl (n)); visitNode (v, n->vardeclF.type, p); @@ -18887,7 +18933,7 @@ static void visitVarDecl (alists_alist v, decl_node n, nodeProcedure p) visitExplist - */ -static void visitExplist (alists_alist v, decl_node n, nodeProcedure p) +static void visitExplist (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isExpList (n)); visitIndex (v, n->explistF.exp, p); @@ -18898,7 +18944,7 @@ static void visitExplist (alists_alist v, decl_node n, nodeProcedure p) visitExit - */ -static void visitExit (alists_alist v, decl_node n, nodeProcedure p) +static void visitExit (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isExit (n)); visitNode (v, n->exitF.loop, p); @@ -18909,7 +18955,7 @@ static void visitExit (alists_alist v, decl_node n, nodeProcedure p) visitReturn - */ -static void visitReturn (alists_alist v, decl_node n, nodeProcedure p) +static void visitReturn (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isReturn (n)); visitNode (v, n->returnF.exp, p); @@ -18920,7 +18966,7 @@ static void visitReturn (alists_alist v, decl_node n, nodeProcedure p) visitStmtSeq - */ -static void visitStmtSeq (alists_alist v, decl_node n, nodeProcedure p) +static void visitStmtSeq (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isStatementSequence (n)); visitIndex (v, n->stmtF.statements, p); @@ -18931,7 +18977,7 @@ static void visitStmtSeq (alists_alist v, decl_node n, nodeProcedure p) visitVarargs - */ -static void visitVarargs (alists_alist v, decl_node n, nodeProcedure p) +static void visitVarargs (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isVarargs (n)); visitScope (v, n->varargsF.scope, p); @@ -18942,7 +18988,7 @@ static void visitVarargs (alists_alist v, decl_node n, nodeProcedure p) visitSetValue - */ -static void visitSetValue (alists_alist v, decl_node n, nodeProcedure p) +static void visitSetValue (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (decl_isSetValue (n)); visitNode (v, n->setvalueF.type, p); @@ -18954,7 +19000,7 @@ static void visitSetValue (alists_alist v, decl_node n, nodeProcedure p) visitIntrinsic - */ -static void visitIntrinsic (alists_alist v, decl_node n, nodeProcedure p) +static void visitIntrinsic (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (isIntrinsic (n)); visitNode (v, n->intrinsicF.args, p); @@ -18967,344 +19013,344 @@ static void visitIntrinsic (alists_alist v, decl_node n, nodeProcedure p) visit node, n, dependants. */ -static void visitDependants (alists_alist v, decl_node n, nodeProcedure p) +static void visitDependants (alists_alist v, decl_node n, decl_nodeProcedure p) { mcDebug_assert (n != NULL); mcDebug_assert (alists_isItemInList (v, reinterpret_cast (n))); switch (n->kind) { - case explist: + case decl_explist: visitExplist (v, n, p); break; - case funccall: + case decl_funccall: visitFunccall (v, n, p); break; - case exit_: + case decl_exit: visitExit (v, n, p); break; - case return_: + case decl_return: visitReturn (v, n, p); break; - case stmtseq: + case decl_stmtseq: visitStmtSeq (v, n, p); break; - case comment: + case decl_comment: break; - case length: + case decl_length: visitIntrinsicFunction (v, n, p); break; - case unreachable: - case throw_: - case halt: - case new_: - case dispose: - case inc: - case dec: - case incl: - case excl: + case decl_unreachable: + case decl_throw: + case decl_halt: + case decl_new: + case decl_dispose: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: visitIntrinsic (v, n, p); break; - case boolean: + case decl_boolean: visitBoolean (v, n, p); break; - case nil: - case false_: - case true_: + case decl_nil: + case decl_false: + case decl_true: break; - case varargs: + case decl_varargs: visitVarargs (v, n, p); break; - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: - case proc: - break; - - case type: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_proc: + break; + + case decl_type: /* language features and compound type attributes. */ visitType (v, n, p); break; - case record: + case decl_record: visitRecord (v, n, p); break; - case varient: + case decl_varient: visitVarient (v, n, p); break; - case var: + case decl_var: visitVar (v, n, p); break; - case enumeration: + case decl_enumeration: visitEnumeration (v, n, p); break; - case subrange: + case decl_subrange: visitSubrange (v, n, p); break; - case pointer: + case decl_pointer: visitPointer (v, n, p); break; - case array: + case decl_array: visitArray (v, n, p); break; - case string: + case decl_string: break; - case const_: + case decl_const: visitConst (v, n, p); break; - case literal: + case decl_literal: break; - case varparam: + case decl_varparam: visitVarParam (v, n, p); break; - case param: + case decl_param: visitParam (v, n, p); break; - case optarg_: + case decl_optarg: visitOptarg (v, n, p); break; - case recordfield: + case decl_recordfield: visitRecordField (v, n, p); break; - case varientfield: + case decl_varientfield: visitVarientField (v, n, p); break; - case enumerationfield: + case decl_enumerationfield: visitEnumerationField (v, n, p); break; - case set: + case decl_set: visitSet (v, n, p); break; - case proctype: + case decl_proctype: visitProcType (v, n, p); break; - case subscript: + case decl_subscript: visitSubscript (v, n, p); break; - case procedure: + case decl_procedure: /* blocks. */ visitProcedure (v, n, p); break; - case def: + case decl_def: visitDef (v, n, p); break; - case imp: + case decl_imp: visitImp (v, n, p); break; - case module: + case decl_module: visitModule (v, n, p); break; - case loop: + case decl_loop: /* statements. */ visitLoop (v, n, p); break; - case while_: + case decl_while: visitWhile (v, n, p); break; - case for_: + case decl_for: visitFor (v, n, p); break; - case repeat: + case decl_repeat: visitRepeat (v, n, p); break; - case case_: + case decl_case: visitCase (v, n, p); break; - case caselabellist: + case decl_caselabellist: visitCaseLabelList (v, n, p); break; - case caselist: + case decl_caselist: visitCaseList (v, n, p); break; - case range: + case decl_range: visitRange (v, n, p); break; - case if_: + case decl_if: visitIf (v, n, p); break; - case elsif: + case decl_elsif: visitElsif (v, n, p); break; - case assignment: + case decl_assignment: visitAssignment (v, n, p); break; - case componentref: + case decl_componentref: /* expressions. */ visitComponentRef (v, n, p); break; - case pointerref: + case decl_pointerref: visitPointerRef (v, n, p); break; - case arrayref: + case decl_arrayref: visitArrayRef (v, n, p); break; - case cmplx: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: - case and_: - case or_: - case in: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: + case decl_cmplx: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: + case decl_and: + case decl_or: + case decl_in: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: visitBinary (v, n, p); break; - case re: + case decl_re: visitUnary (v, n, p); break; - case im: + case decl_im: visitUnary (v, n, p); break; - case abs_: + case decl_abs: visitUnary (v, n, p); break; - case chr: + case decl_chr: visitUnary (v, n, p); break; - case cap: + case decl_cap: visitUnary (v, n, p); break; - case high: + case decl_high: visitUnary (v, n, p); break; - case ord: + case decl_ord: visitUnary (v, n, p); break; - case float_: + case decl_float: visitUnary (v, n, p); break; - case trunc_: + case decl_trunc: visitUnary (v, n, p); break; - case not_: + case decl_not: visitUnary (v, n, p); break; - case neg: + case decl_neg: visitUnary (v, n, p); break; - case adr: + case decl_adr: visitUnary (v, n, p); break; - case size: + case decl_size: visitUnary (v, n, p); break; - case tsize: + case decl_tsize: visitUnary (v, n, p); break; - case min: + case decl_min: visitUnary (v, n, p); break; - case max: + case decl_max: visitUnary (v, n, p); break; - case constexp: + case decl_constexp: visitUnary (v, n, p); break; - case deref: + case decl_deref: visitUnary (v, n, p); break; - case identlist: + case decl_identlist: break; - case vardecl: + case decl_vardecl: visitVarDecl (v, n, p); break; - case setvalue: + case decl_setvalue: visitSetValue (v, n, p); break; @@ -19321,7 +19367,7 @@ static void visitDependants (alists_alist v, decl_node n, nodeProcedure p) It calls p(n) if the node is unvisited. */ -static void visitNode (alists_alist v, decl_node n, nodeProcedure p) +static void visitNode (alists_alist v, decl_node n, decl_nodeProcedure p) { if ((n != NULL) && (! (alists_isItemInList (v, reinterpret_cast (n))))) { @@ -19340,318 +19386,318 @@ static DynamicStrings_String genKind (decl_node n) { switch (n->kind) { - case nil: - case true_: - case false_: - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case boolean: - case proc: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: + case decl_nil: + case decl_true: + case decl_false: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_boolean: + case decl_proc: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: /* types, no need to generate a kind string as it it contained in the name. */ return NULL; break; - case type: + case decl_type: /* language features and compound type attributes. */ return DynamicStrings_InitString ((const char *) "type", 4); break; - case record: + case decl_record: return DynamicStrings_InitString ((const char *) "record", 6); break; - case varient: + case decl_varient: return DynamicStrings_InitString ((const char *) "varient", 7); break; - case var: + case decl_var: return DynamicStrings_InitString ((const char *) "var", 3); break; - case enumeration: + case decl_enumeration: return DynamicStrings_InitString ((const char *) "enumeration", 11); break; - case subrange: + case decl_subrange: return DynamicStrings_InitString ((const char *) "subrange", 8); break; - case array: + case decl_array: return DynamicStrings_InitString ((const char *) "array", 5); break; - case subscript: + case decl_subscript: return DynamicStrings_InitString ((const char *) "subscript", 9); break; - case string: + case decl_string: return DynamicStrings_InitString ((const char *) "string", 6); break; - case const_: + case decl_const: return DynamicStrings_InitString ((const char *) "const", 5); break; - case literal: + case decl_literal: return DynamicStrings_InitString ((const char *) "literal", 7); break; - case varparam: + case decl_varparam: return DynamicStrings_InitString ((const char *) "varparam", 8); break; - case param: + case decl_param: return DynamicStrings_InitString ((const char *) "param", 5); break; - case varargs: + case decl_varargs: return DynamicStrings_InitString ((const char *) "varargs", 7); break; - case pointer: + case decl_pointer: return DynamicStrings_InitString ((const char *) "pointer", 7); break; - case recordfield: + case decl_recordfield: return DynamicStrings_InitString ((const char *) "recordfield", 11); break; - case varientfield: + case decl_varientfield: return DynamicStrings_InitString ((const char *) "varientfield", 12); break; - case enumerationfield: + case decl_enumerationfield: return DynamicStrings_InitString ((const char *) "enumerationfield", 16); break; - case set: + case decl_set: return DynamicStrings_InitString ((const char *) "set", 3); break; - case proctype: + case decl_proctype: return DynamicStrings_InitString ((const char *) "proctype", 8); break; - case procedure: + case decl_procedure: /* blocks. */ return DynamicStrings_InitString ((const char *) "procedure", 9); break; - case def: + case decl_def: return DynamicStrings_InitString ((const char *) "def", 3); break; - case imp: + case decl_imp: return DynamicStrings_InitString ((const char *) "imp", 3); break; - case module: + case decl_module: return DynamicStrings_InitString ((const char *) "module", 6); break; - case loop: + case decl_loop: /* statements. */ return DynamicStrings_InitString ((const char *) "loop", 4); break; - case while_: + case decl_while: return DynamicStrings_InitString ((const char *) "while", 5); break; - case for_: + case decl_for: return DynamicStrings_InitString ((const char *) "for", 3); break; - case repeat: + case decl_repeat: return DynamicStrings_InitString ((const char *) "repeat", 6); break; - case assignment: + case decl_assignment: return DynamicStrings_InitString ((const char *) "assignment", 10); break; - case if_: + case decl_if: return DynamicStrings_InitString ((const char *) "if", 2); break; - case elsif: + case decl_elsif: return DynamicStrings_InitString ((const char *) "elsif", 5); break; - case constexp: + case decl_constexp: /* expressions. */ return DynamicStrings_InitString ((const char *) "constexp", 8); break; - case neg: + case decl_neg: return DynamicStrings_InitString ((const char *) "neg", 3); break; - case cast: + case decl_cast: return DynamicStrings_InitString ((const char *) "cast", 4); break; - case val: + case decl_val: return DynamicStrings_InitString ((const char *) "val", 3); break; - case plus: + case decl_plus: return DynamicStrings_InitString ((const char *) "plus", 4); break; - case sub: + case decl_sub: return DynamicStrings_InitString ((const char *) "sub", 3); break; - case div_: + case decl_div: return DynamicStrings_InitString ((const char *) "div", 3); break; - case mod: + case decl_mod: return DynamicStrings_InitString ((const char *) "mod", 3); break; - case mult: + case decl_mult: return DynamicStrings_InitString ((const char *) "mult", 4); break; - case divide: + case decl_divide: return DynamicStrings_InitString ((const char *) "divide", 6); break; - case adr: + case decl_adr: return DynamicStrings_InitString ((const char *) "adr", 3); break; - case size: + case decl_size: return DynamicStrings_InitString ((const char *) "size", 4); break; - case tsize: + case decl_tsize: return DynamicStrings_InitString ((const char *) "tsize", 5); break; - case chr: + case decl_chr: return DynamicStrings_InitString ((const char *) "chr", 3); break; - case ord: + case decl_ord: return DynamicStrings_InitString ((const char *) "ord", 3); break; - case float_: + case decl_float: return DynamicStrings_InitString ((const char *) "float", 5); break; - case trunc_: + case decl_trunc: return DynamicStrings_InitString ((const char *) "trunc", 5); break; - case high: + case decl_high: return DynamicStrings_InitString ((const char *) "high", 4); break; - case componentref: + case decl_componentref: return DynamicStrings_InitString ((const char *) "componentref", 12); break; - case pointerref: + case decl_pointerref: return DynamicStrings_InitString ((const char *) "pointerref", 10); break; - case arrayref: + case decl_arrayref: return DynamicStrings_InitString ((const char *) "arrayref", 8); break; - case deref: + case decl_deref: return DynamicStrings_InitString ((const char *) "deref", 5); break; - case equal: + case decl_equal: return DynamicStrings_InitString ((const char *) "equal", 5); break; - case notequal: + case decl_notequal: return DynamicStrings_InitString ((const char *) "notequal", 8); break; - case less: + case decl_less: return DynamicStrings_InitString ((const char *) "less", 4); break; - case greater: + case decl_greater: return DynamicStrings_InitString ((const char *) "greater", 7); break; - case greequal: + case decl_greequal: return DynamicStrings_InitString ((const char *) "greequal", 8); break; - case lessequal: + case decl_lessequal: return DynamicStrings_InitString ((const char *) "lessequal", 9); break; - case lsl: + case decl_lsl: return DynamicStrings_InitString ((const char *) "lsl", 3); break; - case lsr: + case decl_lsr: return DynamicStrings_InitString ((const char *) "lsr", 3); break; - case lor: + case decl_lor: return DynamicStrings_InitString ((const char *) "lor", 3); break; - case land: + case decl_land: return DynamicStrings_InitString ((const char *) "land", 4); break; - case lnot: + case decl_lnot: return DynamicStrings_InitString ((const char *) "lnot", 4); break; - case lxor: + case decl_lxor: return DynamicStrings_InitString ((const char *) "lxor", 4); break; - case and_: + case decl_and: return DynamicStrings_InitString ((const char *) "and", 3); break; - case or_: + case decl_or: return DynamicStrings_InitString ((const char *) "or", 2); break; - case not_: + case decl_not: return DynamicStrings_InitString ((const char *) "not", 3); break; - case identlist: + case decl_identlist: return DynamicStrings_InitString ((const char *) "identlist", 9); break; - case vardecl: + case decl_vardecl: return DynamicStrings_InitString ((const char *) "vardecl", 7); break; @@ -19788,7 +19834,7 @@ static void outputHiddenComplete (decl_node n) tryPartial - */ -static unsigned int tryPartial (decl_node n, nodeProcedure pt) +static unsigned int tryPartial (decl_node n, decl_nodeProcedure pt) { decl_node q; @@ -19885,7 +19931,7 @@ static void outputPartial (decl_node n) tryOutputTodo - */ -static void tryOutputTodo (nodeProcedure c, nodeProcedure t, nodeProcedure v, nodeProcedure pt) +static void tryOutputTodo (decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v, decl_nodeProcedure pt) { unsigned int i; unsigned int n; @@ -19923,7 +19969,7 @@ static void tryOutputTodo (nodeProcedure c, nodeProcedure t, nodeProcedure v, no tryOutputPartial - */ -static void tryOutputPartial (nodeProcedure t) +static void tryOutputPartial (decl_nodeProcedure t) { unsigned int i; unsigned int n; @@ -20011,7 +20057,7 @@ static void addEnumConst (decl_node n) populateTodo - */ -static void populateTodo (nodeProcedure p) +static void populateTodo (decl_nodeProcedure p) { decl_node n; unsigned int i; @@ -20036,14 +20082,14 @@ static void populateTodo (nodeProcedure p) topologicallyOut - */ -static void topologicallyOut (nodeProcedure c, nodeProcedure t, nodeProcedure v, nodeProcedure tp, nodeProcedure pc, nodeProcedure pt, nodeProcedure pv) +static void topologicallyOut (decl_nodeProcedure c, decl_nodeProcedure t, decl_nodeProcedure v, decl_nodeProcedure tp, decl_nodeProcedure pc, decl_nodeProcedure pt, decl_nodeProcedure pv) { unsigned int tol; unsigned int pal; unsigned int to; unsigned int pa; - populateTodo ((nodeProcedure) {(nodeProcedure_t) addEnumConst}); + populateTodo ((decl_nodeProcedure) {(decl_nodeProcedure_t) addEnumConst}); tol = 0; pal = 0; to = alists_noOfItemsInList (todoQ); @@ -20404,15 +20450,15 @@ static void outImpC (mcPretty_pretty p, decl_node n) outDeclsModuleC - */ -static void outDeclsModuleC (mcPretty_pretty p, scopeT s) +static void outDeclsModuleC (mcPretty_pretty p, decl_scopeT s) { simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); /* try and output types, constants before variables and procedures. */ includeVarProcedure (s); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstC}, (nodeProcedure) {(nodeProcedure_t) doTypesC}, (nodeProcedure) {(nodeProcedure_t) doVarC}, (nodeProcedure) {(nodeProcedure_t) outputPartial}, (nodeProcedure) {(nodeProcedure_t) doNone}, (nodeProcedure) {(nodeProcedure_t) doCompletePartialC}, (nodeProcedure) {(nodeProcedure_t) doNone}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartial}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doCompletePartialC}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNone}); Indexing_ForeachIndiceInIndexDo (s.procedures, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doPrototypeC}); } @@ -20816,22 +20862,22 @@ static void doBaseM2 (mcPretty_pretty p, decl_node n) { switch (n->kind) { - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case complex_: - case longcomplex: - case shortcomplex: - case real: - case longreal: - case shortreal: - case bitset: - case boolean: - case proc: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_boolean: + case decl_proc: doNameM2 (p, n); break; @@ -20852,12 +20898,12 @@ static void doSystemM2 (mcPretty_pretty p, decl_node n) { switch (n->kind) { - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: doNameM2 (p, n); break; @@ -21165,14 +21211,14 @@ static void outputPartialM2 (decl_node n) outDeclsDefM2 - */ -static void outDeclsDefM2 (mcPretty_pretty p, scopeT s) +static void outDeclsDefM2 (mcPretty_pretty p, decl_scopeT s) { simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstM2}, (nodeProcedure) {(nodeProcedure_t) doTypesM2}, (nodeProcedure) {(nodeProcedure_t) doVarsM2}, (nodeProcedure) {(nodeProcedure_t) outputPartialM2}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarsM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartialM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}); includeVarProcedure (s); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstM2}, (nodeProcedure) {(nodeProcedure_t) doTypesM2}, (nodeProcedure) {(nodeProcedure_t) doVarsM2}, (nodeProcedure) {(nodeProcedure_t) outputPartialM2}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarsM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartialM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}); Indexing_ForeachIndiceInIndexDo (s.procedures, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doPrototypeM2}); } @@ -21210,14 +21256,14 @@ static void outDefM2 (mcPretty_pretty p, decl_node n) outDeclsImpM2 - */ -static void outDeclsImpM2 (mcPretty_pretty p, scopeT s) +static void outDeclsImpM2 (mcPretty_pretty p, decl_scopeT s) { simplifyTypes (s); includeConstType (s); doP = p; - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstM2}, (nodeProcedure) {(nodeProcedure_t) doTypesM2}, (nodeProcedure) {(nodeProcedure_t) doVarM2}, (nodeProcedure) {(nodeProcedure_t) outputPartialM2}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartialM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}); includeVarProcedure (s); - topologicallyOut ((nodeProcedure) {(nodeProcedure_t) doConstM2}, (nodeProcedure) {(nodeProcedure_t) doTypesM2}, (nodeProcedure) {(nodeProcedure_t) doVarsM2}, (nodeProcedure) {(nodeProcedure_t) outputPartialM2}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}, (nodeProcedure) {(nodeProcedure_t) doNothing}); + topologicallyOut ((decl_nodeProcedure) {(decl_nodeProcedure_t) doConstM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doTypesM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doVarsM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) outputPartialM2}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}, (decl_nodeProcedure) {(decl_nodeProcedure_t) doNothing}); outText (p, (const char *) "\\n", 2); Indexing_ForeachIndiceInIndexDo (s.procedures, (Indexing_IndexProcedure) {(Indexing_IndexProcedure_t) doPrototypeC}); } @@ -21637,39 +21683,39 @@ static void addGenericBody (decl_node n, decl_node c) { switch (n->kind) { - case unreachable: - case throw_: - case halt: - case new_: - case dispose: - case inc: - case dec: - case incl: - case excl: + case decl_unreachable: + case decl_throw: + case decl_halt: + case decl_new: + case decl_dispose: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: n->intrinsicF.intrinsicComment.body = c; break; - case funccall: + case decl_funccall: n->funccallF.funccallComment.body = c; break; - case return_: + case decl_return: n->returnF.returnComment.body = c; break; - case assignment: + case decl_assignment: n->assignmentF.assignComment.body = c; break; - case module: + case decl_module: n->moduleF.com.body = c; break; - case def: + case decl_def: n->defF.com.body = c; break; - case imp: + case decl_imp: n->impF.com.body = c; break; @@ -21689,39 +21735,39 @@ static void addGenericAfter (decl_node n, decl_node c) { switch (n->kind) { - case unreachable: - case throw_: - case halt: - case new_: - case dispose: - case inc: - case dec: - case incl: - case excl: + case decl_unreachable: + case decl_throw: + case decl_halt: + case decl_new: + case decl_dispose: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: n->intrinsicF.intrinsicComment.after = c; break; - case funccall: + case decl_funccall: n->funccallF.funccallComment.after = c; break; - case return_: + case decl_return: n->returnF.returnComment.after = c; break; - case assignment: + case decl_assignment: n->assignmentF.assignComment.after = c; break; - case module: + case decl_module: n->moduleF.com.after = c; break; - case def: + case decl_def: n->defF.com.after = c; break; - case imp: + case decl_imp: n->impF.com.after = c; break; @@ -21738,7 +21784,7 @@ static void addGenericAfter (decl_node n, decl_node c) static unsigned int isAssignment (decl_node n) { - return n->kind == assignment; + return n->kind == decl_assignment; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -21751,7 +21797,7 @@ static unsigned int isAssignment (decl_node n) static unsigned int isComment (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == comment; + return n->kind == decl_comment; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -21761,7 +21807,7 @@ static unsigned int isComment (decl_node n) initPair - initialise the commentPair, c. */ -static void initPair (commentPair *c) +static void initPair (decl_commentPair *c) { (*c).after = NULL; (*c).body = NULL; @@ -21882,7 +21928,7 @@ static decl_node dupSetValue (decl_node n) decl_node m; unsigned int i; - m = newNode (setvalue); + m = newNode (decl_setvalue); m->setvalueF.type = n->setvalueF.type; i = Indexing_LowIndice (n->setvalueF.values); while (i <= (Indexing_HighIndice (n->setvalueF.values))) @@ -21905,170 +21951,170 @@ static decl_node doDupExpr (decl_node n) mcDebug_assert (n != NULL); switch (n->kind) { - case explist: + case decl_explist: return dupExplist (n); break; - case exit_: - case return_: - case stmtseq: - case comment: + case decl_exit: + case decl_return: + case decl_stmtseq: + case decl_comment: M2RTS_HALT (-1); /* should not be duplicating code. */ __builtin_unreachable (); break; - case length: + case decl_length: M2RTS_HALT (-1); /* length should have been converted into unary. */ __builtin_unreachable (); break; - case nil: - case true_: - case false_: - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: - case boolean: - case proc: - case char_: - case integer: - case cardinal: - case longcard: - case shortcard: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: + case decl_nil: + case decl_true: + case decl_false: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: + case decl_boolean: + case decl_proc: + case decl_char: + case decl_integer: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: /* base types. */ return n; break; - case type: - case record: - case varient: - case var: - case enumeration: - case subrange: - case subscript: - case array: - case string: - case const_: - case literal: - case varparam: - case param: - case varargs: - case optarg_: - case pointer: - case recordfield: - case varientfield: - case enumerationfield: - case set: - case proctype: + case decl_type: + case decl_record: + case decl_varient: + case decl_var: + case decl_enumeration: + case decl_subrange: + case decl_subscript: + case decl_array: + case decl_string: + case decl_const: + case decl_literal: + case decl_varparam: + case decl_param: + case decl_varargs: + case decl_optarg: + case decl_pointer: + case decl_recordfield: + case decl_varientfield: + case decl_enumerationfield: + case decl_set: + case decl_proctype: /* language features and compound type attributes. */ return n; break; - case procedure: - case def: - case imp: - case module: + case decl_procedure: + case decl_def: + case decl_imp: + case decl_module: /* blocks. */ return n; break; - case loop: - case while_: - case for_: - case repeat: - case case_: - case caselabellist: - case caselist: - case range: - case if_: - case elsif: - case assignment: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_case: + case decl_caselabellist: + case decl_caselist: + case decl_range: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ return n; break; - case arrayref: + case decl_arrayref: /* expressions. */ return dupArrayref (n); break; - case pointerref: + case decl_pointerref: return dupPointerref (n); break; - case componentref: + case decl_componentref: return dupComponentref (n); break; - case cmplx: - case and_: - case or_: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: + case decl_cmplx: + case decl_and: + case decl_or: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: return dupBinary (n); break; - case re: - case im: - case constexp: - case deref: - case abs_: - case chr: - case cap: - case high: - case float_: - case trunc_: - case ord: - case not_: - case neg: - case adr: - case size: - case tsize: - case min: - case max: + case decl_re: + case decl_im: + case decl_constexp: + case decl_deref: + case decl_abs: + case decl_chr: + case decl_cap: + case decl_high: + case decl_float: + case decl_trunc: + case decl_ord: + case decl_not: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_min: + case decl_max: return dupUnary (n); break; - case identlist: + case decl_identlist: return n; break; - case vardecl: + case decl_vardecl: return n; break; - case funccall: + case decl_funccall: return dupFunccall (n); break; - case setvalue: + case decl_setvalue: return dupSetValue (n); break; @@ -22089,15 +22135,15 @@ static decl_node doDupExpr (decl_node n) static void makeSystem (void) { systemN = decl_lookupDef (nameKey_makeKey ((const char *) "SYSTEM", 6)); - addressN = makeBase (address); - locN = makeBase (loc); - byteN = makeBase (byte); - wordN = makeBase (word); - csizetN = makeBase (csizet); - cssizetN = makeBase (cssizet); - adrN = makeBase (adr); - tsizeN = makeBase (tsize); - throwN = makeBase (throw_); + addressN = makeBase (decl_address); + locN = makeBase (decl_loc); + byteN = makeBase (decl_byte); + wordN = makeBase (decl_word); + csizetN = makeBase (decl_csizet); + cssizetN = makeBase (decl_cssizet); + adrN = makeBase (decl_adr); + tsizeN = makeBase (decl_tsize); + throwN = makeBase (decl_throw); decl_enterScope (systemN); addressN = addToScope (addressN); locN = addToScope (locN); @@ -22138,7 +22184,7 @@ static decl_node makeBitnum (void) { decl_node b; - b = newNode (subrange); + b = newNode (decl_subrange); b->subrangeF.type = NULL; b->subrangeF.scope = NULL; b->subrangeF.low = lookupConst (b, nameKey_makeKey ((const char *) "0", 1)); @@ -22156,49 +22202,49 @@ static decl_node makeBitnum (void) static void makeBaseSymbols (void) { baseSymbols = symbolKey_initTree (); - booleanN = makeBase (boolean); - charN = makeBase (char_); - procN = makeBase (proc); - cardinalN = makeBase (cardinal); - longcardN = makeBase (longcard); - shortcardN = makeBase (shortcard); - integerN = makeBase (integer); - longintN = makeBase (longint); - shortintN = makeBase (shortint); - bitsetN = makeBase (bitset); + booleanN = makeBase (decl_boolean); + charN = makeBase (decl_char); + procN = makeBase (decl_proc); + cardinalN = makeBase (decl_cardinal); + longcardN = makeBase (decl_longcard); + shortcardN = makeBase (decl_shortcard); + integerN = makeBase (decl_integer); + longintN = makeBase (decl_longint); + shortintN = makeBase (decl_shortint); + bitsetN = makeBase (decl_bitset); bitnumN = makeBitnum (); - ztypeN = makeBase (ztype); - rtypeN = makeBase (rtype); - complexN = makeBase (complex_); - longcomplexN = makeBase (longcomplex); - shortcomplexN = makeBase (shortcomplex); - realN = makeBase (real); - longrealN = makeBase (longreal); - shortrealN = makeBase (shortreal); - nilN = makeBase (nil); - trueN = makeBase (true_); - falseN = makeBase (false_); - sizeN = makeBase (size); - minN = makeBase (min); - maxN = makeBase (max); - floatN = makeBase (float_); - truncN = makeBase (trunc_); - ordN = makeBase (ord); - valN = makeBase (val); - chrN = makeBase (chr); - capN = makeBase (cap); - absN = makeBase (abs_); - newN = makeBase (new_); - disposeN = makeBase (dispose); - lengthN = makeBase (length); - incN = makeBase (inc); - decN = makeBase (dec); - inclN = makeBase (incl); - exclN = makeBase (excl); - highN = makeBase (high); - imN = makeBase (im); - reN = makeBase (re); - cmplxN = makeBase (cmplx); + ztypeN = makeBase (decl_ztype); + rtypeN = makeBase (decl_rtype); + complexN = makeBase (decl_complex); + longcomplexN = makeBase (decl_longcomplex); + shortcomplexN = makeBase (decl_shortcomplex); + realN = makeBase (decl_real); + longrealN = makeBase (decl_longreal); + shortrealN = makeBase (decl_shortreal); + nilN = makeBase (decl_nil); + trueN = makeBase (decl_true); + falseN = makeBase (decl_false); + sizeN = makeBase (decl_size); + minN = makeBase (decl_min); + maxN = makeBase (decl_max); + floatN = makeBase (decl_float); + truncN = makeBase (decl_trunc); + ordN = makeBase (decl_ord); + valN = makeBase (decl_val); + chrN = makeBase (decl_chr); + capN = makeBase (decl_cap); + absN = makeBase (decl_abs); + newN = makeBase (decl_new); + disposeN = makeBase (decl_dispose); + lengthN = makeBase (decl_length); + incN = makeBase (decl_inc); + decN = makeBase (decl_dec); + inclN = makeBase (decl_incl); + exclN = makeBase (decl_excl); + highN = makeBase (decl_high); + imN = makeBase (decl_im); + reN = makeBase (decl_re); + cmplxN = makeBase (decl_cmplx); symbolKey_putSymKey (baseSymbols, nameKey_makeKey ((const char *) "BOOLEAN", 7), reinterpret_cast (booleanN)); symbolKey_putSymKey (baseSymbols, nameKey_makeKey ((const char *) "PROC", 4), reinterpret_cast (procN)); symbolKey_putSymKey (baseSymbols, nameKey_makeKey ((const char *) "CHAR", 4), reinterpret_cast (charN)); @@ -22287,7 +22333,7 @@ static void makeBuiltins (void) static void init (void) { - lang = ansiC; + lang = decl_ansiC; outputFile = FIO_StdOut; doP = mcPretty_initPretty ((mcPretty_writeProc) {(mcPretty_writeProc_t) write_}, (mcPretty_writeLnProc) {(mcPretty_writeLnProc_t) writeln}); todoQ = alists_initList (); @@ -22302,7 +22348,7 @@ static void init (void) makeSystem (); makeBuiltins (); makeM2rts (); - outputState = punct; + outputState = decl_punct; tempCount = 0; mustVisitScope = FALSE; } @@ -22354,7 +22400,7 @@ extern "C" unsigned int decl_getFirstUsed (decl_node n) extern "C" unsigned int decl_isDef (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == def; + return n->kind == decl_def; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -22367,7 +22413,7 @@ extern "C" unsigned int decl_isDef (decl_node n) extern "C" unsigned int decl_isImp (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == imp; + return n->kind == decl_imp; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -22393,15 +22439,15 @@ extern "C" unsigned int decl_isVisited (decl_node n) { switch (n->kind) { - case def: + case decl_def: return n->defF.visited; break; - case imp: + case decl_imp: return n->impF.visited; break; - case module: + case decl_module: return n->moduleF.visited; break; @@ -22423,15 +22469,15 @@ extern "C" void decl_unsetVisited (decl_node n) { switch (n->kind) { - case def: + case decl_def: n->defF.visited = FALSE; break; - case imp: + case decl_imp: n->impF.visited = FALSE; break; - case module: + case decl_module: n->moduleF.visited = FALSE; break; @@ -22451,15 +22497,15 @@ extern "C" void decl_setVisited (decl_node n) { switch (n->kind) { - case def: + case decl_def: n->defF.visited = TRUE; break; - case imp: + case decl_imp: n->impF.visited = TRUE; break; - case module: + case decl_module: n->moduleF.visited = TRUE; break; @@ -22479,15 +22525,15 @@ extern "C" void decl_setEnumsComplete (decl_node n) { switch (n->kind) { - case def: + case decl_def: n->defF.enumsComplete = TRUE; break; - case imp: + case decl_imp: n->impF.enumsComplete = TRUE; break; - case module: + case decl_module: n->moduleF.enumsComplete = TRUE; break; @@ -22507,15 +22553,15 @@ extern "C" unsigned int decl_getEnumsComplete (decl_node n) { switch (n->kind) { - case def: + case decl_def: return n->defF.enumsComplete; break; - case imp: + case decl_imp: return n->impF.enumsComplete; break; - case module: + case decl_module: return n->moduleF.enumsComplete; break; @@ -22593,7 +22639,7 @@ extern "C" decl_node decl_getNextEnum (void) extern "C" unsigned int decl_isModule (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == module; + return n->kind == decl_module; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -22720,23 +22766,23 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n) { switch (scope->kind) { - case def: + case decl_def: return static_cast (symbolKey_getSymKey (scope->defF.decls.symbols, n)); break; - case module: + case decl_module: return static_cast (symbolKey_getSymKey (scope->moduleF.decls.symbols, n)); break; - case imp: + case decl_imp: return static_cast (symbolKey_getSymKey (scope->impF.decls.symbols, n)); break; - case procedure: + case decl_procedure: return static_cast (symbolKey_getSymKey (scope->procedureF.decls.symbols, n)); break; - case record: + case decl_record: return static_cast (symbolKey_getSymKey (scope->recordF.localSymbols, n)); break; @@ -22757,7 +22803,7 @@ extern "C" decl_node decl_lookupInScope (decl_node scope, nameKey_Name n) extern "C" unsigned int decl_isConst (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == const_; + return n->kind == decl_const; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -22770,7 +22816,7 @@ extern "C" unsigned int decl_isConst (decl_node n) extern "C" unsigned int decl_isType (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == type; + return n->kind == decl_type; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -22797,321 +22843,321 @@ extern "C" decl_node decl_getType (decl_node n) { switch (n->kind) { - case new_: - case dispose: + case decl_new: + case decl_dispose: return NULL; break; - case length: + case decl_length: return cardinalN; break; - case inc: - case dec: - case incl: - case excl: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: return NULL; break; - case nil: + case decl_nil: return addressN; break; - case true_: - case false_: + case decl_true: + case decl_false: return booleanN; break; - case address: + case decl_address: return n; break; - case loc: + case decl_loc: return n; break; - case byte: + case decl_byte: return n; break; - case word: + case decl_word: return n; break; - case csizet: + case decl_csizet: return n; break; - case cssizet: + case decl_cssizet: return n; break; - case boolean: + case decl_boolean: /* base types. */ return n; break; - case proc: + case decl_proc: return n; break; - case char_: + case decl_char: return n; break; - case cardinal: + case decl_cardinal: return n; break; - case longcard: + case decl_longcard: return n; break; - case shortcard: + case decl_shortcard: return n; break; - case integer: + case decl_integer: return n; break; - case longint: + case decl_longint: return n; break; - case shortint: + case decl_shortint: return n; break; - case real: + case decl_real: return n; break; - case longreal: + case decl_longreal: return n; break; - case shortreal: + case decl_shortreal: return n; break; - case bitset: + case decl_bitset: return n; break; - case ztype: + case decl_ztype: return n; break; - case rtype: + case decl_rtype: return n; break; - case complex_: + case decl_complex: return n; break; - case longcomplex: + case decl_longcomplex: return n; break; - case shortcomplex: + case decl_shortcomplex: return n; break; - case type: + case decl_type: /* language features and compound type attributes. */ return n->typeF.type; break; - case record: + case decl_record: return n; break; - case varient: + case decl_varient: return n; break; - case var: + case decl_var: return n->varF.type; break; - case enumeration: + case decl_enumeration: return n; break; - case subrange: + case decl_subrange: return n->subrangeF.type; break; - case array: + case decl_array: return n->arrayF.type; break; - case string: + case decl_string: return charN; break; - case const_: + case decl_const: return n->constF.type; break; - case literal: + case decl_literal: return n->literalF.type; break; - case varparam: + case decl_varparam: return n->varparamF.type; break; - case param: + case decl_param: return n->paramF.type; break; - case optarg_: + case decl_optarg: return n->optargF.type; break; - case pointer: + case decl_pointer: return n->pointerF.type; break; - case recordfield: + case decl_recordfield: return n->recordfieldF.type; break; - case varientfield: + case decl_varientfield: return n; break; - case enumerationfield: + case decl_enumerationfield: return n->enumerationfieldF.type; break; - case set: + case decl_set: return n->setF.type; break; - case proctype: + case decl_proctype: return n->proctypeF.returnType; break; - case subscript: + case decl_subscript: return n->subscriptF.type; break; - case procedure: + case decl_procedure: /* blocks. */ return n->procedureF.returnType; break; - case throw_: + case decl_throw: return NULL; break; - case unreachable: + case decl_unreachable: return NULL; break; - case def: - case imp: - case module: - case loop: - case while_: - case for_: - case repeat: - case if_: - case elsif: - case assignment: + case decl_def: + case decl_imp: + case decl_module: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ M2RTS_HALT (-1); __builtin_unreachable (); break; - case cmplx: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: + case decl_cmplx: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: /* expressions. */ return n->binaryF.resultType; break; - case in: + case decl_in: return booleanN; break; - case max: - case min: - case re: - case im: - case abs_: - case constexp: - case deref: - case neg: - case adr: - case size: - case tsize: + case decl_max: + case decl_min: + case decl_re: + case decl_im: + case decl_abs: + case decl_constexp: + case decl_deref: + case decl_neg: + case decl_adr: + case decl_size: + case decl_tsize: return n->unaryF.resultType; break; - case and_: - case or_: - case not_: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_and: + case decl_or: + case decl_not: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: return booleanN; break; - case trunc_: + case decl_trunc: return integerN; break; - case float_: + case decl_float: return realN; break; - case high: + case decl_high: return cardinalN; break; - case ord: + case decl_ord: return cardinalN; break; - case chr: + case decl_chr: return charN; break; - case cap: + case decl_cap: return charN; break; - case arrayref: + case decl_arrayref: return n->arrayrefF.resultType; break; - case componentref: + case decl_componentref: return n->componentrefF.resultType; break; - case pointerref: + case decl_pointerref: return n->pointerrefF.resultType; break; - case funccall: + case decl_funccall: return n->funccallF.type; break; - case setvalue: + case decl_setvalue: return n->setvalueF.type; break; @@ -23200,7 +23246,7 @@ extern "C" unsigned int decl_hasHidden (decl_node n) extern "C" unsigned int decl_isVar (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == var; + return n->kind == decl_var; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23232,7 +23278,7 @@ extern "C" unsigned int decl_isExported (decl_node n) { switch (s->kind) { - case def: + case decl_def: return Indexing_IsIndiceInIndex (s->defF.exported, reinterpret_cast (n)); break; @@ -23272,245 +23318,245 @@ extern "C" decl_node decl_getScope (decl_node n) { switch (n->kind) { - case stmtseq: - case exit_: - case return_: - case comment: - case identlist: - case setvalue: - case halt: - case new_: - case dispose: - case length: - case inc: - case dec: - case incl: - case excl: - case nil: - case true_: - case false_: + case decl_stmtseq: + case decl_exit: + case decl_return: + case decl_comment: + case decl_identlist: + case decl_setvalue: + case decl_halt: + case decl_new: + case decl_dispose: + case decl_length: + case decl_inc: + case decl_dec: + case decl_incl: + case decl_excl: + case decl_nil: + case decl_true: + case decl_false: return NULL; break; - case address: - case loc: - case byte: - case word: - case csizet: - case cssizet: + case decl_address: + case decl_loc: + case decl_byte: + case decl_word: + case decl_csizet: + case decl_cssizet: return systemN; break; - case boolean: - case proc: - case char_: - case cardinal: - case longcard: - case shortcard: - case integer: - case longint: - case shortint: - case real: - case longreal: - case shortreal: - case bitset: - case ztype: - case rtype: - case complex_: - case longcomplex: - case shortcomplex: + case decl_boolean: + case decl_proc: + case decl_char: + case decl_cardinal: + case decl_longcard: + case decl_shortcard: + case decl_integer: + case decl_longint: + case decl_shortint: + case decl_real: + case decl_longreal: + case decl_shortreal: + case decl_bitset: + case decl_ztype: + case decl_rtype: + case decl_complex: + case decl_longcomplex: + case decl_shortcomplex: /* base types. */ return NULL; break; - case type: + case decl_type: /* language features and compound type attributes. */ return n->typeF.scope; break; - case record: + case decl_record: return n->recordF.scope; break; - case varient: + case decl_varient: return n->varientF.scope; break; - case var: + case decl_var: return n->varF.scope; break; - case enumeration: + case decl_enumeration: return n->enumerationF.scope; break; - case subrange: + case decl_subrange: return n->subrangeF.scope; break; - case array: + case decl_array: return n->arrayF.scope; break; - case string: + case decl_string: return NULL; break; - case const_: + case decl_const: return n->constF.scope; break; - case literal: + case decl_literal: return NULL; break; - case varparam: + case decl_varparam: return n->varparamF.scope; break; - case param: + case decl_param: return n->paramF.scope; break; - case optarg_: + case decl_optarg: return n->optargF.scope; break; - case pointer: + case decl_pointer: return n->pointerF.scope; break; - case recordfield: + case decl_recordfield: return n->recordfieldF.scope; break; - case varientfield: + case decl_varientfield: return n->varientfieldF.scope; break; - case enumerationfield: + case decl_enumerationfield: return n->enumerationfieldF.scope; break; - case set: + case decl_set: return n->setF.scope; break; - case proctype: + case decl_proctype: return n->proctypeF.scope; break; - case subscript: + case decl_subscript: return NULL; break; - case procedure: + case decl_procedure: /* blocks. */ return n->procedureF.scope; break; - case def: - case imp: - case module: - case case_: - case loop: - case while_: - case for_: - case repeat: - case if_: - case elsif: - case assignment: + case decl_def: + case decl_imp: + case decl_module: + case decl_case: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ return NULL; break; - case componentref: - case pointerref: - case arrayref: - case chr: - case cap: - case ord: - case float_: - case trunc_: - case high: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: + case decl_componentref: + case decl_pointerref: + case decl_arrayref: + case decl_chr: + case decl_cap: + case decl_ord: + case decl_float: + case decl_trunc: + case decl_high: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: /* expressions. */ return NULL; break; - case neg: + case decl_neg: return NULL; break; - case lsl: - case lsr: - case lor: - case land: - case lnot: - case lxor: - case and_: - case or_: - case not_: - case constexp: - case deref: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_lsl: + case decl_lsr: + case decl_lor: + case decl_land: + case decl_lnot: + case decl_lxor: + case decl_and: + case decl_or: + case decl_not: + case decl_constexp: + case decl_deref: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: return NULL; break; - case adr: - case size: - case tsize: - case throw_: + case decl_adr: + case decl_size: + case decl_tsize: + case decl_throw: return systemN; break; - case unreachable: - case cmplx: - case re: - case im: - case min: - case max: + case decl_unreachable: + case decl_cmplx: + case decl_re: + case decl_im: + case decl_min: + case decl_max: return NULL; break; - case vardecl: + case decl_vardecl: return n->vardeclF.scope; break; - case funccall: + case decl_funccall: return NULL; break; - case explist: + case decl_explist: return NULL; break; - case caselabellist: + case decl_caselabellist: return NULL; break; - case caselist: + case decl_caselist: return NULL; break; - case range: + case decl_range: return NULL; break; - case varargs: + case decl_varargs: return n->varargsF.scope; break; @@ -23531,7 +23577,7 @@ extern "C" decl_node decl_getScope (decl_node n) extern "C" unsigned int decl_isLiteral (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == literal; + return n->kind == decl_literal; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23561,7 +23607,7 @@ extern "C" unsigned int decl_isConstSet (decl_node n) extern "C" unsigned int decl_isEnumerationField (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == enumerationfield; + return n->kind == decl_enumerationfield; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23574,7 +23620,7 @@ extern "C" unsigned int decl_isEnumerationField (decl_node n) extern "C" unsigned int decl_isEnumeration (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == enumeration; + return n->kind == decl_enumeration; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23587,7 +23633,7 @@ extern "C" unsigned int decl_isEnumeration (decl_node n) extern "C" unsigned int decl_isUnbounded (decl_node n) { mcDebug_assert (n != NULL); - return (n->kind == array) && n->arrayF.isUnbounded; + return (n->kind == decl_array) && n->arrayF.isUnbounded; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23600,7 +23646,7 @@ extern "C" unsigned int decl_isUnbounded (decl_node n) extern "C" unsigned int decl_isParameter (decl_node n) { mcDebug_assert (n != NULL); - return (n->kind == param) || (n->kind == varparam); + return (n->kind == decl_param) || (n->kind == decl_varparam); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23613,7 +23659,7 @@ extern "C" unsigned int decl_isParameter (decl_node n) extern "C" unsigned int decl_isVarParam (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == varparam; + return n->kind == decl_varparam; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23626,7 +23672,7 @@ extern "C" unsigned int decl_isVarParam (decl_node n) extern "C" unsigned int decl_isParam (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == param; + return n->kind == decl_param; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23676,7 +23722,7 @@ extern "C" decl_node decl_addOptParameter (decl_node proc, nameKey_Name id, decl extern "C" unsigned int decl_isOptarg (decl_node n) { - return n->kind == optarg_; + return n->kind == decl_optarg; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23689,7 +23735,7 @@ extern "C" unsigned int decl_isOptarg (decl_node n) extern "C" unsigned int decl_isRecord (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == record; + return n->kind == decl_record; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23702,7 +23748,7 @@ extern "C" unsigned int decl_isRecord (decl_node n) extern "C" unsigned int decl_isRecordField (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == recordfield; + return n->kind == decl_recordfield; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23715,7 +23761,7 @@ extern "C" unsigned int decl_isRecordField (decl_node n) extern "C" unsigned int decl_isVarientField (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == varientfield; + return n->kind == decl_varientfield; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23728,7 +23774,7 @@ extern "C" unsigned int decl_isVarientField (decl_node n) extern "C" unsigned int decl_isArray (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == array; + return n->kind == decl_array; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23741,7 +23787,7 @@ extern "C" unsigned int decl_isArray (decl_node n) extern "C" unsigned int decl_isProcType (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == proctype; + return n->kind == decl_proctype; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23754,7 +23800,7 @@ extern "C" unsigned int decl_isProcType (decl_node n) extern "C" unsigned int decl_isPointer (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == pointer; + return n->kind == decl_pointer; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23767,7 +23813,7 @@ extern "C" unsigned int decl_isPointer (decl_node n) extern "C" unsigned int decl_isProcedure (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == procedure; + return n->kind == decl_procedure; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23780,7 +23826,7 @@ extern "C" unsigned int decl_isProcedure (decl_node n) extern "C" unsigned int decl_isVarient (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == varient; + return n->kind == decl_varient; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23793,7 +23839,7 @@ extern "C" unsigned int decl_isVarient (decl_node n) extern "C" unsigned int decl_isSet (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == set; + return n->kind == decl_set; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23806,7 +23852,7 @@ extern "C" unsigned int decl_isSet (decl_node n) extern "C" unsigned int decl_isSubrange (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == subrange; + return n->kind == decl_subrange; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -23844,7 +23890,7 @@ extern "C" decl_node decl_makeConst (nameKey_Name n) { decl_node d; - d = newNode (const_); + d = newNode (decl_const); d->constF.name = n; d->constF.type = NULL; d->constF.scope = decl_getDeclScope (); @@ -23874,7 +23920,7 @@ extern "C" decl_node decl_makeType (nameKey_Name n) { decl_node d; - d = newNode (type); + d = newNode (decl_type); d->typeF.name = n; d->typeF.type = NULL; d->typeF.scope = decl_getDeclScope (); @@ -23903,7 +23949,7 @@ extern "C" decl_node decl_makeTypeImp (nameKey_Name n) } else { - d = newNode (type); + d = newNode (decl_type); d->typeF.name = n; d->typeF.type = NULL; d->typeF.scope = decl_getDeclScope (); @@ -23923,7 +23969,7 @@ extern "C" decl_node decl_makeVar (nameKey_Name n) { decl_node d; - d = newNode (var); + d = newNode (decl_var); d->varF.name = n; d->varF.type = NULL; d->varF.decl = NULL; @@ -23964,7 +24010,7 @@ extern "C" decl_node decl_makeVarDecl (decl_node i, decl_node type) unsigned int n; type = checkPtr (type); - d = newNode (vardecl); + d = newNode (decl_vardecl); d->vardeclF.names = i->identlistF.names; d->vardeclF.type = type; d->vardeclF.scope = decl_getDeclScope (); @@ -24029,7 +24075,7 @@ extern "C" decl_node decl_makeSubrange (decl_node low, decl_node high) { decl_node n; - n = newNode (subrange); + n = newNode (decl_subrange); n->subrangeF.low = low; n->subrangeF.high = high; n->subrangeF.type = NULL; @@ -24059,7 +24105,7 @@ extern "C" decl_node decl_makePointer (decl_node type) { decl_node n; - n = newNode (pointer); + n = newNode (decl_pointer); n->pointerF.type = type; n->pointerF.scope = decl_getDeclScope (); return n; @@ -24076,7 +24122,7 @@ extern "C" decl_node decl_makeSet (decl_node type) { decl_node n; - n = newNode (set); + n = newNode (decl_set); n->setF.type = type; n->setF.scope = decl_getDeclScope (); return n; @@ -24096,7 +24142,7 @@ extern "C" decl_node decl_makeArray (decl_node subr, decl_node type) s = decl_skipType (subr); mcDebug_assert (((decl_isSubrange (s)) || (isOrdinal (s))) || (decl_isEnumeration (s))); - n = newNode (array); + n = newNode (decl_array); n->arrayF.subr = subr; n->arrayF.type = type; n->arrayF.scope = decl_getDeclScope (); @@ -24113,7 +24159,7 @@ extern "C" decl_node decl_makeArray (decl_node subr, decl_node type) extern "C" void decl_putUnbounded (decl_node n) { - mcDebug_assert (n->kind == array); + mcDebug_assert (n->kind == decl_array); n->arrayF.isUnbounded = TRUE; } @@ -24126,7 +24172,7 @@ extern "C" decl_node decl_makeRecord (void) { decl_node n; - n = newNode (record); + n = newNode (decl_record); n->recordF.localSymbols = symbolKey_initTree (); n->recordF.listOfSons = Indexing_InitIndex (1); n->recordF.scope = decl_getDeclScope (); @@ -24145,7 +24191,7 @@ extern "C" decl_node decl_makeVarient (decl_node r) { decl_node n; - n = newNode (varient); + n = newNode (decl_varient); n->varientF.listOfSons = Indexing_InitIndex (1); /* if so use this n^.varientF.parent := r */ if (decl_isRecord (r)) @@ -24160,12 +24206,12 @@ extern "C" decl_node decl_makeVarient (decl_node r) n->varientF.scope = decl_getDeclScope (); switch (r->kind) { - case record: + case decl_record: /* now add, n, to the record/varient, r, field list */ Indexing_IncludeIndiceIntoIndex (r->recordF.listOfSons, reinterpret_cast (n)); break; - case varientfield: + case decl_varientfield: Indexing_IncludeIndiceIntoIndex (r->varientfieldF.listOfSons, reinterpret_cast (n)); break; @@ -24290,345 +24336,345 @@ extern "C" nameKey_Name decl_getSymName (decl_node n) { switch (n->kind) { - case new_: + case decl_new: return nameKey_makeKey ((const char *) "NEW", 3); break; - case dispose: + case decl_dispose: return nameKey_makeKey ((const char *) "DISPOSE", 7); break; - case length: + case decl_length: return nameKey_makeKey ((const char *) "LENGTH", 6); break; - case inc: + case decl_inc: return nameKey_makeKey ((const char *) "INC", 3); break; - case dec: + case decl_dec: return nameKey_makeKey ((const char *) "DEC", 3); break; - case incl: + case decl_incl: return nameKey_makeKey ((const char *) "INCL", 4); break; - case excl: + case decl_excl: return nameKey_makeKey ((const char *) "EXCL", 4); break; - case nil: + case decl_nil: return nameKey_makeKey ((const char *) "NIL", 3); break; - case true_: + case decl_true: return nameKey_makeKey ((const char *) "TRUE", 4); break; - case false_: + case decl_false: return nameKey_makeKey ((const char *) "FALSE", 5); break; - case address: + case decl_address: return nameKey_makeKey ((const char *) "ADDRESS", 7); break; - case loc: + case decl_loc: return nameKey_makeKey ((const char *) "LOC", 3); break; - case byte: + case decl_byte: return nameKey_makeKey ((const char *) "BYTE", 4); break; - case word: + case decl_word: return nameKey_makeKey ((const char *) "WORD", 4); break; - case csizet: + case decl_csizet: return nameKey_makeKey ((const char *) "CSIZE_T", 7); break; - case cssizet: + case decl_cssizet: return nameKey_makeKey ((const char *) "CSSIZE_T", 8); break; - case boolean: + case decl_boolean: /* base types. */ return nameKey_makeKey ((const char *) "BOOLEAN", 7); break; - case proc: + case decl_proc: return nameKey_makeKey ((const char *) "PROC", 4); break; - case char_: + case decl_char: return nameKey_makeKey ((const char *) "CHAR", 4); break; - case cardinal: + case decl_cardinal: return nameKey_makeKey ((const char *) "CARDINAL", 8); break; - case longcard: + case decl_longcard: return nameKey_makeKey ((const char *) "LONGCARD", 8); break; - case shortcard: + case decl_shortcard: return nameKey_makeKey ((const char *) "SHORTCARD", 9); break; - case integer: + case decl_integer: return nameKey_makeKey ((const char *) "INTEGER", 7); break; - case longint: + case decl_longint: return nameKey_makeKey ((const char *) "LONGINT", 7); break; - case shortint: + case decl_shortint: return nameKey_makeKey ((const char *) "SHORTINT", 8); break; - case real: + case decl_real: return nameKey_makeKey ((const char *) "REAL", 4); break; - case longreal: + case decl_longreal: return nameKey_makeKey ((const char *) "LONGREAL", 8); break; - case shortreal: + case decl_shortreal: return nameKey_makeKey ((const char *) "SHORTREAL", 9); break; - case bitset: + case decl_bitset: return nameKey_makeKey ((const char *) "BITSET", 6); break; - case ztype: + case decl_ztype: return nameKey_makeKey ((const char *) "_ZTYPE", 6); break; - case rtype: + case decl_rtype: return nameKey_makeKey ((const char *) "_RTYPE", 6); break; - case complex_: + case decl_complex: return nameKey_makeKey ((const char *) "COMPLEX", 7); break; - case longcomplex: + case decl_longcomplex: return nameKey_makeKey ((const char *) "LONGCOMPLEX", 11); break; - case shortcomplex: + case decl_shortcomplex: return nameKey_makeKey ((const char *) "SHORTCOMPLEX", 12); break; - case type: + case decl_type: /* language features and compound type attributes. */ return n->typeF.name; break; - case record: + case decl_record: return nameKey_NulName; break; - case varient: + case decl_varient: return nameKey_NulName; break; - case var: + case decl_var: return n->varF.name; break; - case enumeration: + case decl_enumeration: return nameKey_NulName; break; - case subrange: + case decl_subrange: return nameKey_NulName; break; - case pointer: + case decl_pointer: return nameKey_NulName; break; - case array: + case decl_array: return nameKey_NulName; break; - case string: + case decl_string: return n->stringF.name; break; - case const_: + case decl_const: return n->constF.name; break; - case literal: + case decl_literal: return n->literalF.name; break; - case varparam: + case decl_varparam: return nameKey_NulName; break; - case param: + case decl_param: return nameKey_NulName; break; - case optarg_: + case decl_optarg: return nameKey_NulName; break; - case recordfield: + case decl_recordfield: return n->recordfieldF.name; break; - case varientfield: + case decl_varientfield: return n->varientfieldF.name; break; - case enumerationfield: + case decl_enumerationfield: return n->enumerationfieldF.name; break; - case set: + case decl_set: return nameKey_NulName; break; - case proctype: + case decl_proctype: return nameKey_NulName; break; - case subscript: + case decl_subscript: return nameKey_NulName; break; - case procedure: + case decl_procedure: /* blocks. */ return n->procedureF.name; break; - case def: + case decl_def: return n->defF.name; break; - case imp: + case decl_imp: return n->impF.name; break; - case module: + case decl_module: return n->moduleF.name; break; - case loop: - case while_: - case for_: - case repeat: - case if_: - case elsif: - case assignment: + case decl_loop: + case decl_while: + case decl_for: + case decl_repeat: + case decl_if: + case decl_elsif: + case decl_assignment: /* statements. */ return nameKey_NulName; break; - case constexp: - case deref: - case arrayref: - case componentref: - case cast: - case val: - case plus: - case sub: - case div_: - case mod: - case mult: - case divide: - case in: - case neg: - case equal: - case notequal: - case less: - case greater: - case greequal: - case lessequal: + case decl_constexp: + case decl_deref: + case decl_arrayref: + case decl_componentref: + case decl_cast: + case decl_val: + case decl_plus: + case decl_sub: + case decl_div: + case decl_mod: + case decl_mult: + case decl_divide: + case decl_in: + case decl_neg: + case decl_equal: + case decl_notequal: + case decl_less: + case decl_greater: + case decl_greequal: + case decl_lessequal: /* expressions. */ return nameKey_NulName; break; - case adr: + case decl_adr: return nameKey_makeKey ((const char *) "ADR", 3); break; - case size: + case decl_size: return nameKey_makeKey ((const char *) "SIZE", 4); break; - case tsize: + case decl_tsize: return nameKey_makeKey ((const char *) "TSIZE", 5); break; - case chr: + case decl_chr: return nameKey_makeKey ((const char *) "CHR", 3); break; - case abs_: + case decl_abs: return nameKey_makeKey ((const char *) "ABS", 3); break; - case ord: + case decl_ord: return nameKey_makeKey ((const char *) "ORD", 3); break; - case float_: + case decl_float: return nameKey_makeKey ((const char *) "FLOAT", 5); break; - case trunc_: + case decl_trunc: return nameKey_makeKey ((const char *) "TRUNC", 5); break; - case high: + case decl_high: return nameKey_makeKey ((const char *) "HIGH", 4); break; - case throw_: + case decl_throw: return nameKey_makeKey ((const char *) "THROW", 5); break; - case unreachable: + case decl_unreachable: return nameKey_makeKey ((const char *) "builtin_unreachable", 19); break; - case cmplx: + case decl_cmplx: return nameKey_makeKey ((const char *) "CMPLX", 5); break; - case re: + case decl_re: return nameKey_makeKey ((const char *) "RE", 2); break; - case im: + case decl_im: return nameKey_makeKey ((const char *) "IM", 2); break; - case max: + case decl_max: return nameKey_makeKey ((const char *) "MAX", 3); break; - case min: + case decl_min: return nameKey_makeKey ((const char *) "MIN", 3); break; - case funccall: + case decl_funccall: return nameKey_NulName; break; - case identlist: + case decl_identlist: return nameKey_NulName; break; @@ -24662,15 +24708,15 @@ extern "C" decl_node decl_import (decl_node m, decl_node n) { switch (m->kind) { - case def: + case decl_def: symbolKey_putSymKey (m->defF.decls.symbols, name, reinterpret_cast (n)); break; - case imp: + case decl_imp: symbolKey_putSymKey (m->impF.decls.symbols, name, reinterpret_cast (n)); break; - case module: + case decl_module: symbolKey_putSymKey (m->moduleF.decls.symbols, name, reinterpret_cast (n)); break; @@ -24791,15 +24837,15 @@ extern "C" void decl_setSource (decl_node n, nameKey_Name s) { switch (n->kind) { - case def: + case decl_def: n->defF.source = s; break; - case module: + case decl_module: n->moduleF.source = s; break; - case imp: + case decl_imp: n->impF.source = s; break; @@ -24819,15 +24865,15 @@ extern "C" nameKey_Name decl_getSource (decl_node n) { switch (n->kind) { - case def: + case decl_def: return n->defF.source; break; - case module: + case decl_module: return n->moduleF.source; break; - case imp: + case decl_imp: return n->impF.source; break; @@ -24941,7 +24987,7 @@ extern "C" decl_node decl_makeProcedure (nameKey_Name n) d = decl_lookupSym (n); if (d == NULL) { - d = newNode (procedure); + d = newNode (decl_procedure); d->procedureF.name = n; initDecls (&d->procedureF.decls); d->procedureF.scope = decl_getDeclScope (); @@ -25007,7 +25053,7 @@ extern "C" decl_node decl_makeProcType (void) { decl_node d; - d = newNode (proctype); + d = newNode (decl_proctype); d->proctypeF.scope = decl_getDeclScope (); d->proctypeF.parameters = Indexing_InitIndex (1); d->proctypeF.returnopt = FALSE; @@ -25065,7 +25111,7 @@ extern "C" decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_no decl_node d; mcDebug_assert ((l == NULL) || (isIdentList (l))); - d = newNode (varparam); + d = newNode (decl_varparam); d->varparamF.namelist = l; d->varparamF.type = type; d->varparamF.scope = proc; @@ -25087,7 +25133,7 @@ extern "C" decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl decl_node d; mcDebug_assert ((l == NULL) || (isIdentList (l))); - d = newNode (param); + d = newNode (decl_param); d->paramF.namelist = l; d->paramF.type = type; d->paramF.scope = proc; @@ -25134,7 +25180,7 @@ extern "C" decl_node decl_makeIdentList (void) { decl_node n; - n = newNode (identlist); + n = newNode (decl_identlist); n->identlistF.names = wlists_initList (); n->identlistF.cnamed = FALSE; return n; @@ -25221,7 +25267,7 @@ extern "C" decl_node decl_makeVarargs (void) { decl_node d; - d = newNode (varargs); + d = newNode (decl_varargs); d->varargsF.scope = NULL; return d; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -25235,7 +25281,7 @@ extern "C" decl_node decl_makeVarargs (void) extern "C" unsigned int decl_isVarargs (decl_node n) { - return n->kind == varargs; + return n->kind == decl_varargs; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25250,7 +25296,7 @@ extern "C" void decl_addParameter (decl_node proc, decl_node param) mcDebug_assert ((((decl_isVarargs (param)) || (decl_isParam (param))) || (decl_isVarParam (param))) || (decl_isOptarg (param))); switch (proc->kind) { - case procedure: + case decl_procedure: Indexing_IncludeIndiceIntoIndex (proc->procedureF.parameters, reinterpret_cast (param)); if (decl_isVarargs (param)) { @@ -25262,7 +25308,7 @@ extern "C" void decl_addParameter (decl_node proc, decl_node param) } break; - case proctype: + case decl_proctype: Indexing_IncludeIndiceIntoIndex (proc->proctypeF.parameters, reinterpret_cast (param)); if (decl_isVarargs (param)) { @@ -25291,77 +25337,77 @@ extern "C" decl_node decl_makeBinaryTok (mcReserved_toktype op, decl_node l, dec { if (op == mcReserved_equaltok) { - return makeBinary (equal, l, r, booleanN); + return makeBinary (decl_equal, l, r, booleanN); } else if ((op == mcReserved_hashtok) || (op == mcReserved_lessgreatertok)) { /* avoid dangling else. */ - return makeBinary (notequal, l, r, booleanN); + return makeBinary (decl_notequal, l, r, booleanN); } else if (op == mcReserved_lesstok) { /* avoid dangling else. */ - return makeBinary (less, l, r, booleanN); + return makeBinary (decl_less, l, r, booleanN); } else if (op == mcReserved_greatertok) { /* avoid dangling else. */ - return makeBinary (greater, l, r, booleanN); + return makeBinary (decl_greater, l, r, booleanN); } else if (op == mcReserved_greaterequaltok) { /* avoid dangling else. */ - return makeBinary (greequal, l, r, booleanN); + return makeBinary (decl_greequal, l, r, booleanN); } else if (op == mcReserved_lessequaltok) { /* avoid dangling else. */ - return makeBinary (lessequal, l, r, booleanN); + return makeBinary (decl_lessequal, l, r, booleanN); } else if (op == mcReserved_andtok) { /* avoid dangling else. */ - return makeBinary (and_, l, r, booleanN); + return makeBinary (decl_and, l, r, booleanN); } else if (op == mcReserved_ortok) { /* avoid dangling else. */ - return makeBinary (or_, l, r, booleanN); + return makeBinary (decl_or, l, r, booleanN); } else if (op == mcReserved_plustok) { /* avoid dangling else. */ - return makeBinary (plus, l, r, NULL); + return makeBinary (decl_plus, l, r, NULL); } else if (op == mcReserved_minustok) { /* avoid dangling else. */ - return makeBinary (sub, l, r, NULL); + return makeBinary (decl_sub, l, r, NULL); } else if (op == mcReserved_divtok) { /* avoid dangling else. */ - return makeBinary (div_, l, r, NULL); + return makeBinary (decl_div, l, r, NULL); } else if (op == mcReserved_timestok) { /* avoid dangling else. */ - return makeBinary (mult, l, r, NULL); + return makeBinary (decl_mult, l, r, NULL); } else if (op == mcReserved_modtok) { /* avoid dangling else. */ - return makeBinary (mod, l, r, NULL); + return makeBinary (decl_mod, l, r, NULL); } else if (op == mcReserved_intok) { /* avoid dangling else. */ - return makeBinary (in, l, r, NULL); + return makeBinary (decl_in, l, r, NULL); } else if (op == mcReserved_dividetok) { /* avoid dangling else. */ - return makeBinary (divide, l, r, NULL); + return makeBinary (decl_divide, l, r, NULL); } else { @@ -25383,17 +25429,17 @@ extern "C" decl_node decl_makeUnaryTok (mcReserved_toktype op, decl_node e) { if (op == mcReserved_nottok) { - return makeUnary (not_, e, booleanN); + return makeUnary (decl_not, e, booleanN); } else if (op == mcReserved_plustok) { /* avoid dangling else. */ - return makeUnary (plus, e, NULL); + return makeUnary (decl_plus, e, NULL); } else if (op == mcReserved_minustok) { /* avoid dangling else. */ - return makeUnary (neg, e, NULL); + return makeUnary (decl_neg, e, NULL); } else { @@ -25434,7 +25480,7 @@ extern "C" decl_node decl_makeComponentRef (decl_node rec, decl_node field) if (isDeref (rec)) { a = rec->unaryF.arg; - rec->kind = pointerref; + rec->kind = decl_pointerref; rec->pointerrefF.ptr = a; rec->pointerrefF.field = field; rec->pointerrefF.resultType = decl_getType (field); @@ -25458,7 +25504,7 @@ extern "C" decl_node decl_makePointerRef (decl_node ptr, decl_node field) { decl_node n; - n = newNode (pointerref); + n = newNode (decl_pointerref); n->pointerrefF.ptr = ptr; n->pointerrefF.field = field; n->pointerrefF.resultType = decl_getType (field); @@ -25475,7 +25521,7 @@ extern "C" decl_node decl_makePointerRef (decl_node ptr, decl_node field) extern "C" unsigned int decl_isPointerRef (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == pointerref; + return n->kind == decl_pointerref; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25491,7 +25537,7 @@ extern "C" decl_node decl_makeDeRef (decl_node n) t = decl_skipType (decl_getType (n)); mcDebug_assert (decl_isPointer (t)); - return makeUnary (deref, n, decl_getType (t)); + return makeUnary (decl_deref, n, decl_getType (t)); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25510,7 +25556,7 @@ extern "C" decl_node decl_makeArrayRef (decl_node array, decl_node index) unsigned int i; unsigned int j; - n = newNode (arrayref); + n = newNode (decl_arrayref); n->arrayrefF.array = array; n->arrayrefF.index = index; t = array; @@ -25568,7 +25614,7 @@ extern "C" decl_node decl_makeLiteralInt (nameKey_Name n) decl_node m; DynamicStrings_String s; - m = newNode (literal); + m = newNode (decl_literal); s = DynamicStrings_InitStringCharStar (nameKey_keyToCharStar (n)); m->literalF.name = n; if ((DynamicStrings_char (s, -1)) == 'C') @@ -25594,7 +25640,7 @@ extern "C" decl_node decl_makeLiteralReal (nameKey_Name n) { decl_node m; - m = newNode (literal); + m = newNode (decl_literal); m->literalF.name = n; m->literalF.type = rtypeN; return m; @@ -25611,7 +25657,7 @@ extern "C" decl_node decl_makeString (nameKey_Name n) { decl_node m; - m = newNode (string); + m = newNode (decl_string); m->stringF.name = n; m->stringF.length = nameKey_lengthKey (n); m->stringF.isCharCompatible = m->stringF.length <= 3; @@ -25639,7 +25685,7 @@ extern "C" decl_node decl_makeSetValue (void) { decl_node n; - n = newNode (setvalue); + n = newNode (decl_setvalue); n->setvalueF.type = bitsetN; n->setvalueF.values = Indexing_InitIndex (1); return n; @@ -25655,7 +25701,7 @@ extern "C" decl_node decl_makeSetValue (void) extern "C" unsigned int decl_isSetValue (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == setvalue; + return n->kind == decl_setvalue; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25736,7 +25782,7 @@ extern "C" decl_node decl_makeExpList (void) { decl_node n; - n = newNode (explist); + n = newNode (decl_explist); n->explistF.exp = Indexing_InitIndex (1); return n; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -25751,7 +25797,7 @@ extern "C" decl_node decl_makeExpList (void) extern "C" unsigned int decl_isExpList (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == explist; + return n->kind == decl_explist; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25825,15 +25871,15 @@ extern "C" void decl_setConstExpComplete (decl_node n) { switch (n->kind) { - case def: + case decl_def: n->defF.constsComplete = TRUE; break; - case imp: + case decl_imp: n->impF.constsComplete = TRUE; break; - case module: + case decl_module: n->moduleF.constsComplete = TRUE; break; @@ -25901,7 +25947,7 @@ extern "C" decl_node decl_makeFuncCall (decl_node c, decl_node n) checkCHeaders (c); if (f == NULL) { - f = newNode (funccall); + f = newNode (decl_funccall); f->funccallF.function = c; f->funccallF.args = n; f->funccallF.type = NULL; @@ -25921,7 +25967,7 @@ extern "C" decl_node decl_makeStatementSequence (void) { decl_node n; - n = newNode (stmtseq); + n = newNode (decl_stmtseq); n->stmtF.statements = Indexing_InitIndex (1); return n; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -25935,7 +25981,7 @@ extern "C" decl_node decl_makeStatementSequence (void) extern "C" unsigned int decl_isStatementSequence (decl_node n) { - return n->kind == stmtseq; + return n->kind == decl_stmtseq; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -25954,7 +26000,7 @@ extern "C" void decl_addStatement (decl_node s, decl_node n) if ((isIntrinsic (n)) && n->intrinsicF.postUnreachable) { n->intrinsicF.postUnreachable = FALSE; - decl_addStatement (s, makeIntrinsicProc (unreachable, 0, NULL)); + decl_addStatement (s, makeIntrinsicProc (decl_unreachable, 0, NULL)); } } } @@ -26051,7 +26097,7 @@ extern "C" decl_node decl_makeReturn (void) decl_node type; decl_node n; - n = newNode (return_); + n = newNode (decl_return); n->returnF.exp = NULL; if (decl_isProcedure (decl_getDeclScope ())) { @@ -26075,7 +26121,7 @@ extern "C" decl_node decl_makeReturn (void) extern "C" unsigned int decl_isReturn (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == return_; + return n->kind == decl_return; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26100,7 +26146,7 @@ extern "C" decl_node decl_makeWhile (void) { decl_node n; - n = newNode (while_); + n = newNode (decl_while); n->whileF.expr = NULL; n->whileF.statements = NULL; initPair (&n->whileF.doComment); @@ -26130,7 +26176,7 @@ extern "C" void decl_putWhile (decl_node n, decl_node e, decl_node s) extern "C" unsigned int decl_isWhile (decl_node n) { - return n->kind == while_; + return n->kind == decl_while; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26169,7 +26215,7 @@ extern "C" decl_node decl_makeAssignment (decl_node d, decl_node e) { decl_node n; - n = newNode (assignment); + n = newNode (decl_assignment); n->assignmentF.des = d; n->assignmentF.expr = e; initPair (&n->assignmentF.assignComment); @@ -26190,15 +26236,15 @@ extern "C" void decl_putBegin (decl_node b, decl_node s) mcDebug_assert (((decl_isImp (b)) || (decl_isProcedure (b))) || (decl_isModule (b))); switch (b->kind) { - case imp: + case decl_imp: b->impF.beginStatements = s; break; - case module: + case decl_module: b->moduleF.beginStatements = s; break; - case procedure: + case decl_procedure: b->procedureF.beginStatements = s; break; @@ -26221,11 +26267,11 @@ extern "C" void decl_putFinally (decl_node b, decl_node s) mcDebug_assert (((decl_isImp (b)) || (decl_isProcedure (b))) || (decl_isModule (b))); switch (b->kind) { - case imp: + case decl_imp: b->impF.finallyStatements = s; break; - case module: + case decl_module: b->moduleF.finallyStatements = s; break; @@ -26246,7 +26292,7 @@ extern "C" decl_node decl_makeExit (decl_node l, unsigned int n) decl_node e; mcDebug_assert (decl_isLoop (l)); - e = newNode (exit_); + e = newNode (decl_exit); e->exitF.loop = l; l->loopF.labelno = n; return e; @@ -26262,7 +26308,7 @@ extern "C" decl_node decl_makeExit (decl_node l, unsigned int n) extern "C" unsigned int decl_isExit (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == exit_; + return n->kind == decl_exit; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26276,7 +26322,7 @@ extern "C" decl_node decl_makeLoop (void) { decl_node l; - l = newNode (loop); + l = newNode (decl_loop); l->loopF.statements = NULL; l->loopF.labelno = 0; return l; @@ -26292,7 +26338,7 @@ extern "C" decl_node decl_makeLoop (void) extern "C" unsigned int decl_isLoop (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == loop; + return n->kind == decl_loop; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26346,7 +26392,7 @@ extern "C" decl_node decl_makeCommentS (mcComment_commentDesc c) } else { - n = newNode (comment); + n = newNode (decl_comment); n->commentF.content = c; return n; } @@ -26365,7 +26411,7 @@ extern "C" decl_node decl_makeIf (decl_node e, decl_node s) { decl_node n; - n = newNode (if_); + n = newNode (decl_if); n->ifF.expr = e; n->ifF.then = s; n->ifF.else_ = NULL; @@ -26385,7 +26431,7 @@ extern "C" decl_node decl_makeIf (decl_node e, decl_node s) extern "C" unsigned int decl_isIf (decl_node n) { - return n->kind == if_; + return n->kind == decl_if; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26401,7 +26447,7 @@ extern "C" decl_node decl_makeElsif (decl_node i, decl_node e, decl_node s) { decl_node n; - n = newNode (elsif); + n = newNode (decl_elsif); n->elsifF.expr = e; n->elsifF.then = s; n->elsifF.elsif = NULL; @@ -26430,7 +26476,7 @@ extern "C" decl_node decl_makeElsif (decl_node i, decl_node e, decl_node s) extern "C" unsigned int decl_isElsif (decl_node n) { - return n->kind == elsif; + return n->kind == decl_elsif; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26467,7 +26513,7 @@ extern "C" decl_node decl_makeFor (void) { decl_node n; - n = newNode (for_); + n = newNode (decl_for); n->forF.des = NULL; n->forF.start = NULL; n->forF.end = NULL; @@ -26486,7 +26532,7 @@ extern "C" decl_node decl_makeFor (void) extern "C" unsigned int decl_isFor (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == for_; + return n->kind == decl_for; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26520,7 +26566,7 @@ extern "C" decl_node decl_makeRepeat (void) { decl_node n; - n = newNode (repeat); + n = newNode (decl_repeat); n->repeatF.expr = NULL; n->repeatF.statements = NULL; initPair (&n->repeatF.repeatComment); @@ -26538,7 +26584,7 @@ extern "C" decl_node decl_makeRepeat (void) extern "C" unsigned int decl_isRepeat (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == repeat; + return n->kind == decl_repeat; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26588,7 +26634,7 @@ extern "C" decl_node decl_makeCase (void) { decl_node n; - n = newNode (case_); + n = newNode (decl_case); n->caseF.expression = NULL; n->caseF.caseLabelList = Indexing_InitIndex (1); n->caseF.else_ = NULL; @@ -26605,7 +26651,7 @@ extern "C" decl_node decl_makeCase (void) extern "C" unsigned int decl_isCase (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == case_; + return n->kind == decl_case; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26666,7 +26712,7 @@ extern "C" decl_node decl_makeCaseLabelList (decl_node l, decl_node s) { decl_node n; - n = newNode (caselabellist); + n = newNode (decl_caselabellist); n->caselabellistF.caseList = l; n->caselabellistF.statements = s; return n; @@ -26682,7 +26728,7 @@ extern "C" decl_node decl_makeCaseLabelList (decl_node l, decl_node s) extern "C" unsigned int decl_isCaseLabelList (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == caselabellist; + return n->kind == decl_caselabellist; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26696,7 +26742,7 @@ extern "C" decl_node decl_makeCaseList (void) { decl_node n; - n = newNode (caselist); + n = newNode (decl_caselist); n->caselistF.rangePairs = Indexing_InitIndex (1); return n; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -26711,7 +26757,7 @@ extern "C" decl_node decl_makeCaseList (void) extern "C" unsigned int decl_isCaseList (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == caselist; + return n->kind == decl_caselist; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26739,7 +26785,7 @@ extern "C" decl_node decl_makeRange (decl_node lo, decl_node hi) { decl_node n; - n = newNode (range); + n = newNode (decl_range); n->rangeF.lo = lo; n->rangeF.hi = hi; return n; @@ -26755,7 +26801,7 @@ extern "C" decl_node decl_makeRange (decl_node lo, decl_node hi) extern "C" unsigned int decl_isRange (decl_node n) { mcDebug_assert (n != NULL); - return n->kind == range; + return n->kind == decl_range; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -26805,7 +26851,7 @@ extern "C" decl_node decl_dupExpr (decl_node n) extern "C" void decl_setLangC (void) { - lang = ansiC; + lang = decl_ansiC; } @@ -26815,7 +26861,7 @@ extern "C" void decl_setLangC (void) extern "C" void decl_setLangCP (void) { - lang = ansiCP; + lang = decl_ansiCP; keyc_cp (); } @@ -26826,7 +26872,7 @@ extern "C" void decl_setLangCP (void) extern "C" void decl_setLangM2 (void) { - lang = pim4; + lang = decl_pim4; } @@ -26845,15 +26891,15 @@ extern "C" void decl_out (void) p = mcPretty_initPretty ((mcPretty_writeProc) {(mcPretty_writeProc_t) write_}, (mcPretty_writeLnProc) {(mcPretty_writeLnProc_t) writeln}); switch (lang) { - case ansiC: + case decl_ansiC: outC (p, decl_getMainModule ()); break; - case ansiCP: + case decl_ansiCP: outC (p, decl_getMainModule ()); break; - case pim4: + case decl_pim4: outM2 (p, decl_getMainModule ()); break; diff --git a/gcc/m2/mc-boot/Gkeyc.c b/gcc/m2/mc-boot/Gkeyc.c index b23089e1cac..a0a061aa17f 100644 --- a/gcc/m2/mc-boot/Gkeyc.c +++ b/gcc/m2/mc-boot/Gkeyc.c @@ -57,18 +57,18 @@ Boston, MA 02110-1301, USA. */ typedef void *decl_node; #endif -typedef struct _T1_r _T1; +typedef struct keyc__T1_r keyc__T1; -typedef _T1 *scope; +typedef keyc__T1 *keyc_scope; -struct _T1_r { - decl_node scoped; - symbolKey_symbolTree symbols; - scope next; - }; +struct keyc__T1_r { + decl_node scoped; + symbolKey_symbolTree symbols; + keyc_scope next; + }; -static scope stack; -static scope freeList; +static keyc_scope stack; +static keyc_scope freeList; static symbolKey_symbolTree keywords; static symbolKey_symbolTree macros; static unsigned int initializedCP; @@ -475,7 +475,7 @@ static void fixNullPointerConst (mcPretty_pretty p); new - */ -static scope new_ (decl_node n); +static keyc_scope new_ (decl_node n); /* mangle1 - returns TRUE if name is unique if we add _ @@ -840,13 +840,13 @@ static void fixNullPointerConst (mcPretty_pretty p) new - */ -static scope new_ (decl_node n) +static keyc_scope new_ (decl_node n) { - scope s; + keyc_scope s; if (freeList == NULL) { - Storage_ALLOCATE ((void **) &s, sizeof (_T1)); + Storage_ALLOCATE ((void **) &s, sizeof (keyc__T1)); } else { @@ -1471,7 +1471,7 @@ extern "C" void keyc_genConfigSystem (mcPretty_pretty p) extern "C" void keyc_enterScope (decl_node n) { - scope s; + keyc_scope s; s = new_ (n); s->scoped = n; @@ -1487,7 +1487,7 @@ extern "C" void keyc_enterScope (decl_node n) extern "C" void keyc_leaveScope (decl_node n) { - scope s; + keyc_scope s; if (n == stack->scoped) { diff --git a/gcc/m2/mc-boot/Glists.c b/gcc/m2/mc-boot/Glists.c index bba2ed4c401..c2abea56ebb 100644 --- a/gcc/m2/mc-boot/Glists.c +++ b/gcc/m2/mc-boot/Glists.c @@ -48,21 +48,21 @@ Boston, MA 02110-1301, USA. */ typedef struct symbolKey_performOperation_p symbolKey_performOperation; # define MaxnoOfelements 5 -typedef struct _T1_r _T1; +typedef struct lists__T1_r lists__T1; -typedef struct _T2_a _T2; +typedef struct lists__T2_a lists__T2; -typedef _T1 *lists_list; +typedef lists__T1 *lists_list; typedef void (*symbolKey_performOperation_t) (void *); struct symbolKey_performOperation_p { symbolKey_performOperation_t proc; }; -struct _T2_a { void * array[MaxnoOfelements-1+1]; }; -struct _T1_r { - unsigned int noOfelements; - _T2 elements; - lists_list next; - }; +struct lists__T2_a { void * array[MaxnoOfelements-1+1]; }; +struct lists__T1_r { + unsigned int noOfelements; + lists__T2 elements; + lists_list next; + }; /* @@ -157,7 +157,7 @@ static void removeItem (lists_list p, lists_list l, unsigned int i) if ((l->noOfelements == 0) && (p != NULL)) { p->next = l->next; - Storage_DEALLOCATE ((void **) &l, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &l, sizeof (lists__T1)); } } @@ -170,7 +170,7 @@ extern "C" lists_list lists_initList (void) { lists_list l; - Storage_ALLOCATE ((void **) &l, sizeof (_T1)); + Storage_ALLOCATE ((void **) &l, sizeof (lists__T1)); l->noOfelements = 0; l->next = NULL; return l; @@ -191,7 +191,7 @@ extern "C" void lists_killList (lists_list *l) { lists_killList (&(*l)->next); } - Storage_DEALLOCATE ((void **) &(*l), sizeof (_T1)); + Storage_DEALLOCATE ((void **) &(*l), sizeof (lists__T1)); } } diff --git a/gcc/m2/mc-boot/GmcComment.c b/gcc/m2/mc-boot/GmcComment.c index 6d369e1d982..d9e65b155f1 100644 --- a/gcc/m2/mc-boot/GmcComment.c +++ b/gcc/m2/mc-boot/GmcComment.c @@ -52,18 +52,18 @@ along with GNU Modula-2; see the file COPYING3. If not see # include "GASCII.h" # include "Glibc.h" -typedef struct _T1_r _T1; +typedef struct mcComment__T1_r mcComment__T1; -typedef enum {unknown, procedureHeading, inBody, afterStatement} commentType; +typedef enum {mcComment_unknown, mcComment_procedureHeading, mcComment_inBody, mcComment_afterStatement} mcComment_commentType; -typedef _T1 *mcComment_commentDesc; +typedef mcComment__T1 *mcComment_commentDesc; -struct _T1_r { - commentType type; - DynamicStrings_String content; - nameKey_Name procName; - unsigned int used; - }; +struct mcComment__T1_r { + mcComment_commentType type; + DynamicStrings_String content; + nameKey_Name procName; + unsigned int used; + }; /* @@ -239,19 +239,19 @@ static void dumpComment (mcComment_commentDesc cd) libc_printf ((const char *) "comment : ", 10); switch (cd->type) { - case unknown: + case mcComment_unknown: libc_printf ((const char *) "unknown", 7); break; - case procedureHeading: + case mcComment_procedureHeading: libc_printf ((const char *) "procedureheading", 16); break; - case inBody: + case mcComment_inBody: libc_printf ((const char *) "inbody", 6); break; - case afterStatement: + case mcComment_afterStatement: libc_printf ((const char *) "afterstatement", 14); break; @@ -283,15 +283,15 @@ extern "C" mcComment_commentDesc mcComment_initComment (unsigned int onlySpaces) { mcComment_commentDesc cd; - Storage_ALLOCATE ((void **) &cd, sizeof (_T1)); + Storage_ALLOCATE ((void **) &cd, sizeof (mcComment__T1)); mcDebug_assert (cd != NULL); if (onlySpaces) { - cd->type = inBody; + cd->type = mcComment_inBody; } else { - cd->type = afterStatement; + cd->type = mcComment_afterStatement; } cd->content = DynamicStrings_InitString ((const char *) "", 0); cd->procName = nameKey_NulName; @@ -366,7 +366,7 @@ extern "C" void mcComment_setProcedureComment (mcComment_commentDesc cd, nameKey { if (seenProcedure (cd, procname)) { - cd->type = procedureHeading; + cd->type = mcComment_procedureHeading; cd->procName = procname; } } @@ -379,7 +379,7 @@ extern "C" void mcComment_setProcedureComment (mcComment_commentDesc cd, nameKey extern "C" DynamicStrings_String mcComment_getProcedureComment (mcComment_commentDesc cd) { - if ((cd->type == procedureHeading) && ! cd->used) + if ((cd->type == mcComment_procedureHeading) && ! cd->used) { cd->used = TRUE; return cd->content; @@ -396,7 +396,7 @@ extern "C" DynamicStrings_String mcComment_getProcedureComment (mcComment_commen extern "C" DynamicStrings_String mcComment_getAfterStatementComment (mcComment_commentDesc cd) { - if ((cd->type == afterStatement) && ! cd->used) + if ((cd->type == mcComment_afterStatement) && ! cd->used) { cd->used = TRUE; return cd->content; @@ -413,7 +413,7 @@ extern "C" DynamicStrings_String mcComment_getAfterStatementComment (mcComment_c extern "C" DynamicStrings_String mcComment_getInbodyStatementComment (mcComment_commentDesc cd) { - if ((cd->type == inBody) && ! cd->used) + if ((cd->type == mcComment_inBody) && ! cd->used) { cd->used = TRUE; return cd->content; @@ -430,7 +430,7 @@ extern "C" DynamicStrings_String mcComment_getInbodyStatementComment (mcComment_ extern "C" unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd) { - return (cd != NULL) && (cd->type == procedureHeading); + return (cd != NULL) && (cd->type == mcComment_procedureHeading); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -442,7 +442,7 @@ extern "C" unsigned int mcComment_isProcedureComment (mcComment_commentDesc cd) extern "C" unsigned int mcComment_isBodyComment (mcComment_commentDesc cd) { - return (cd != NULL) && (cd->type == inBody); + return (cd != NULL) && (cd->type == mcComment_inBody); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -454,7 +454,7 @@ extern "C" unsigned int mcComment_isBodyComment (mcComment_commentDesc cd) extern "C" unsigned int mcComment_isAfterComment (mcComment_commentDesc cd) { - return (cd != NULL) && (cd->type == afterStatement); + return (cd != NULL) && (cd->type == mcComment_afterStatement); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } diff --git a/gcc/m2/mc-boot/GmcComp.c b/gcc/m2/mc-boot/GmcComp.c index c9d378ae2fc..246b75a615b 100644 --- a/gcc/m2/mc-boot/GmcComp.c +++ b/gcc/m2/mc-boot/GmcComp.c @@ -66,15 +66,15 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ # include "GmcOptions.h" # define Debugging FALSE -typedef struct parserFunction_p parserFunction; +typedef struct mcComp_parserFunction_p mcComp_parserFunction; -typedef struct openFunction_p openFunction; +typedef struct mcComp_openFunction_p mcComp_openFunction; -typedef unsigned int (*parserFunction_t) (void); -struct parserFunction_p { parserFunction_t proc; }; +typedef unsigned int (*mcComp_parserFunction_t) (void); +struct mcComp_parserFunction_p { mcComp_parserFunction_t proc; }; -typedef unsigned int (*openFunction_t) (decl_node, unsigned int); -struct openFunction_p { openFunction_t proc; }; +typedef unsigned int (*mcComp_openFunction_t) (decl_node, unsigned int); +struct mcComp_openFunction_p { mcComp_openFunction_t proc; }; static unsigned int currentPass; @@ -171,7 +171,7 @@ static unsigned int openMod (decl_node n, unsigned int exitOnFailure); pass - */ -static void pass (unsigned int no, decl_node n, parserFunction f, decl_isNodeF isnode, openFunction open); +static void pass (unsigned int no, decl_node n, mcComp_parserFunction f, decl_isNodeF isnode, mcComp_openFunction open); /* doPass - @@ -351,15 +351,15 @@ static void p1 (decl_node n) if (decl_isDef (n)) { /* avoid dangling else. */ - pass (1, n, (parserFunction) {(parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (openFunction) {(openFunction_t) openDef}); + pass (1, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (mcComp_openFunction) {(mcComp_openFunction_t) openDef}); if ((decl_hasHidden (n)) && (mcOptions_getExtendedOpaque ())) { - pass (1, decl_lookupImp (decl_getSymName (n)), (parserFunction) {(parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (openFunction) {(openFunction_t) openMod}); + pass (1, decl_lookupImp (decl_getSymName (n)), (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } else { - pass (1, n, (parserFunction) {(parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (openFunction) {(openFunction_t) openMod}); + pass (1, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp1_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } @@ -373,15 +373,15 @@ static void p2 (decl_node n) if (decl_isDef (n)) { /* avoid dangling else. */ - pass (2, n, (parserFunction) {(parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (openFunction) {(openFunction_t) openDef}); + pass (2, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (mcComp_openFunction) {(mcComp_openFunction_t) openDef}); if ((decl_hasHidden (n)) && (mcOptions_getExtendedOpaque ())) { - pass (2, decl_lookupImp (decl_getSymName (n)), (parserFunction) {(parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (openFunction) {(openFunction_t) openMod}); + pass (2, decl_lookupImp (decl_getSymName (n)), (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } else { - pass (2, n, (parserFunction) {(parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (openFunction) {(openFunction_t) openMod}); + pass (2, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp2_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } @@ -395,15 +395,15 @@ static void p3 (decl_node n) if (decl_isDef (n)) { /* avoid dangling else. */ - pass (3, n, (parserFunction) {(parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (openFunction) {(openFunction_t) openDef}); + pass (3, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (mcComp_openFunction) {(mcComp_openFunction_t) openDef}); if ((decl_hasHidden (n)) && (mcOptions_getExtendedOpaque ())) { - pass (3, decl_lookupImp (decl_getSymName (n)), (parserFunction) {(parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (openFunction) {(openFunction_t) openMod}); + pass (3, decl_lookupImp (decl_getSymName (n)), (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } else { - pass (3, n, (parserFunction) {(parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (openFunction) {(openFunction_t) openMod}); + pass (3, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp3_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } @@ -417,15 +417,15 @@ static void p4 (decl_node n) if (decl_isDef (n)) { /* avoid dangling else. */ - pass (4, n, (parserFunction) {(parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (openFunction) {(openFunction_t) openDef}); + pass (4, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isDef}, (mcComp_openFunction) {(mcComp_openFunction_t) openDef}); if ((decl_hasHidden (n)) && (mcOptions_getExtendedOpaque ())) { - pass (4, decl_lookupImp (decl_getSymName (n)), (parserFunction) {(parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (openFunction) {(openFunction_t) openMod}); + pass (4, decl_lookupImp (decl_getSymName (n)), (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImp}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } else { - pass (4, n, (parserFunction) {(parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (openFunction) {(openFunction_t) openMod}); + pass (4, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp4_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } } @@ -436,7 +436,7 @@ static void p4 (decl_node n) static void p5 (decl_node n) { - pass (5, n, (parserFunction) {(parserFunction_t) mcp5_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (openFunction) {(openFunction_t) openMod}); + pass (5, n, (mcComp_parserFunction) {(mcComp_parserFunction_t) mcp5_CompilationUnit}, (decl_isNodeF) {(decl_isNodeF_t) decl_isImpOrModule}, (mcComp_openFunction) {(mcComp_openFunction_t) openMod}); } @@ -550,7 +550,7 @@ static unsigned int openMod (decl_node n, unsigned int exitOnFailure) pass - */ -static void pass (unsigned int no, decl_node n, parserFunction f, decl_isNodeF isnode, openFunction open) +static void pass (unsigned int no, decl_node n, mcComp_parserFunction f, decl_isNodeF isnode, mcComp_openFunction open) { if (((*isnode.proc) (n)) && (! (decl_isVisited (n)))) { diff --git a/gcc/m2/mc-boot/GmcError.c b/gcc/m2/mc-boot/GmcError.c index 68706db5768..39f4640b70a 100644 --- a/gcc/m2/mc-boot/GmcError.c +++ b/gcc/m2/mc-boot/GmcError.c @@ -60,18 +60,18 @@ along with GNU Modula-2; see the file COPYING3. If not see # define Debugging TRUE # define DebugTrace FALSE # define Xcode TRUE -typedef struct _T2_r _T2; +typedef struct mcError__T2_r mcError__T2; -typedef _T2 *mcError_error; +typedef mcError__T2 *mcError_error; -struct _T2_r { - mcError_error parent; - mcError_error child; - mcError_error next; - unsigned int fatal; - DynamicStrings_String s; - unsigned int token; - }; +struct mcError__T2_r { + mcError_error parent; + mcError_error child; + mcError_error next; + unsigned int fatal; + DynamicStrings_String s; + unsigned int token; + }; static mcError_error head; static unsigned int inInternal; @@ -350,11 +350,11 @@ static unsigned int translateNameToCharStar (char *a, unsigned int _a_high, unsi static void outString (DynamicStrings_String file, unsigned int line, unsigned int col, DynamicStrings_String s) { - typedef char *_T1; + typedef char *outString__T1; DynamicStrings_String leader; - _T1 p; - _T1 q; + outString__T1 p; + outString__T1 q; unsigned int space; unsigned int newline; @@ -367,14 +367,14 @@ static void outString (DynamicStrings_String file, unsigned int line, unsigned i { leader = FormatStrings_Sprintf3 (DynamicStrings_Mark (DynamicStrings_InitString ((const char *) "%s:%d:%d:", 9)), (const unsigned char *) &file, (sizeof (file)-1), (const unsigned char *) &line, (sizeof (line)-1), (const unsigned char *) &col, (sizeof (col)-1)); } - p = static_cast<_T1> (DynamicStrings_string (s)); + p = static_cast (DynamicStrings_string (s)); newline = TRUE; space = FALSE; while ((p != NULL) && ((*p) != ASCII_nul)) { if (newline) { - q = static_cast<_T1> (DynamicStrings_string (leader)); + q = static_cast (DynamicStrings_string (leader)); while ((q != NULL) && ((*q) != ASCII_nul)) { StdIO_Write ((*q)); @@ -686,7 +686,7 @@ static unsigned int flushAll (mcError_error e, unsigned int FatalStatus) if (! Debugging) { f->s = DynamicStrings_KillString (f->s); - Storage_DEALLOCATE ((void **) &f, sizeof (_T2)); + Storage_DEALLOCATE ((void **) &f, sizeof (mcError__T2)); } } while (! (e == NULL)); } @@ -822,7 +822,7 @@ extern "C" mcError_error mcError_newError (unsigned int atTokenNo) mcError_error e; mcError_error f; - Storage_ALLOCATE ((void **) &e, sizeof (_T2)); + Storage_ALLOCATE ((void **) &e, sizeof (mcError__T2)); e->s = static_cast (NULL); e->token = atTokenNo; e->next = NULL; @@ -883,7 +883,7 @@ extern "C" mcError_error mcError_chainError (unsigned int atTokenNo, mcError_err } else { - Storage_ALLOCATE ((void **) &f, sizeof (_T2)); + Storage_ALLOCATE ((void **) &f, sizeof (mcError__T2)); f->s = static_cast (NULL); f->token = atTokenNo; f->next = e->child; diff --git a/gcc/m2/mc-boot/GmcLexBuf.c b/gcc/m2/mc-boot/GmcLexBuf.c index 651a91d6fd3..e2e3eae50ae 100644 --- a/gcc/m2/mc-boot/GmcLexBuf.c +++ b/gcc/m2/mc-boot/GmcLexBuf.c @@ -65,58 +65,58 @@ void * mcLexBuf_currentstring; mcReserved_toktype mcLexBuf_currenttoken; # define MaxBucketSize 100 # define Debugging FALSE -typedef struct tokenDesc_r tokenDesc; +typedef struct mcLexBuf_tokenDesc_r mcLexBuf_tokenDesc; -typedef struct listDesc_r listDesc; +typedef struct mcLexBuf_listDesc_r mcLexBuf_listDesc; -typedef struct _T1_r _T1; +typedef struct mcLexBuf__T1_r mcLexBuf__T1; -typedef _T1 *sourceList; +typedef mcLexBuf__T1 *mcLexBuf_sourceList; -typedef struct _T2_r _T2; +typedef struct mcLexBuf__T2_r mcLexBuf__T2; -typedef _T2 *tokenBucket; +typedef mcLexBuf__T2 *mcLexBuf_tokenBucket; -typedef struct _T3_a _T3; +typedef struct mcLexBuf__T3_a mcLexBuf__T3; -struct tokenDesc_r { - mcReserved_toktype token; - nameKey_Name str; - int int_; - mcComment_commentDesc com; - unsigned int line; - unsigned int col; - sourceList file; - }; +struct mcLexBuf_tokenDesc_r { + mcReserved_toktype token; + nameKey_Name str; + int int_; + mcComment_commentDesc com; + unsigned int line; + unsigned int col; + mcLexBuf_sourceList file; + }; -struct listDesc_r { - tokenBucket head; - tokenBucket tail; - unsigned int lastBucketOffset; - }; +struct mcLexBuf_listDesc_r { + mcLexBuf_tokenBucket head; + mcLexBuf_tokenBucket tail; + unsigned int lastBucketOffset; + }; -struct _T1_r { - sourceList left; - sourceList right; - DynamicStrings_String name; - unsigned int line; - unsigned int col; - }; +struct mcLexBuf__T1_r { + mcLexBuf_sourceList left; + mcLexBuf_sourceList right; + DynamicStrings_String name; + unsigned int line; + unsigned int col; + }; -struct _T3_a { tokenDesc array[MaxBucketSize+1]; }; -struct _T2_r { - _T3 buf; - unsigned int len; - tokenBucket next; - }; +struct mcLexBuf__T3_a { mcLexBuf_tokenDesc array[MaxBucketSize+1]; }; +struct mcLexBuf__T2_r { + mcLexBuf__T3 buf; + unsigned int len; + mcLexBuf_tokenBucket next; + }; static mcComment_commentDesc procedureComment; static mcComment_commentDesc bodyComment; static mcComment_commentDesc afterComment; -static sourceList currentSource; +static mcLexBuf_sourceList currentSource; static unsigned int useBufferedTokens; static unsigned int currentUsed; -static listDesc listOfTokens; +static mcLexBuf_listDesc listOfTokens; static unsigned int nextTokNo; /* @@ -310,7 +310,7 @@ static void seekTo (unsigned int t); peeptokenBucket - */ -static tokenBucket peeptokenBucket (unsigned int *t); +static mcLexBuf_tokenBucket peeptokenBucket (unsigned int *t); /* peepAfterComment - peeps ahead looking for an after statement comment. It stops at an END token @@ -329,25 +329,25 @@ static void init (void); addTo - adds a new element to the end of sourceList, currentSource. */ -static void addTo (sourceList l); +static void addTo (mcLexBuf_sourceList l); /* subFrom - subtracts, l, from the source list. */ -static void subFrom (sourceList l); +static void subFrom (mcLexBuf_sourceList l); /* newElement - returns a new sourceList */ -static sourceList newElement (void * s); +static mcLexBuf_sourceList newElement (void * s); /* newList - initializes an empty list with the classic dummy header element. */ -static sourceList newList (void); +static mcLexBuf_sourceList newList (void); /* checkIfNeedToDuplicate - checks to see whether the currentSource has @@ -374,7 +374,7 @@ static void displayToken (mcReserved_toktype t); from tokenBucket, b, and, offset. */ -static void updateFromBucket (tokenBucket b, unsigned int offset); +static void updateFromBucket (mcLexBuf_tokenBucket b, unsigned int offset); /* doGetToken - fetch the next token into currenttoken. @@ -393,7 +393,7 @@ static void syncOpenWithBuffer (void); findtokenBucket - returns the tokenBucket corresponding to the tokenNo. */ -static tokenBucket findtokenBucket (unsigned int *tokenNo); +static mcLexBuf_tokenBucket findtokenBucket (unsigned int *tokenNo); /* getFileName - returns a String defining the current file. @@ -405,7 +405,7 @@ static void stop (void); addTokToList - adds a token to a dynamic list. */ -static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, sourceList f); +static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, mcLexBuf_sourceList f); /* isLastTokenEof - returns TRUE if the last token was an eoftok @@ -424,7 +424,7 @@ static void debugLex (unsigned int n) unsigned int i; unsigned int o; unsigned int t; - tokenBucket b; + mcLexBuf_tokenBucket b; if (nextTokNo > n) { @@ -465,7 +465,7 @@ static void debugLex (unsigned int n) static void seekTo (unsigned int t) { - tokenBucket b; + mcLexBuf_tokenBucket b; nextTokNo = t; if (t > 0) @@ -484,13 +484,13 @@ static void seekTo (unsigned int t) peeptokenBucket - */ -static tokenBucket peeptokenBucket (unsigned int *t) +static mcLexBuf_tokenBucket peeptokenBucket (unsigned int *t) { mcReserved_toktype ct; unsigned int old; unsigned int n; - tokenBucket b; - tokenBucket c; + mcLexBuf_tokenBucket b; + mcLexBuf_tokenBucket c; ct = mcLexBuf_currenttoken; if (Debugging) @@ -555,7 +555,7 @@ static void peepAfterComment (void) unsigned int cno; unsigned int nextline; unsigned int curline; - tokenBucket b; + mcLexBuf_tokenBucket b; unsigned int finished; oldTokNo = nextTokNo; @@ -629,7 +629,7 @@ static void init (void) addTo - adds a new element to the end of sourceList, currentSource. */ -static void addTo (sourceList l) +static void addTo (mcLexBuf_sourceList l) { l->right = currentSource; l->left = currentSource->left; @@ -644,7 +644,7 @@ static void addTo (sourceList l) subFrom - subtracts, l, from the source list. */ -static void subFrom (sourceList l) +static void subFrom (mcLexBuf_sourceList l) { l->left->right = l->right; l->right->left = l->left; @@ -655,11 +655,11 @@ static void subFrom (sourceList l) newElement - returns a new sourceList */ -static sourceList newElement (void * s) +static mcLexBuf_sourceList newElement (void * s) { - sourceList l; + mcLexBuf_sourceList l; - Storage_ALLOCATE ((void **) &l, sizeof (_T1)); + Storage_ALLOCATE ((void **) &l, sizeof (mcLexBuf__T1)); if (l == NULL) { M2RTS_HALT (-1); @@ -681,11 +681,11 @@ static sourceList newElement (void * s) newList - initializes an empty list with the classic dummy header element. */ -static sourceList newList (void) +static mcLexBuf_sourceList newList (void) { - sourceList l; + mcLexBuf_sourceList l; - Storage_ALLOCATE ((void **) &l, sizeof (_T1)); + Storage_ALLOCATE ((void **) &l, sizeof (mcLexBuf__T1)); l->left = l; l->right = l; l->name = static_cast (NULL); @@ -702,8 +702,8 @@ static sourceList newList (void) static void checkIfNeedToDuplicate (void) { - sourceList l; - sourceList h; + mcLexBuf_sourceList l; + mcLexBuf_sourceList h; if (currentUsed) { @@ -725,8 +725,8 @@ static void checkIfNeedToDuplicate (void) static void killList (void) { - sourceList l; - sourceList k; + mcLexBuf_sourceList l; + mcLexBuf_sourceList k; if (! currentUsed && (currentSource != NULL)) { @@ -734,7 +734,7 @@ static void killList (void) do { k = l; l = l->right; - Storage_DEALLOCATE ((void **) &k, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &k, sizeof (mcLexBuf__T1)); } while (! (l == currentSource)); } } @@ -1086,7 +1086,7 @@ static void displayToken (mcReserved_toktype t) from tokenBucket, b, and, offset. */ -static void updateFromBucket (tokenBucket b, unsigned int offset) +static void updateFromBucket (mcLexBuf_tokenBucket b, unsigned int offset) { mcLexBuf_currenttoken = b->buf.array[offset].token; mcLexBuf_currentstring = nameKey_keyToCharStar (b->buf.array[offset].str); @@ -1112,7 +1112,7 @@ static void doGetToken (void) { void * a; unsigned int t; - tokenBucket b; + mcLexBuf_tokenBucket b; if (useBufferedTokens) { @@ -1191,9 +1191,9 @@ static void syncOpenWithBuffer (void) findtokenBucket - returns the tokenBucket corresponding to the tokenNo. */ -static tokenBucket findtokenBucket (unsigned int *tokenNo) +static mcLexBuf_tokenBucket findtokenBucket (unsigned int *tokenNo) { - tokenBucket b; + mcLexBuf_tokenBucket b; b = listOfTokens.head; while (b != NULL) @@ -1227,13 +1227,13 @@ static void stop (void) addTokToList - adds a token to a dynamic list. */ -static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, sourceList f) +static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment_commentDesc comment, unsigned int l, unsigned int c, mcLexBuf_sourceList f) { - tokenBucket b; + mcLexBuf_tokenBucket b; if (listOfTokens.head == NULL) { - Storage_ALLOCATE ((void **) &listOfTokens.head, sizeof (_T2)); + Storage_ALLOCATE ((void **) &listOfTokens.head, sizeof (mcLexBuf__T2)); if (listOfTokens.head == NULL) {} /* empty. */ /* list error */ @@ -1244,7 +1244,7 @@ static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment { /* avoid dangling else. */ mcDebug_assert (listOfTokens.tail->next == NULL); - Storage_ALLOCATE ((void **) &listOfTokens.tail->next, sizeof (_T2)); + Storage_ALLOCATE ((void **) &listOfTokens.tail->next, sizeof (mcLexBuf__T2)); if (listOfTokens.tail->next == NULL) {} /* empty. */ else @@ -1275,7 +1275,7 @@ static void addTokToList (mcReserved_toktype t, nameKey_Name n, int i, mcComment static unsigned int isLastTokenEof (void) { unsigned int t; - tokenBucket b; + mcLexBuf_tokenBucket b; if (listOfTokens.tail != NULL) { @@ -1408,8 +1408,8 @@ extern "C" void mcLexBuf_closeSource (void) extern "C" void mcLexBuf_reInitialize (void) { - tokenBucket s; - tokenBucket t; + mcLexBuf_tokenBucket s; + mcLexBuf_tokenBucket t; if (listOfTokens.head != NULL) { @@ -1417,7 +1417,7 @@ extern "C" void mcLexBuf_reInitialize (void) do { s = t; t = t->next; - Storage_DEALLOCATE ((void **) &s, sizeof (_T2)); + Storage_DEALLOCATE ((void **) &s, sizeof (mcLexBuf__T2)); } while (! (t == NULL)); currentUsed = FALSE; killList (); @@ -1572,8 +1572,8 @@ extern "C" unsigned int mcLexBuf_getTokenNo (void) extern "C" unsigned int mcLexBuf_tokenToLineNo (unsigned int tokenNo, unsigned int depth) { - tokenBucket b; - sourceList l; + mcLexBuf_tokenBucket b; + mcLexBuf_sourceList l; b = findtokenBucket (&tokenNo); if (b == NULL) @@ -1636,8 +1636,8 @@ extern "C" unsigned int mcLexBuf_getColumnNo (void) extern "C" unsigned int mcLexBuf_tokenToColumnNo (unsigned int tokenNo, unsigned int depth) { - tokenBucket b; - sourceList l; + mcLexBuf_tokenBucket b; + mcLexBuf_sourceList l; b = findtokenBucket (&tokenNo); if (b == NULL) @@ -1680,8 +1680,8 @@ extern "C" unsigned int mcLexBuf_tokenToColumnNo (unsigned int tokenNo, unsigned extern "C" DynamicStrings_String mcLexBuf_findFileNameFromToken (unsigned int tokenNo, unsigned int depth) { - tokenBucket b; - sourceList l; + mcLexBuf_tokenBucket b; + mcLexBuf_sourceList l; b = findtokenBucket (&tokenNo); if (b == NULL) @@ -1798,7 +1798,7 @@ extern "C" void mcLexBuf_setFile (void * filename) extern "C" void mcLexBuf_pushFile (void * filename) { - sourceList l; + mcLexBuf_sourceList l; checkIfNeedToDuplicate (); addTo (newElement (filename)); @@ -1823,7 +1823,7 @@ extern "C" void mcLexBuf_pushFile (void * filename) extern "C" void mcLexBuf_popFile (void * filename) { - sourceList l; + mcLexBuf_sourceList l; checkIfNeedToDuplicate (); if ((currentSource != NULL) && (currentSource->left != currentSource)) @@ -1831,7 +1831,7 @@ extern "C" void mcLexBuf_popFile (void * filename) /* avoid dangling else. */ l = currentSource->left; /* last element */ subFrom (l); /* last element */ - Storage_DEALLOCATE ((void **) &l, sizeof (_T1)); + Storage_DEALLOCATE ((void **) &l, sizeof (mcLexBuf__T1)); if ((currentSource->left != currentSource) && (! (DynamicStrings_Equal (currentSource->name, DynamicStrings_Mark (DynamicStrings_InitStringCharStar (filename)))))) {} /* empty. */ /* mismatch in source file names after preprocessing files */ diff --git a/gcc/m2/mc-boot/GmcMetaError.c b/gcc/m2/mc-boot/GmcMetaError.c index 6e43c8f2a41..0c4aaf90a53 100644 --- a/gcc/m2/mc-boot/GmcMetaError.c +++ b/gcc/m2/mc-boot/GmcMetaError.c @@ -49,7 +49,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ # include "GDynamicStrings.h" # include "Gdecl.h" -typedef enum {newerror, newwarning, chained} errorType; +typedef enum {mcMetaError_newerror, mcMetaError_newwarning, mcMetaError_chained} mcMetaError_errorType; /* @@ -218,7 +218,7 @@ static unsigned int isWhite (char ch); then := [ ':' ebnf ] =: */ -static void then (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive); +static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive); /* doNumber - @@ -276,25 +276,25 @@ static DynamicStrings_String doKey (unsigned int bol, varargs_vararg sym, Dynami doError - creates and returns an error note. */ -static mcError_error doError (mcError_error e, errorType t, unsigned int tok); +static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned int tok); /* doDeclaredDef - creates an error note where sym[bol] was declared. */ -static mcError_error doDeclaredDef (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym); +static mcError_error doDeclaredDef (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym); /* doDeclaredMod - creates an error note where sym[bol] was declared. */ -static mcError_error doDeclaredMod (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym); +static mcError_error doDeclaredMod (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym); /* doUsed - creates an error note where sym[bol] was first used. */ -static mcError_error doUsed (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym); +static mcError_error doUsed (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym); /* ConCatWord - joins sentances, a, b, together. @@ -324,7 +324,7 @@ static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_ op := {'a'|'q'|'t'|'d'|'k'|'n'|'s'|'D'|'I'|'U'|'E'|'W'} then =: */ -static void op (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive); +static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive); /* percenttoken := '%' ( @@ -340,7 +340,7 @@ static void op (mcError_error *e, errorType *t, DynamicStrings_String *r, Dynami } =: */ -static void percenttoken (mcError_error *e, errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive); +static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive); /* percent := '%' anych % copy anych % @@ -353,7 +353,7 @@ static void percent (DynamicStrings_String *r, DynamicStrings_String s, varargs_ lbra := '{' [ '!' ] percenttoken '}' =: */ -static void lbra (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l); +static void lbra (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l); /* lbra := '{' [ '!' ] percenttoken '}' =: @@ -369,13 +369,13 @@ static void stop (void); =: */ -static void ebnf (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l); +static void ebnf (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l); /* doFormat - */ -static DynamicStrings_String doFormat (mcError_error *e, errorType *t, DynamicStrings_String s, varargs_vararg sym); +static DynamicStrings_String doFormat (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String s, varargs_vararg sym); /* wrapErrors - @@ -444,7 +444,7 @@ static unsigned int isWhite (char ch) then := [ ':' ebnf ] =: */ -static void then (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive) +static void then (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, DynamicStrings_String o, unsigned int positive) { if ((DynamicStrings_char (s, (*i))) == ':') { @@ -727,11 +727,11 @@ static DynamicStrings_String doKey (unsigned int bol, varargs_vararg sym, Dynami doError - creates and returns an error note. */ -static mcError_error doError (mcError_error e, errorType t, unsigned int tok) +static mcError_error doError (mcError_error e, mcMetaError_errorType t, unsigned int tok) { switch (t) { - case chained: + 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); @@ -742,14 +742,14 @@ static mcError_error doError (mcError_error e, errorType t, unsigned int tok) } break; - case newerror: + case mcMetaError_newerror: if (e == NULL) { e = mcError_newError (tok); } break; - case newwarning: + case mcMetaError_newwarning: if (e == NULL) { e = mcError_newWarning (tok); @@ -771,7 +771,7 @@ static mcError_error doError (mcError_error e, errorType t, unsigned int tok) doDeclaredDef - creates an error note where sym[bol] was declared. */ -static mcError_error doDeclaredDef (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym) +static mcError_error doDeclaredDef (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym) { decl_node n; @@ -791,7 +791,7 @@ static mcError_error doDeclaredDef (mcError_error e, errorType t, unsigned int b doDeclaredMod - creates an error note where sym[bol] was declared. */ -static mcError_error doDeclaredMod (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym) +static mcError_error doDeclaredMod (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym) { decl_node n; @@ -811,7 +811,7 @@ static mcError_error doDeclaredMod (mcError_error e, errorType t, unsigned int b doUsed - creates an error note where sym[bol] was first used. */ -static mcError_error doUsed (mcError_error e, errorType t, unsigned int bol, varargs_vararg sym) +static mcError_error doUsed (mcError_error e, mcMetaError_errorType t, unsigned int bol, varargs_vararg sym) { decl_node n; @@ -1040,7 +1040,7 @@ static DynamicStrings_String addQuoted (DynamicStrings_String r, DynamicStrings_ op := {'a'|'q'|'t'|'d'|'k'|'n'|'s'|'D'|'I'|'U'|'E'|'W'} then =: */ -static void op (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive) +static void op (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int bol, unsigned int positive) { DynamicStrings_String o; varargs_vararg c; @@ -1098,11 +1098,11 @@ static void op (mcError_error *e, errorType *t, DynamicStrings_String *r, Dynami break; case 'E': - (*t) = newerror; + (*t) = mcMetaError_newerror; break; case 'W': - (*t) = newwarning; + (*t) = mcMetaError_newwarning; break; case ':': @@ -1144,7 +1144,7 @@ static void op (mcError_error *e, errorType *t, DynamicStrings_String *r, Dynami } =: */ -static void percenttoken (mcError_error *e, errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive) +static void percenttoken (mcError_error *e, mcMetaError_errorType t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l, unsigned int positive) { if ((DynamicStrings_char (s, (*i))) == '%') { @@ -1207,7 +1207,7 @@ static void percent (DynamicStrings_String *r, DynamicStrings_String s, varargs_ lbra := '{' [ '!' ] percenttoken '}' =: */ -static void lbra (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l) +static void lbra (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l) { unsigned int positive; @@ -1250,7 +1250,7 @@ static void stop (void) =: */ -static void ebnf (mcError_error *e, errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l) +static void ebnf (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String *r, DynamicStrings_String s, varargs_vararg sym, int *i, int l) { while ((*i) < l) { @@ -1289,7 +1289,7 @@ static void ebnf (mcError_error *e, errorType *t, DynamicStrings_String *r, Dyna doFormat - */ -static DynamicStrings_String doFormat (mcError_error *e, errorType *t, DynamicStrings_String s, varargs_vararg sym) +static DynamicStrings_String doFormat (mcError_error *e, mcMetaError_errorType *t, DynamicStrings_String s, varargs_vararg sym) { DynamicStrings_String r; int i; @@ -1315,7 +1315,7 @@ static void wrapErrors (unsigned int tok, const char *m1_, unsigned int _m1_high mcError_error e; mcError_error f; DynamicStrings_String str; - errorType t; + mcMetaError_errorType t; char m1[_m1_high+1]; char m2[_m2_high+1]; @@ -1324,16 +1324,16 @@ static void wrapErrors (unsigned int tok, const char *m1_, unsigned int _m1_high memcpy (m2, m2_, _m2_high+1); e = static_cast (NULL); - t = newerror; + t = mcMetaError_newerror; str = doFormat (&e, &t, DynamicStrings_InitString ((const char *) m1, _m1_high), sym); e = doError (e, t, tok); mcError_errorString (e, str); f = e; - t = chained; + t = mcMetaError_chained; str = doFormat (&f, &t, DynamicStrings_InitString ((const char *) m2, _m2_high), sym); if (e == f) { - t = chained; + t = mcMetaError_chained; f = doError (e, t, tok); } mcError_errorString (f, str); @@ -1769,7 +1769,7 @@ extern "C" void mcMetaError_metaErrorStringT1 (unsigned int tok, DynamicStrings_ DynamicStrings_String str; mcError_error e; varargs_vararg sym; - errorType t; + mcMetaError_errorType t; unsigned char s[_s_high+1]; /* make a local copy of each unbounded array. */ @@ -1777,7 +1777,7 @@ extern "C" void mcMetaError_metaErrorStringT1 (unsigned int tok, DynamicStrings_ e = static_cast (NULL); sym = varargs_start1 ((const unsigned char *) s, _s_high); - t = newerror; + t = mcMetaError_newerror; str = doFormat (&e, &t, m, sym); e = doError (e, t, tok); mcError_errorString (e, str); @@ -1794,7 +1794,7 @@ extern "C" void mcMetaError_metaErrorStringT2 (unsigned int tok, DynamicStrings_ DynamicStrings_String str; mcError_error e; varargs_vararg sym; - errorType t; + mcMetaError_errorType t; unsigned char s1[_s1_high+1]; unsigned char s2[_s2_high+1]; @@ -1804,7 +1804,7 @@ extern "C" void mcMetaError_metaErrorStringT2 (unsigned int tok, DynamicStrings_ e = static_cast (NULL); sym = varargs_start2 ((const unsigned char *) s1, _s1_high, (const unsigned char *) s2, _s2_high); - t = newerror; + t = mcMetaError_newerror; str = doFormat (&e, &t, m, sym); e = doError (e, t, tok); mcError_errorString (e, str); @@ -1821,7 +1821,7 @@ extern "C" void mcMetaError_metaErrorStringT3 (unsigned int tok, DynamicStrings_ DynamicStrings_String str; mcError_error e; varargs_vararg sym; - errorType t; + mcMetaError_errorType t; unsigned char s1[_s1_high+1]; unsigned char s2[_s2_high+1]; unsigned char s3[_s3_high+1]; @@ -1833,7 +1833,7 @@ extern "C" void mcMetaError_metaErrorStringT3 (unsigned int tok, DynamicStrings_ e = static_cast (NULL); sym = varargs_start3 ((const unsigned char *) s1, _s1_high, (const unsigned char *) s2, _s2_high, (const unsigned char *) s3, _s3_high); - t = newerror; + t = mcMetaError_newerror; str = doFormat (&e, &t, m, sym); e = doError (e, t, tok); mcError_errorString (e, str); @@ -1850,7 +1850,7 @@ extern "C" void mcMetaError_metaErrorStringT4 (unsigned int tok, DynamicStrings_ DynamicStrings_String str; mcError_error e; varargs_vararg sym; - errorType t; + mcMetaError_errorType t; unsigned char s1[_s1_high+1]; unsigned char s2[_s2_high+1]; unsigned char s3[_s3_high+1]; @@ -1864,7 +1864,7 @@ extern "C" void mcMetaError_metaErrorStringT4 (unsigned int tok, DynamicStrings_ e = static_cast (NULL); sym = varargs_start4 ((const unsigned char *) s1, _s1_high, (const unsigned char *) s2, _s2_high, (const unsigned char *) s3, _s3_high, (const unsigned char *) s4, _s4_high); - t = newerror; + t = mcMetaError_newerror; str = doFormat (&e, &t, m, sym); e = doError (e, t, tok); mcError_errorString (e, str); diff --git a/gcc/m2/mc-boot/GmcPretty.c b/gcc/m2/mc-boot/GmcPretty.c index 8d70c0b4924..674db9443a5 100644 --- a/gcc/m2/mc-boot/GmcPretty.c +++ b/gcc/m2/mc-boot/GmcPretty.c @@ -47,9 +47,9 @@ typedef struct mcPretty_writeProc_p mcPretty_writeProc; typedef struct mcPretty_writeLnProc_p mcPretty_writeLnProc; -typedef struct _T1_r _T1; +typedef struct mcPretty__T1_r mcPretty__T1; -typedef _T1 *mcPretty_pretty; +typedef mcPretty__T1 *mcPretty_pretty; typedef void (*mcPretty_writeProc_t) (char); struct mcPretty_writeProc_p { mcPretty_writeProc_t proc; }; @@ -57,17 +57,17 @@ struct mcPretty_writeProc_p { mcPretty_writeProc_t proc; }; typedef void (*mcPretty_writeLnProc_t) (void); struct mcPretty_writeLnProc_p { mcPretty_writeLnProc_t proc; }; -struct _T1_r { - mcPretty_writeProc write_; - mcPretty_writeLnProc writeln; - unsigned int needsSpace; - unsigned int needsIndent; - unsigned int seekPos; - unsigned int curLine; - unsigned int curPos; - unsigned int indent; - mcPretty_pretty stacked; - }; +struct mcPretty__T1_r { + mcPretty_writeProc write_; + mcPretty_writeLnProc writeln; + unsigned int needsSpace; + unsigned int needsIndent; + unsigned int seekPos; + unsigned int curLine; + unsigned int curPos; + unsigned int indent; + mcPretty_pretty stacked; + }; /* @@ -216,7 +216,7 @@ extern "C" mcPretty_pretty mcPretty_initPretty (mcPretty_writeProc w, mcPretty_w { mcPretty_pretty p; - Storage_ALLOCATE ((void **) &p, sizeof (_T1)); + Storage_ALLOCATE ((void **) &p, sizeof (mcPretty__T1)); p->write_ = w; p->writeln = l; p->needsSpace = FALSE; @@ -240,7 +240,7 @@ extern "C" mcPretty_pretty mcPretty_dupPretty (mcPretty_pretty p) { mcPretty_pretty q; - Storage_ALLOCATE ((void **) &q, sizeof (_T1)); + Storage_ALLOCATE ((void **) &q, sizeof (mcPretty__T1)); (*q) = (*p); return q; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -257,7 +257,7 @@ extern "C" void mcPretty_killPretty (mcPretty_pretty *p) { (*p) = NULL; return ; - Storage_DEALLOCATE ((void **) &(*p), sizeof (_T1)); + Storage_DEALLOCATE ((void **) &(*p), sizeof (mcPretty__T1)); (*p) = NULL; } diff --git a/gcc/m2/mc-boot/GmcStack.c b/gcc/m2/mc-boot/GmcStack.c index 1b0910cc1ca..83fecdadb65 100644 --- a/gcc/m2/mc-boot/GmcStack.c +++ b/gcc/m2/mc-boot/GmcStack.c @@ -37,14 +37,14 @@ Boston, MA 02110-1301, USA. */ # include "GIndexing.h" # include "GM2RTS.h" -typedef struct _T1_r _T1; +typedef struct mcStack__T1_r mcStack__T1; -typedef _T1 *mcStack_stack; +typedef mcStack__T1 *mcStack_stack; -struct _T1_r { - Indexing_Index list; - unsigned int count; - }; +struct mcStack__T1_r { + Indexing_Index list; + unsigned int count; + }; /* @@ -102,7 +102,7 @@ extern "C" mcStack_stack mcStack_init (void) { mcStack_stack s; - Storage_ALLOCATE ((void **) &s, sizeof (_T1)); + Storage_ALLOCATE ((void **) &s, sizeof (mcStack__T1)); s->list = Indexing_InitIndex (1); s->count = 0; return s; @@ -118,7 +118,7 @@ extern "C" mcStack_stack mcStack_init (void) extern "C" void mcStack_kill (mcStack_stack *s) { (*s)->list = Indexing_KillIndex ((*s)->list); - Storage_DEALLOCATE ((void **) &(*s), sizeof (_T1)); + Storage_DEALLOCATE ((void **) &(*s), sizeof (mcStack__T1)); (*s) = NULL; } diff --git a/gcc/m2/mc-boot/GmcStream.c b/gcc/m2/mc-boot/GmcStream.c index 65df35192ba..65a481d0f96 100644 --- a/gcc/m2/mc-boot/GmcStream.c +++ b/gcc/m2/mc-boot/GmcStream.c @@ -56,7 +56,7 @@ along with GNU Modula-2; see the file COPYING3. If not see # include "GM2RTS.h" # define maxBuffer 4096 -typedef FIO_File *ptrToFile; +typedef FIO_File *mcStream_ptrToFile; static alists_alist listOfFiles; static Indexing_Index frag; @@ -113,7 +113,7 @@ static FIO_File createTemporaryFile (unsigned int id); copy - copies contents of f to the destination file. */ -static void copy (ptrToFile p); +static void copy (mcStream_ptrToFile p); /* @@ -174,12 +174,12 @@ static FIO_File createTemporaryFile (unsigned int id) copy - copies contents of f to the destination file. */ -static void copy (ptrToFile p) +static void copy (mcStream_ptrToFile p) { - typedef struct _T1_a _T1; + typedef struct copy__T1_a copy__T1; - struct _T1_a { char array[maxBuffer+1]; }; - _T1 buffer; + struct copy__T1_a { char array[maxBuffer+1]; }; + copy__T1 buffer; unsigned int b; DynamicStrings_String s; FIO_File f; @@ -208,7 +208,7 @@ static void copy (ptrToFile p) extern "C" FIO_File mcStream_openFrag (unsigned int id) { FIO_File f; - ptrToFile p; + mcStream_ptrToFile p; f = createTemporaryFile (id); Storage_ALLOCATE ((void **) &p, sizeof (FIO_File)); diff --git a/gcc/m2/mc-boot/Gmcp1.c b/gcc/m2/mc-boot/Gmcp1.c index 510be985ea6..e4f154410e0 100644 --- a/gcc/m2/mc-boot/Gmcp1.c +++ b/gcc/m2/mc-boot/Gmcp1.c @@ -55,17 +55,17 @@ see . */ # define Pass1 TRUE # define Debugging FALSE -typedef unsigned int stop0; +typedef unsigned int mcp1_stop0; -typedef unsigned int SetOfStop0; +typedef unsigned int mcp1_SetOfStop0; -typedef unsigned int stop1; +typedef unsigned int mcp1_stop1; -typedef unsigned int SetOfStop1; +typedef unsigned int mcp1_SetOfStop1; -typedef unsigned int stop2; +typedef unsigned int mcp1_stop2; -typedef unsigned int SetOfStop2; +typedef unsigned int mcp1_SetOfStop2; static unsigned int WasNoError; static nameKey_Name curident; @@ -91,7 +91,7 @@ static void checkEndName (decl_node module, nameKey_Name name, const char *desc_ DescribeStop - issues a message explaining what tokens were expected */ -static DynamicStrings_String DescribeStop (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static DynamicStrings_String DescribeStop (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* DescribeError - issues a message explaining what tokens were expected @@ -104,13 +104,13 @@ static void DescribeError (void); a stop symbol. */ -static void SyntaxError (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void SyntaxError (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* SyntaxCheck - */ -static void SyntaxCheck (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void SyntaxCheck (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* WarnMissingToken - generates a warning message about a missing token, t. @@ -128,13 +128,13 @@ static void MissingToken (mcReserved_toktype t); CheckAndInsert - */ -static unsigned int CheckAndInsert (mcReserved_toktype t, SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static unsigned int CheckAndInsert (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* InStopSet */ -static unsigned int InStopSet (mcReserved_toktype t, SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static unsigned int InStopSet (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* PeepToken - peep token checks to see whether the stopset is satisfied by currenttoken @@ -144,37 +144,37 @@ static unsigned int InStopSet (mcReserved_toktype t, SetOfStop0 stopset0, SetOfS if the stopset contains then we do not insert a token */ -static void PeepToken (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void PeepToken (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* Expect - */ -static void Expect (mcReserved_toktype t, SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void Expect (mcReserved_toktype t, mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* Ident - error checking varient of Ident */ -static void Ident (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void Ident (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* string - */ -static void string (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void string (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* Integer - */ -static void Integer (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void Integer (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* Real - */ -static void Real (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void Real (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* registerImport - looks up module, ident, and adds it to the @@ -192,7 +192,7 @@ static void registerImport (nameKey_Name ident, unsigned int scoped); cannot reachend */ -static void FileUnit (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void FileUnit (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* ProgramModule := 'MODULE' Ident @@ -211,7 +211,7 @@ static void FileUnit (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stops cannot reachend */ -static void ProgramModule (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void ProgramModule (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* ImplementationModule := 'IMPLEMENTATION' 'MODULE' @@ -233,7 +233,7 @@ static void ProgramModule (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 cannot reachend */ -static void ImplementationModule (SetOfStop0 stopset0, SetOfStop1 stopset1, SetOfStop2 stopset2); +static void ImplementationModule (mcp1_SetOfStop0 stopset0, mcp1_SetOfStop1 stopset1, mcp1_SetOfStop2 stopset2); /* ImplementationOrProgramModule := ImplementationModule | @@ -244,7 +244,7 @@ static void ImplementationModule (SetOfStop0 stopset0, SetOfStop1 stopset1, SetO cannot reachend */ -static void ImplementationOrProgramModule (SetOfStop0 stopset0, SetOfStop1 stopset1,[...] [diff truncated at 524288 bytes]