LCOV - code coverage report
Current view: top level - /mnt/build/buildbot/bld/build-lcov/gcc/m2/gm2-compiler-boot - M2System.c (source / functions) Coverage Total Hit
Test: gcc.info Lines: 90.4 % 332 300
Test Date: 2026-03-28 14:25:54 Functions: 92.1 % 38 35
Legend: Lines:     hit not hit

            Line data    Source code
       1              : /* do not edit automatically generated by mc from M2System.  */
       2              : /* M2System.mod defines the SYSTEM builtin types.
       3              : 
       4              : Copyright (C) 2001-2026 Free Software Foundation, Inc.
       5              : Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
       6              : 
       7              : This file is part of GNU Modula-2.
       8              : 
       9              : GNU Modula-2 is free software; you can redistribute it and/or modify
      10              : it under the terms of the GNU General Public License as published by
      11              : the Free Software Foundation; either version 3, or (at your option)
      12              : any later version.
      13              : 
      14              : GNU Modula-2 is distributed in the hope that it will be useful, but
      15              : WITHOUT ANY WARRANTY; without even the implied warranty of
      16              : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17              : General Public License for more details.
      18              : 
      19              : You should have received a copy of the GNU General Public License
      20              : along with GNU Modula-2; see the file COPYING3.  If not see
      21              : <http://www.gnu.org/licenses/>.  */
      22              : 
      23              : #include "config.h"
      24              : #include "system.h"
      25              : #include "gcc-consolidation.h"
      26              : 
      27              : #include <stdbool.h>
      28              : #   if !defined (PROC_D)
      29              : #      define PROC_D
      30              :        typedef void (*PROC_t) (void);
      31              :        typedef struct { PROC_t proc; } PROC;
      32              : #   endif
      33              : 
      34              : #   if !defined (TRUE)
      35              : #      define TRUE (1==1)
      36              : #   endif
      37              : 
      38              : #   if !defined (FALSE)
      39              : #      define FALSE (1==0)
      40              : #   endif
      41              : 
      42              : #   include "Gmcrts.h"
      43              : #if defined(__cplusplus)
      44              : #   undef NULL
      45              : #   define NULL 0
      46              : #endif
      47              : #define _M2System_C
      48              : 
      49              : #include "GM2System.h"
      50              : #   include "GSymbolTable.h"
      51              : #   include "GAssertion.h"
      52              : #   include "GM2LexBuf.h"
      53              : #   include "GM2Options.h"
      54              : #   include "GNameKey.h"
      55              : #   include "GM2Batch.h"
      56              : #   include "GM2Base.h"
      57              : #   include "GM2Size.h"
      58              : #   include "GM2ALU.h"
      59              : #   include "GM2Error.h"
      60              : #   include "GLists.h"
      61              : #   include "GSymbolKey.h"
      62              : #   include "GStrLib.h"
      63              : #   include "GM2Printf.h"
      64              : #   include "GSymbolConversion.h"
      65              : #   include "Ggcctypes.h"
      66              : #   include "Gm2linemap.h"
      67              : #   include "Gm2decl.h"
      68              : #   include "Gm2type.h"
      69              : #   include "Gm2expr.h"
      70              : 
      71              : typedef struct M2System_IsP_p M2System_IsP;
      72              : 
      73              : typedef bool (*M2System_IsP_t) (unsigned int);
      74              : struct M2System_IsP_p { M2System_IsP_t proc; };
      75              : 
      76              : static SymbolKey_SymbolTree MinValues;
      77              : static SymbolKey_SymbolTree MaxValues;
      78              : static Lists_List SystemTypes;
      79              : 
      80              : /*
      81              :    InitSystem - creates the system dependant types and procedures.
      82              :                 Note that they are not exported here, but they are
      83              :                 exported in the textual module: SYSTEM.def.
      84              :                 We build our system types from those given in the gcc
      85              :                 backend. Essentially we perform double book keeping.
      86              : */
      87              : 
      88              : extern "C" void M2System_InitSystem (void);
      89              : 
      90              : /*
      91              :    GetSystemTypeMinMax - returns the minimum and maximum values for a given system type.
      92              : */
      93              : 
      94              : extern "C" void M2System_GetSystemTypeMinMax (unsigned int type, unsigned int *min, unsigned int *max);
      95              : 
      96              : /*
      97              :    IsPseudoSystemFunction - returns true if sym is a SYSTEM pseudo function.
      98              : */
      99              : 
     100              : extern "C" bool M2System_IsPseudoSystemFunction (unsigned int sym);
     101              : 
     102              : /*
     103              :    IsPseudoSystemProcedure - returns true if sym is a SYSTEM pseudo procedure.
     104              : */
     105              : 
     106              : extern "C" bool M2System_IsPseudoSystemProcedure (unsigned int sym);
     107              : 
     108              : /*
     109              :    IsPseudoSystemFunctionConstExpression - returns TRUE if this procedure
     110              :                                            is legal in a constant expression.
     111              : */
     112              : 
     113              : extern "C" bool M2System_IsPseudoSystemFunctionConstExpression (unsigned int sym);
     114              : 
     115              : /*
     116              :    IsSystemType - returns TRUE if sym is a SYSTEM (inbuilt) type.
     117              :                   It does not search your SYSTEM implementation module.
     118              : */
     119              : 
     120              : extern "C" bool M2System_IsSystemType (unsigned int sym);
     121              : 
     122              : /*
     123              :    IntegerN - returns the symbol associated with INTEGER[N].
     124              :               NulSym is returned if the type does not exist.
     125              : */
     126              : 
     127              : extern "C" unsigned int M2System_IntegerN (unsigned int bitlength);
     128              : 
     129              : /*
     130              :    CardinalN - returns the symbol associated with CARDINAL[N].
     131              :                NulSym is returned if the type does not exist.
     132              : */
     133              : 
     134              : extern "C" unsigned int M2System_CardinalN (unsigned int bitlength);
     135              : 
     136              : /*
     137              :    WordN - returns the symbol associated with WORD[N].
     138              :            NulSym is returned if the type does not exist.
     139              : */
     140              : 
     141              : extern "C" unsigned int M2System_WordN (unsigned int bitlength);
     142              : 
     143              : /*
     144              :    SetN - returns the symbol associated with SET[N].
     145              :           NulSym is returned if the type does not exist.
     146              : */
     147              : 
     148              : extern "C" unsigned int M2System_SetN (unsigned int bitlength);
     149              : 
     150              : /*
     151              :    RealN - returns the symbol associated with REAL[N].
     152              :            NulSym is returned if the type does not exist.
     153              : */
     154              : 
     155              : extern "C" unsigned int M2System_RealN (unsigned int bitlength);
     156              : 
     157              : /*
     158              :    ComplexN - returns the symbol associated with COMPLEX[N].
     159              :               NulSym is returned if the type does not exist.
     160              : */
     161              : 
     162              : extern "C" unsigned int M2System_ComplexN (unsigned int bitlength);
     163              : 
     164              : /*
     165              :    IsIntegerN - returns the TRUE if, sym, is one of the SYSTEM
     166              :                 INTEGER types (not the base INTEGER type).
     167              : */
     168              : 
     169              : extern "C" bool M2System_IsIntegerN (unsigned int sym);
     170              : 
     171              : /*
     172              :    IsCardinalN - returns the TRUE if, sym, is one of the SYSTEM
     173              :                  CARDINAL types (not the base CARDINAL type).
     174              : */
     175              : 
     176              : extern "C" bool M2System_IsCardinalN (unsigned int sym);
     177              : 
     178              : /*
     179              :    IsWordN - returns the TRUE if, sym, is one of the SYSTEM
     180              :              WORD[n] types (not the default SYSTEM WORD type).
     181              : */
     182              : 
     183              : extern "C" bool M2System_IsWordN (unsigned int sym);
     184              : 
     185              : /*
     186              :    IsSetN - returns the TRUE if, sym, is one of the SYSTEM
     187              :             SET[n] types (not the default SYSTEM BITSET type).
     188              : */
     189              : 
     190              : extern "C" bool M2System_IsSetN (unsigned int sym);
     191              : 
     192              : /*
     193              :    IsRealN - returns the TRUE if, sym, is one of the SYSTEM
     194              :              REAL[n] types (not the default base REAL type).
     195              : */
     196              : 
     197              : extern "C" bool M2System_IsRealN (unsigned int sym);
     198              : 
     199              : /*
     200              :    IsComplexN - returns the TRUE if, sym, is one of the SYSTEM
     201              :                 COMPLEX[n] types (not the default base COMPLEX,
     202              :                 LONGCOMPLEX or SHORTCOMPLEX types).
     203              : */
     204              : 
     205              : extern "C" bool M2System_IsComplexN (unsigned int sym);
     206              : 
     207              : /*
     208              :    IsGenericSystemType - returns TRUE if, sym, is of type
     209              :                          BYTE, WORD or any other length.
     210              : */
     211              : 
     212              : extern "C" bool M2System_IsGenericSystemType (unsigned int sym);
     213              : 
     214              : /*
     215              :    IsSameSizePervasiveType - returns TRUE if a or b are CARDINAL, INTEGER, REAL,
     216              :                              LONGREAL, SHORTREAL and the other type is the same
     217              :                              size and of the same type.
     218              : */
     219              : 
     220              : extern "C" bool M2System_IsSameSizePervasiveType (unsigned int a, unsigned int b);
     221              : 
     222              : /*
     223              :    IsSameSize - return TRUE if SIZE(a)=SIZE(b)
     224              : */
     225              : 
     226              : extern "C" bool M2System_IsSameSize (unsigned int a, unsigned int b);
     227              : 
     228              : /*
     229              :    Init -
     230              : */
     231              : 
     232              : static void Init (void);
     233              : 
     234              : /*
     235              :    CreateMinMaxFor - creates the min and max values for type given gccType.
     236              : */
     237              : 
     238              : static void CreateMinMaxFor (unsigned int type, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, tree gccType, bool realtype);
     239              : 
     240              : /*
     241              :    MapType - create a mapping of the M2 frontend type to gcctype.
     242              : */
     243              : 
     244              : static void MapType (unsigned int type, const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gcctype, bool realtype);
     245              : 
     246              : /*
     247              :    CreateType - create and return a frontend type which matches the GCC tree type.
     248              : */
     249              : 
     250              : static unsigned int CreateType (const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gccType, bool realtype);
     251              : 
     252              : /*
     253              :    AttemptToCreateType - attempts to create a frontend type which matches the
     254              :                          GCC tree type.
     255              : */
     256              : 
     257              : static void AttemptToCreateType (const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gccType, bool realtype);
     258              : 
     259              : /*
     260              :    CreateSetType - creates and returns a, SET OF [0..highBit], type.
     261              :                    It maps this type onto the GCC type.
     262              : */
     263              : 
     264              : static unsigned int CreateSetType (const char *name_, unsigned int _name_high, const char *highBit_, unsigned int _highBit_high, bool needsExporting, tree gccType);
     265              : 
     266              : /*
     267              :    AttemptToCreateSetType - creates and returns a, SET OF [0..highBit], type.
     268              :                             It maps this type onto the GCC type.
     269              : */
     270              : 
     271              : static void AttemptToCreateSetType (const char *name_, unsigned int _name_high, const char *highBit_, unsigned int _highBit_high, bool needsExporting, tree gccType);
     272              : 
     273              : /*
     274              :    MakeFixedSizedTypes - creates the SYSTEM fixed sized types providing the
     275              :                          gcc backend supports them.
     276              : */
     277              : 
     278              : static void MakeFixedSizedTypes (void);
     279              : 
     280              : /*
     281              :    InitPIMTypes -
     282              : */
     283              : 
     284              : static void InitPIMTypes (void);
     285              : 
     286              : /*
     287              :    InitISOTypes -
     288              : */
     289              : 
     290              : static void InitISOTypes (void);
     291              : 
     292              : /*
     293              :    MakeExtraSystemTypes - create any extra system types required
     294              :                           for portability.
     295              : */
     296              : 
     297              : static void MakeExtraSystemTypes (void);
     298              : 
     299              : /*
     300              :    IsISOPseudoSystemFunction -
     301              : */
     302              : 
     303              : static bool IsISOPseudoSystemFunction (unsigned int sym);
     304              : 
     305              : /*
     306              :    IsPIMPseudoSystemFunction - returns TRUE if sym is specifically a PIM
     307              :                                system function.
     308              : */
     309              : 
     310              : static bool IsPIMPseudoSystemFunction (unsigned int sym);
     311              : 
     312              : /*
     313              :    GetSafeSystem -
     314              : */
     315              : 
     316              : static unsigned int GetSafeSystem (NameKey_Name name);
     317              : 
     318              : /*
     319              :    IsSameType - returns TRUE if, t, is the same type as a or b
     320              :                 and a or b are a type, p.
     321              : */
     322              : 
     323              : static bool IsSameType (unsigned int t, M2System_IsP p, unsigned int a, unsigned int b);
     324              : 
     325              : 
     326              : /*
     327              :    Init -
     328              : */
     329              : 
     330        17024 : static void Init (void)
     331              : {
     332        17024 :   Lists_InitList (&SystemTypes);
     333        17024 :   SymbolKey_InitTree (&MinValues);
     334        17024 :   SymbolKey_InitTree (&MaxValues);
     335        17024 : }
     336              : 
     337              : 
     338              : /*
     339              :    CreateMinMaxFor - creates the min and max values for type given gccType.
     340              : */
     341              : 
     342       242637 : static void CreateMinMaxFor (unsigned int type, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, tree gccType, bool realtype)
     343              : {
     344       242637 :   unsigned int maxval;
     345       242637 :   unsigned int minval;
     346       242637 :   char min[_min_high+1];
     347       242637 :   char max[_max_high+1];
     348              : 
     349              :   /* make a local copy of each unbounded array.  */
     350       242637 :   memcpy (min, min_, _min_high+1);
     351       242637 :   memcpy (max, max_, _max_high+1);
     352              : 
     353       242637 :   maxval = SymbolTable_MakeConstVar (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) max, _max_high));
     354       242637 :   if (realtype)
     355              :     {
     356        51072 :       M2ALU_PushRealTree (m2type_GetMaxFrom (m2linemap_BuiltinsLocation (), gccType));
     357              :     }
     358              :   else
     359              :     {
     360       191565 :       M2ALU_PushIntegerTree (m2type_GetMaxFrom (m2linemap_BuiltinsLocation (), gccType));
     361              :     }
     362       242637 :   SymbolTable_PopValue (maxval);
     363       242637 :   SymbolTable_PutVar (maxval, type);
     364       242637 :   SymbolKey_PutSymKey (MaxValues, SymbolTable_GetSymName (type), maxval);
     365       242637 :   minval = SymbolTable_MakeConstVar (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) min, _min_high));
     366       242637 :   if (realtype)
     367              :     {
     368        51072 :       M2ALU_PushRealTree (m2type_GetMinFrom (m2linemap_BuiltinsLocation (), gccType));
     369              :     }
     370              :   else
     371              :     {
     372       191565 :       M2ALU_PushIntegerTree (m2type_GetMinFrom (m2linemap_BuiltinsLocation (), gccType));
     373              :     }
     374       242637 :   SymbolTable_PopValue (minval);
     375       242637 :   SymbolTable_PutVar (minval, type);
     376       242637 :   SymbolKey_PutSymKey (MinValues, SymbolTable_GetSymName (type), minval);
     377       242637 : }
     378              : 
     379              : 
     380              : /*
     381              :    MapType - create a mapping of the M2 frontend type to gcctype.
     382              : */
     383              : 
     384       459648 : static void MapType (unsigned int type, const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gcctype, bool realtype)
     385              : {
     386       459648 :   NameKey_Name n;
     387       459648 :   char name[_name_high+1];
     388       459648 :   char min[_min_high+1];
     389       459648 :   char max[_max_high+1];
     390              : 
     391              :   /* make a local copy of each unbounded array.  */
     392       459648 :   memcpy (name, name_, _name_high+1);
     393       459648 :   memcpy (min, min_, _min_high+1);
     394       459648 :   memcpy (max, max_, _max_high+1);
     395              : 
     396       459648 :   M2ALU_PushIntegerTree (m2expr_BuildSize (m2linemap_BuiltinsLocation (), gcctype, false));
     397       459648 :   SymbolTable_PopSize (type);
     398       459648 :   if (Lists_IsItemInList (SystemTypes, type))
     399              :     {
     400            0 :       M2Error_InternalError ((const char *) "not expecting system type to already be declared", 48);
     401              :     }
     402       459648 :   Lists_PutItemIntoList (SystemTypes, type);
     403              :   /* Create min, max constants if type is ordinal or a floating point type.  */
     404       459648 :   if ((! (StrLib_StrEqual ((const char *) min, _min_high, (const char *) "", 0))) && (! (StrLib_StrEqual ((const char *) max, _max_high, (const char *) "", 0))))
     405              :     {
     406       191565 :       CreateMinMaxFor (type, (const char *) min, _min_high, (const char *) max, _max_high, gcctype, realtype);
     407              :     }
     408       459648 :   if (needsExporting && M2Options_DumpSystemExports)
     409              :     {
     410          594 :       n = SymbolTable_GetSymName (type);
     411          594 :       M2Printf_printf1 ((const char *) "SYSTEM module creates type: %a\\n", 32, (const unsigned char *) &n, (sizeof (n)-1));
     412              :     }
     413       459648 : }
     414              : 
     415              : 
     416              : /*
     417              :    CreateType - create and return a frontend type which matches the GCC tree type.
     418              : */
     419              : 
     420       425600 : static unsigned int CreateType (const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gccType, bool realtype)
     421              : {
     422       425600 :   unsigned int type;
     423       425600 :   char name[_name_high+1];
     424       425600 :   char min[_min_high+1];
     425       425600 :   char max[_max_high+1];
     426              : 
     427              :   /* make a local copy of each unbounded array.  */
     428       425600 :   memcpy (name, name_, _name_high+1);
     429       425600 :   memcpy (min, min_, _min_high+1);
     430       425600 :   memcpy (max, max_, _max_high+1);
     431              : 
     432       425600 :   if (gccType == NULL)
     433              :     {
     434              :       /* GCC backend does not support this type.  */
     435              :       return SymbolTable_NulSym;
     436              :     }
     437              :   else
     438              :     {
     439              :       /* Create base type.  */
     440       391552 :       type = SymbolTable_MakeType (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) name, _name_high));
     441       391552 :       SymbolTable_PutType (type, SymbolTable_NulSym);  /* a Base Type  */
     442       391552 :       MapType (type, (const char *) name, _name_high, (const char *) min, _min_high, (const char *) max, _max_high, needsExporting, gccType, realtype);  /* a Base Type  */
     443       391552 :       return type;
     444              :     }
     445              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     446              :   __builtin_unreachable ();
     447       425600 : }
     448              : 
     449              : 
     450              : /*
     451              :    AttemptToCreateType - attempts to create a frontend type which matches the
     452              :                          GCC tree type.
     453              : */
     454              : 
     455       323456 : static void AttemptToCreateType (const char *name_, unsigned int _name_high, const char *min_, unsigned int _min_high, const char *max_, unsigned int _max_high, bool needsExporting, tree gccType, bool realtype)
     456              : {
     457       323456 :   char name[_name_high+1];
     458       323456 :   char min[_min_high+1];
     459       323456 :   char max[_max_high+1];
     460              : 
     461              :   /* make a local copy of each unbounded array.  */
     462       323456 :   memcpy (name, name_, _name_high+1);
     463       323456 :   memcpy (min, min_, _min_high+1);
     464       323456 :   memcpy (max, max_, _max_high+1);
     465              : 
     466       323456 :   Assertion_Assert (SymbolTable_IsLegal (CreateType ((const char *) name, _name_high, (const char *) min, _min_high, (const char *) max, _max_high, needsExporting, gccType, realtype)));
     467       323456 : }
     468              : 
     469              : 
     470              : /*
     471              :    CreateSetType - creates and returns a, SET OF [0..highBit], type.
     472              :                    It maps this type onto the GCC type.
     473              : */
     474              : 
     475        51072 : static unsigned int CreateSetType (const char *name_, unsigned int _name_high, const char *highBit_, unsigned int _highBit_high, bool needsExporting, tree gccType)
     476              : {
     477        51072 :   unsigned int low;
     478        51072 :   unsigned int high;
     479        51072 :   unsigned int subrange;
     480        51072 :   unsigned int type;
     481        51072 :   char name[_name_high+1];
     482        51072 :   char highBit[_highBit_high+1];
     483              : 
     484              :   /* make a local copy of each unbounded array.  */
     485        51072 :   memcpy (name, name_, _name_high+1);
     486        51072 :   memcpy (highBit, highBit_, _highBit_high+1);
     487              : 
     488        51072 :   if (gccType == NULL)
     489              :     {
     490              :       /* GCC backend does not support this type  */
     491              :       return SymbolTable_NulSym;
     492              :     }
     493              :   else
     494              :     {
     495              :       /* create base type  */
     496        51072 :       type = SymbolTable_MakeSet (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) name, _name_high));
     497        51072 :       low = SymbolTable_MakeConstLit (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "0", 1), M2Base_Cardinal);
     498        51072 :       high = SymbolTable_MakeConstLit (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) highBit, _highBit_high), M2Base_Cardinal);
     499        51072 :       subrange = SymbolTable_MakeSubrange (M2LexBuf_BuiltinTokenNo, NameKey_NulName);
     500        51072 :       SymbolTable_PutSubrange (subrange, low, high, M2Base_Cardinal);
     501        51072 :       SymbolTable_PutSet (type, subrange, false);
     502        51072 :       MapType (type, (const char *) name, _name_high, (const char *) "", 0, (const char *) "", 0, needsExporting, gccType, false);
     503        51072 :       return type;
     504              :     }
     505              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     506              :   __builtin_unreachable ();
     507        51072 : }
     508              : 
     509              : 
     510              : /*
     511              :    AttemptToCreateSetType - creates and returns a, SET OF [0..highBit], type.
     512              :                             It maps this type onto the GCC type.
     513              : */
     514              : 
     515        51072 : static void AttemptToCreateSetType (const char *name_, unsigned int _name_high, const char *highBit_, unsigned int _highBit_high, bool needsExporting, tree gccType)
     516              : {
     517        51072 :   char name[_name_high+1];
     518        51072 :   char highBit[_highBit_high+1];
     519              : 
     520              :   /* make a local copy of each unbounded array.  */
     521        51072 :   memcpy (name, name_, _name_high+1);
     522        51072 :   memcpy (highBit, highBit_, _highBit_high+1);
     523              : 
     524        51072 :   Assertion_Assert (SymbolTable_IsLegal (CreateSetType ((const char *) name, _name_high, (const char *) highBit, _highBit_high, needsExporting, gccType)));
     525        51072 : }
     526              : 
     527              : 
     528              : /*
     529              :    MakeFixedSizedTypes - creates the SYSTEM fixed sized types providing the
     530              :                          gcc backend supports them.
     531              : */
     532              : 
     533        17024 : static void MakeFixedSizedTypes (void)
     534              : {
     535        17024 :   AttemptToCreateType ((const char *) "INTEGER8", 8, (const char *) "MinInteger8", 11, (const char *) "MaxInteger8", 11, true, m2type_GetM2Integer8 (), false);
     536        17024 :   AttemptToCreateType ((const char *) "INTEGER16", 9, (const char *) "MinInteger16", 12, (const char *) "MaxInteger16", 12, true, m2type_GetM2Integer16 (), false);
     537        17024 :   AttemptToCreateType ((const char *) "INTEGER32", 9, (const char *) "MinInteger32", 12, (const char *) "MaxInteger32", 12, true, m2type_GetM2Integer32 (), false);
     538        17024 :   AttemptToCreateType ((const char *) "INTEGER64", 9, (const char *) "MinInteger64", 12, (const char *) "MaxInteger64", 12, true, m2type_GetM2Integer64 (), false);
     539        17024 :   AttemptToCreateType ((const char *) "CARDINAL8", 9, (const char *) "MinCardinal8", 12, (const char *) "MaxCardinal8", 12, true, m2type_GetM2Cardinal8 (), false);
     540        17024 :   AttemptToCreateType ((const char *) "CARDINAL16", 10, (const char *) "MinCardinal16", 13, (const char *) "MaxCardinal16", 13, true, m2type_GetM2Cardinal16 (), false);
     541        17024 :   AttemptToCreateType ((const char *) "CARDINAL32", 10, (const char *) "MinCardinal32", 13, (const char *) "MaxCardinal32", 13, true, m2type_GetM2Cardinal32 (), false);
     542        17024 :   AttemptToCreateType ((const char *) "CARDINAL64", 10, (const char *) "MinCardinal64", 13, (const char *) "MaxCardinal64", 13, true, m2type_GetM2Cardinal64 (), false);
     543        17024 :   AttemptToCreateType ((const char *) "WORD16", 6, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Word16 (), false);
     544        17024 :   AttemptToCreateType ((const char *) "WORD32", 6, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Word32 (), false);
     545        17024 :   AttemptToCreateType ((const char *) "WORD64", 6, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Word64 (), false);
     546        17024 :   AttemptToCreateSetType ((const char *) "BITSET8", 7, (const char *) "7", 1, true, m2type_GetM2Bitset8 ());
     547        17024 :   AttemptToCreateSetType ((const char *) "BITSET16", 8, (const char *) "15", 2, true, m2type_GetM2Bitset16 ());
     548        17024 :   AttemptToCreateSetType ((const char *) "BITSET32", 8, (const char *) "31", 2, true, m2type_GetM2Bitset32 ());
     549        17024 :   AttemptToCreateType ((const char *) "REAL32", 6, (const char *) "MinReal32", 9, (const char *) "MaxReal32", 9, true, m2type_GetM2Real32 (), true);
     550        17024 :   AttemptToCreateType ((const char *) "REAL64", 6, (const char *) "MinReal64", 9, (const char *) "MaxReal64", 9, true, m2type_GetM2Real64 (), true);
     551        17024 :   AttemptToCreateType ((const char *) "REAL96", 6, (const char *) "MinReal96", 9, (const char *) "MaxReal96", 9, true, m2type_GetM2Real96 (), true);
     552        17024 :   AttemptToCreateType ((const char *) "REAL128", 7, (const char *) "MinReal128", 10, (const char *) "MaxReal128", 10, true, m2type_GetM2Real128 (), true);
     553        17024 :   AttemptToCreateType ((const char *) "COMPLEX32", 9, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Complex32 (), true);
     554        17024 :   AttemptToCreateType ((const char *) "COMPLEX64", 9, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Complex64 (), true);
     555        17024 :   AttemptToCreateType ((const char *) "COMPLEX96", 9, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Complex96 (), true);
     556        17024 :   AttemptToCreateType ((const char *) "COMPLEX128", 10, (const char *) "", 0, (const char *) "", 0, true, m2type_GetM2Complex128 (), true);
     557        17024 : }
     558              : 
     559              : 
     560              : /*
     561              :    InitPIMTypes -
     562              : */
     563              : 
     564        12723 : static void InitPIMTypes (void)
     565              : {
     566        12723 :   M2System_Loc = CreateType ((const char *) "LOC", 3, (const char *) "", 0, (const char *) "", 0, true, m2type_GetISOLocType (), false);
     567        12723 :   m2type_InitSystemTypes (m2linemap_BuiltinsLocation (), static_cast<int> (M2System_Loc));
     568        12723 :   M2System_Word = CreateType ((const char *) "WORD", 4, (const char *) "", 0, (const char *) "", 0, true, m2type_GetWordType (), false);
     569        12723 :   M2System_Byte = CreateType ((const char *) "BYTE", 4, (const char *) "", 0, (const char *) "", 0, true, m2type_GetByteType (), false);
     570              :   /* ADDRESS = POINTER TO BYTE  */
     571        12723 :   M2System_Address = SymbolTable_MakePointer (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "ADDRESS", 7));
     572        12723 :   SymbolTable_PutPointer (M2System_Address, M2System_Byte);  /* Base Type  */
     573        12723 :   MapType (M2System_Address, (const char *) "ADDRESS", 7, (const char *) "", 0, (const char *) "", 0, true, m2type_GetPointerType (), false);  /* Base Type  */
     574        12723 : }
     575              : 
     576              : 
     577              : /*
     578              :    InitISOTypes -
     579              : */
     580              : 
     581         4301 : static void InitISOTypes (void)
     582              : {
     583         4301 :   M2System_Loc = CreateType ((const char *) "LOC", 3, (const char *) "MinLoc", 6, (const char *) "MaxLoc", 6, true, m2type_GetISOLocType (), false);
     584         4301 :   m2type_InitSystemTypes (m2linemap_BuiltinsLocation (), static_cast<int> (M2System_Loc));
     585         4301 :   M2System_Address = SymbolTable_MakePointer (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "ADDRESS", 7));
     586         4301 :   SymbolTable_PutPointer (M2System_Address, M2System_Loc);  /* Base Type  */
     587         4301 :   MapType (M2System_Address, (const char *) "ADDRESS", 7, (const char *) "", 0, (const char *) "", 0, true, m2type_GetPointerType (), false);  /* Base Type  */
     588         4301 :   M2System_Byte = CreateType ((const char *) "BYTE", 4, (const char *) "", 0, (const char *) "", 0, true, m2type_GetISOByteType (), false);
     589         4301 :   M2System_Word = CreateType ((const char *) "WORD", 4, (const char *) "", 0, (const char *) "", 0, true, m2type_GetISOWordType (), false);
     590         4301 : }
     591              : 
     592              : 
     593              : /*
     594              :    MakeExtraSystemTypes - create any extra system types required
     595              :                           for portability.
     596              : */
     597              : 
     598        17024 : static void MakeExtraSystemTypes (void)
     599              : {
     600        17024 :   M2System_CSizeT = CreateType ((const char *) "CSIZE_T", 7, (const char *) "", 0, (const char *) "", 0, true, m2type_GetCSizeTType (), false);
     601        17024 :   M2System_CSSizeT = CreateType ((const char *) "CSSIZE_T", 8, (const char *) "", 0, (const char *) "", 0, true, m2type_GetCSSizeTType (), false);
     602        17024 :   M2System_COffT = CreateType ((const char *) "COFF_T", 6, (const char *) "", 0, (const char *) "", 0, true, m2type_GetCOffTType (), false);
     603        17024 : }
     604              : 
     605              : 
     606              : /*
     607              :    IsISOPseudoSystemFunction -
     608              : */
     609              : 
     610      4935426 : static bool IsISOPseudoSystemFunction (unsigned int sym)
     611              : {
     612      4935426 :   return M2Options_Iso && (((((((sym == M2System_AddAdr) || (sym == M2System_SubAdr)) || (sym == M2System_DifAdr)) || (sym == M2System_MakeAdr)) || (sym == M2System_Rotate)) || (sym == M2System_Shift)) || (sym == M2System_Cast));
     613              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     614              :   __builtin_unreachable ();
     615              : }
     616              : 
     617              : 
     618              : /*
     619              :    IsPIMPseudoSystemFunction - returns TRUE if sym is specifically a PIM
     620              :                                system function.
     621              : */
     622              : 
     623      4962956 : static bool IsPIMPseudoSystemFunction (unsigned int sym)
     624              : {
     625      4962956 :   return ! M2Options_Iso && (((sym == M2Size_Size) || (sym == M2System_Shift)) || (sym == M2System_Rotate));
     626              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     627              :   __builtin_unreachable ();
     628              : }
     629              : 
     630              : 
     631              : /*
     632              :    GetSafeSystem -
     633              : */
     634              : 
     635     59271487 : static unsigned int GetSafeSystem (NameKey_Name name)
     636              : {
     637     59271487 :   unsigned int sym;
     638     59271487 :   unsigned int i;
     639     59271487 :   unsigned int n;
     640              : 
     641     59271487 :   n = Lists_NoOfItemsInList (SystemTypes);
     642     59271487 :   i = 1;
     643   1116448484 :   while (i <= n)
     644              :     {
     645   1050067938 :       sym = static_cast<unsigned int> (Lists_GetItemFromList (SystemTypes, i));
     646   1050067938 :       if ((SymbolTable_GetSymName (sym)) == name)
     647              :         {
     648              :           return sym;
     649              :         }
     650    997905510 :       i += 1;
     651              :     }
     652              :   return SymbolTable_NulSym;
     653              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     654              :   __builtin_unreachable ();
     655              : }
     656              : 
     657              : 
     658              : /*
     659              :    IsSameType - returns TRUE if, t, is the same type as a or b
     660              :                 and a or b are a type, p.
     661              : */
     662              : 
     663            0 : static bool IsSameType (unsigned int t, M2System_IsP p, unsigned int a, unsigned int b)
     664              : {
     665            0 :   if (t == a)
     666              :     {
     667            0 :       return ((*p.proc) (b)) && (M2System_IsSameSize (a, b));
     668              :     }
     669            0 :   else if (t == b)
     670              :     {
     671              :       /* avoid dangling else.  */
     672            0 :       return ((*p.proc) (a)) && (M2System_IsSameSize (a, b));
     673              :     }
     674              :   else
     675              :     {
     676              :       /* avoid dangling else.  */
     677              :       return false;
     678              :     }
     679              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     680              :   __builtin_unreachable ();
     681              : }
     682              : 
     683              : 
     684              : /*
     685              :    InitSystem - creates the system dependant types and procedures.
     686              :                 Note that they are not exported here, but they are
     687              :                 exported in the textual module: SYSTEM.def.
     688              :                 We build our system types from those given in the gcc
     689              :                 backend. Essentially we perform double book keeping.
     690              : */
     691              : 
     692        17024 : extern "C" void M2System_InitSystem (void)
     693              : {
     694        17024 :   unsigned int Previous;
     695              : 
     696        17024 :   Init ();
     697              :   /* create SYSTEM module  */
     698        17024 :   M2System_System = M2Batch_MakeDefinitionSource (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SYSTEM", 6));
     699        17024 :   SymbolTable_StartScope (M2System_System);
     700        17024 :   Previous = SymbolTable_GetCurrentModule ();
     701        17024 :   SymbolTable_SetCurrentModule (M2System_System);
     702        17024 :   if (M2Options_Iso)
     703              :     {
     704         4301 :       InitISOTypes ();
     705         4301 :       M2Size_MakeSize ();
     706         4301 :       SymbolTable_PutExportQualified (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SIZE", 4));
     707              :     }
     708              :   else
     709              :     {
     710        12723 :       InitPIMTypes ();
     711              :       /* SIZE is declared in SYSTEM.def in PIM-2 but not PIM-[34]  */
     712        12723 :       if (M2Options_Pedantic)
     713              :         {
     714              :           /* avoid dangling else.  */
     715            0 :           if (M2Options_Pim2)
     716              :             {
     717            0 :               M2Size_MakeSize ();
     718            0 :               SymbolTable_PutExportQualified (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SIZE", 4));
     719              :             }
     720              :         }
     721              :       else
     722              :         {
     723        12723 :           M2Size_MakeSize ();
     724        12723 :           SymbolTable_PutExportQualified (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SIZE", 4));
     725              :         }
     726              :     }
     727              :   /* The predefined pseudo functions.  */
     728        17024 :   M2System_Adr = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "ADR", 3));  /* Function  */
     729        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_Adr, SymbolTable_DefProcedure, M2System_Address);
     730              :   /* Address  */
     731        17024 :   M2System_TSize = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "TSIZE", 5));  /* Function  */
     732        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_TSize, SymbolTable_DefProcedure, M2Base_ZType);
     733              :   /* ZType  */
     734        17024 :   M2System_TBitSize = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "TBITSIZE", 8));  /* GNU extension  */
     735              :   /* Function  */
     736        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_TBitSize, SymbolTable_DefProcedure, M2Base_ZType);
     737              :   /* The ISO specific predefined pseudo functions.  */
     738        17024 :   M2System_AddAdr = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "ADDADR", 6));  /* Function  */
     739        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_AddAdr, SymbolTable_DefProcedure, M2System_Address);
     740              :   /* Return Type  */
     741        17024 :   M2System_SubAdr = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SUBADR", 6));  /* Function  */
     742        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_SubAdr, SymbolTable_DefProcedure, M2System_Address);
     743              :   /* Return Type  */
     744        17024 :   M2System_DifAdr = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "DIFADR", 6));  /* Function  */
     745        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_DifAdr, SymbolTable_DefProcedure, M2System_Address);
     746              :   /* Return Type  */
     747        17024 :   M2System_MakeAdr = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "MAKEADR", 7));  /* Function  */
     748        17024 :   SymbolTable_PutFunction (M2LexBuf_BuiltinTokenNo, M2System_MakeAdr, SymbolTable_DefProcedure, M2System_Address);
     749              :   /* The return value for ROTATE, SHIFT and CAST is the
     750              :       same as the first parameter and is faked in M2Quads.  */
     751        17024 :   M2System_Rotate = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "ROTATE", 6));  /* Function  */
     752        17024 :   M2System_Shift = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "SHIFT", 5));  /* Function  */
     753        17024 :   M2System_Cast = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "CAST", 4));  /* Function  */
     754        17024 :   M2System_Throw = SymbolTable_MakeProcedure (M2LexBuf_BuiltinTokenNo, NameKey_MakeKey ((const char *) "THROW", 5));  /* Procedure  */
     755        17024 :   SymbolTable_PutProcedureNoReturn (M2System_Throw, SymbolTable_DefProcedure, true);  /* Procedure  */
     756        17024 :   CreateMinMaxFor (M2System_Word, (const char *) "MinWord", 7, (const char *) "MaxWord", 7, m2type_GetWordType (), false);
     757        17024 :   CreateMinMaxFor (M2System_Address, (const char *) "MinAddress", 10, (const char *) "MaxAddress", 10, m2type_GetPointerType (), false);
     758        17024 :   CreateMinMaxFor (M2System_Byte, (const char *) "MinByte", 7, (const char *) "MaxByte", 7, m2type_GetByteType (), false);
     759        17024 :   MakeFixedSizedTypes ();
     760        17024 :   MakeExtraSystemTypes ();
     761        17024 :   SymbolTable_EndScope ();
     762        17024 :   SymbolTable_SetCurrentModule (Previous);
     763        17024 : }
     764              : 
     765              : 
     766              : /*
     767              :    GetSystemTypeMinMax - returns the minimum and maximum values for a given system type.
     768              : */
     769              : 
     770          388 : extern "C" void M2System_GetSystemTypeMinMax (unsigned int type, unsigned int *min, unsigned int *max)
     771              : {
     772          388 :   if (Lists_IsItemInList (SystemTypes, type))
     773              :     {
     774          388 :       (*min) = static_cast<unsigned int> (SymbolKey_GetSymKey (MinValues, SymbolTable_GetSymName (type)));
     775          388 :       (*max) = static_cast<unsigned int> (SymbolKey_GetSymKey (MaxValues, SymbolTable_GetSymName (type)));
     776              :     }
     777              :   else
     778              :     {
     779            0 :       M2Error_InternalError ((const char *) "system does not know about this type", 36);
     780              :     }
     781          388 : }
     782              : 
     783              : 
     784              : /*
     785              :    IsPseudoSystemFunction - returns true if sym is a SYSTEM pseudo function.
     786              : */
     787              : 
     788      5033875 : extern "C" bool M2System_IsPseudoSystemFunction (unsigned int sym)
     789              : {
     790      5033875 :   return ((((sym == M2System_Adr) || (sym == M2System_TSize)) || (sym == M2System_TBitSize)) || (IsPIMPseudoSystemFunction (sym))) || (IsISOPseudoSystemFunction (sym));
     791              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     792              :   __builtin_unreachable ();
     793              : }
     794              : 
     795              : 
     796              : /*
     797              :    IsPseudoSystemProcedure - returns true if sym is a SYSTEM pseudo procedure.
     798              : */
     799              : 
     800       171134 : extern "C" bool M2System_IsPseudoSystemProcedure (unsigned int sym)
     801              : {
     802       171134 :   return sym == M2System_Throw;
     803              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     804              :   __builtin_unreachable ();
     805              : }
     806              : 
     807              : 
     808              : /*
     809              :    IsPseudoSystemFunctionConstExpression - returns TRUE if this procedure
     810              :                                            is legal in a constant expression.
     811              : */
     812              : 
     813        11172 : extern "C" bool M2System_IsPseudoSystemFunctionConstExpression (unsigned int sym)
     814              : {
     815        11172 :   return (((((sym == M2Size_Size) || (sym == M2System_TSize)) || (sym == M2System_TBitSize)) || (sym == M2System_Rotate)) || (sym == M2System_Shift)) || (M2Options_Iso && (((sym == M2System_Cast) || (sym == M2System_MakeAdr)) || (sym == M2System_TBitSize)));
     816              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     817              :   __builtin_unreachable ();
     818              : }
     819              : 
     820              : 
     821              : /*
     822              :    IsSystemType - returns TRUE if sym is a SYSTEM (inbuilt) type.
     823              :                   It does not search your SYSTEM implementation module.
     824              : */
     825              : 
     826      1731526 : extern "C" bool M2System_IsSystemType (unsigned int sym)
     827              : {
     828      1731526 :   return Lists_IsItemInList (SystemTypes, sym);
     829              :   /* static analysis guarentees a RETURN statement will be used before here.  */
     830              :   __builtin_unreachable ();
     831              : }
     832              : 
     833              : 
     834              : /*
     835              :    IntegerN - returns the symbol associated with INTEGER[N].
     836              :               NulSym is returned if the type does not exist.
     837              : */
     838              : 
     839      4820376 : extern "C" unsigned int M2System_IntegerN (unsigned int bitlength)
     840              : {
     841      4820376 :   switch (bitlength)
     842              :     {
     843      1263096 :       case 8:
     844      1263096 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "INTEGER8", 8));
     845      1222578 :         break;
     846              : 
     847      1222578 :       case 16:
     848      1222578 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "INTEGER16", 9));
     849      1184994 :         break;
     850              : 
     851      1184994 :       case 32:
     852      1184994 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "INTEGER32", 9));
     853      1149708 :         break;
     854              : 
     855      1149708 :       case 64:
     856      1149708 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "INTEGER64", 9));
     857            0 :         break;
     858              : 
     859              : 
     860            0 :       default:
     861            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
     862              :         break;
     863              :     }
     864              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
     865              :   __builtin_unreachable ();
     866              : }
     867              : 
     868              : 
     869              : /*
     870              :    CardinalN - returns the symbol associated with CARDINAL[N].
     871              :                NulSym is returned if the type does not exist.
     872              : */
     873              : 
     874      4243224 : extern "C" unsigned int M2System_CardinalN (unsigned int bitlength)
     875              : {
     876      4243224 :   switch (bitlength)
     877              :     {
     878      1117464 :       case 8:
     879      1117464 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "CARDINAL8", 9));
     880      1077398 :         break;
     881              : 
     882      1077398 :       case 16:
     883      1077398 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "CARDINAL16", 10));
     884      1042682 :         break;
     885              : 
     886      1042682 :       case 32:
     887      1042682 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "CARDINAL32", 10));
     888      1005680 :         break;
     889              : 
     890      1005680 :       case 64:
     891      1005680 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "CARDINAL64", 10));
     892            0 :         break;
     893              : 
     894              : 
     895            0 :       default:
     896            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
     897              :         break;
     898              :     }
     899              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
     900              :   __builtin_unreachable ();
     901              : }
     902              : 
     903              : 
     904              : /*
     905              :    WordN - returns the symbol associated with WORD[N].
     906              :            NulSym is returned if the type does not exist.
     907              : */
     908              : 
     909     20190801 : extern "C" unsigned int M2System_WordN (unsigned int bitlength)
     910              : {
     911     20190801 :   switch (bitlength)
     912              :     {
     913      6733071 :       case 16:
     914      6733071 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "WORD16", 6));
     915      6733071 :         break;
     916              : 
     917      6733071 :       case 32:
     918      6733071 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "WORD32", 6));
     919      6724659 :         break;
     920              : 
     921      6724659 :       case 64:
     922      6724659 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "WORD64", 6));
     923            0 :         break;
     924              : 
     925              : 
     926            0 :       default:
     927            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
     928              :         break;
     929              :     }
     930              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
     931              :   __builtin_unreachable ();
     932              : }
     933              : 
     934              : 
     935              : /*
     936              :    SetN - returns the symbol associated with SET[N].
     937              :           NulSym is returned if the type does not exist.
     938              : */
     939              : 
     940      1563816 : extern "C" unsigned int M2System_SetN (unsigned int bitlength)
     941              : {
     942      1563816 :   switch (bitlength)
     943              :     {
     944       521272 :       case 8:
     945       521272 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "BITSET8", 7));
     946       521272 :         break;
     947              : 
     948       521272 :       case 16:
     949       521272 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "BITSET16", 8));
     950       521272 :         break;
     951              : 
     952       521272 :       case 32:
     953       521272 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "BITSET32", 8));
     954            0 :         break;
     955              : 
     956              : 
     957            0 :       default:
     958            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
     959              :         break;
     960              :     }
     961              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
     962              :   __builtin_unreachable ();
     963              : }
     964              : 
     965              : 
     966              : /*
     967              :    RealN - returns the symbol associated with REAL[N].
     968              :            NulSym is returned if the type does not exist.
     969              : */
     970              : 
     971      7788446 : extern "C" unsigned int M2System_RealN (unsigned int bitlength)
     972              : {
     973      7788446 :   switch (bitlength)
     974              :     {
     975      1959644 :       case 32:
     976      1959644 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "REAL32", 6));
     977      1943078 :         break;
     978              : 
     979      1943078 :       case 64:
     980      1943078 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "REAL64", 6));
     981      1942862 :         break;
     982              : 
     983      1942862 :       case 96:
     984      1942862 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "REAL96", 6));
     985      1942862 :         break;
     986              : 
     987      1942862 :       case 128:
     988      1942862 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "REAL128", 7));
     989            0 :         break;
     990              : 
     991              : 
     992            0 :       default:
     993            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
     994              :         break;
     995              :     }
     996              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
     997              :   __builtin_unreachable ();
     998              : }
     999              : 
    1000              : 
    1001              : /*
    1002              :    ComplexN - returns the symbol associated with COMPLEX[N].
    1003              :               NulSym is returned if the type does not exist.
    1004              : */
    1005              : 
    1006     20664824 : extern "C" unsigned int M2System_ComplexN (unsigned int bitlength)
    1007              : {
    1008     20664824 :   switch (bitlength)
    1009              :     {
    1010      5166233 :       case 32:
    1011      5166233 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "COMPLEX32", 9));
    1012      5166197 :         break;
    1013              : 
    1014      5166197 :       case 64:
    1015      5166197 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "COMPLEX64", 9));
    1016      5166197 :         break;
    1017              : 
    1018      5166197 :       case 96:
    1019      5166197 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "COMPLEX96", 9));
    1020      5166197 :         break;
    1021              : 
    1022      5166197 :       case 128:
    1023      5166197 :         return GetSafeSystem (NameKey_MakeKey ((const char *) "COMPLEX128", 10));
    1024            0 :         break;
    1025              : 
    1026              : 
    1027            0 :       default:
    1028            0 :         M2Error_InternalError ((const char *) "system does not know about this type", 36);
    1029              :         break;
    1030              :     }
    1031              :   ReturnException ("/home/worker/buildworker/tiber-lcov/build/gcc/m2/gm2-compiler/M2System.def", 20, 1);
    1032              :   __builtin_unreachable ();
    1033              : }
    1034              : 
    1035              : 
    1036              : /*
    1037              :    IsIntegerN - returns the TRUE if, sym, is one of the SYSTEM
    1038              :                 INTEGER types (not the base INTEGER type).
    1039              : */
    1040              : 
    1041       767187 : extern "C" bool M2System_IsIntegerN (unsigned int sym)
    1042              : {
    1043       767187 :   return (sym != SymbolTable_NulSym) && ((((sym == (M2System_IntegerN (8))) || (sym == (M2System_IntegerN (16)))) || (sym == (M2System_IntegerN (32)))) || (sym == (M2System_IntegerN (64))));
    1044              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1045              :   __builtin_unreachable ();
    1046              : }
    1047              : 
    1048              : 
    1049              : /*
    1050              :    IsCardinalN - returns the TRUE if, sym, is one of the SYSTEM
    1051              :                  CARDINAL types (not the base CARDINAL type).
    1052              : */
    1053              : 
    1054       766839 : extern "C" bool M2System_IsCardinalN (unsigned int sym)
    1055              : {
    1056       766839 :   return (sym != SymbolTable_NulSym) && ((((sym == (M2System_CardinalN (8))) || (sym == (M2System_CardinalN (16)))) || (sym == (M2System_CardinalN (32)))) || (sym == (M2System_CardinalN (64))));
    1057              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1058              :   __builtin_unreachable ();
    1059              : }
    1060              : 
    1061              : 
    1062              : /*
    1063              :    IsWordN - returns the TRUE if, sym, is one of the SYSTEM
    1064              :              WORD[n] types (not the default SYSTEM WORD type).
    1065              : */
    1066              : 
    1067      6544924 : extern "C" bool M2System_IsWordN (unsigned int sym)
    1068              : {
    1069      6544924 :   return (sym != SymbolTable_NulSym) && (((sym == (M2System_WordN (16))) || (sym == (M2System_WordN (32)))) || (sym == (M2System_WordN (64))));
    1070              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1071              :   __builtin_unreachable ();
    1072              : }
    1073              : 
    1074              : 
    1075              : /*
    1076              :    IsSetN - returns the TRUE if, sym, is one of the SYSTEM
    1077              :             SET[n] types (not the default SYSTEM BITSET type).
    1078              : */
    1079              : 
    1080       323689 : extern "C" bool M2System_IsSetN (unsigned int sym)
    1081              : {
    1082       323689 :   return (sym != SymbolTable_NulSym) && (((sym == (M2System_SetN (8))) || (sym == (M2System_SetN (16)))) || (sym == (M2System_SetN (32))));
    1083              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1084              :   __builtin_unreachable ();
    1085              : }
    1086              : 
    1087              : 
    1088              : /*
    1089              :    IsRealN - returns the TRUE if, sym, is one of the SYSTEM
    1090              :              REAL[n] types (not the default base REAL type).
    1091              : */
    1092              : 
    1093      1763107 : extern "C" bool M2System_IsRealN (unsigned int sym)
    1094              : {
    1095      1763107 :   return (sym != SymbolTable_NulSym) && ((((sym == (M2System_RealN (32))) || (sym == (M2System_RealN (64)))) || (sym == (M2System_RealN (96)))) || (sym == (M2System_RealN (128))));
    1096              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1097              :   __builtin_unreachable ();
    1098              : }
    1099              : 
    1100              : 
    1101              : /*
    1102              :    IsComplexN - returns the TRUE if, sym, is one of the SYSTEM
    1103              :                 COMPLEX[n] types (not the default base COMPLEX,
    1104              :                 LONGCOMPLEX or SHORTCOMPLEX types).
    1105              : */
    1106              : 
    1107      5057290 : extern "C" bool M2System_IsComplexN (unsigned int sym)
    1108              : {
    1109      5057290 :   return (sym != SymbolTable_NulSym) && ((((sym == (M2System_ComplexN (32))) || (sym == (M2System_ComplexN (64)))) || (sym == (M2System_ComplexN (96)))) || (sym == (M2System_ComplexN (128))));
    1110              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1111              :   __builtin_unreachable ();
    1112              : }
    1113              : 
    1114              : 
    1115              : /*
    1116              :    IsGenericSystemType - returns TRUE if, sym, is of type
    1117              :                          BYTE, WORD or any other length.
    1118              : */
    1119              : 
    1120      4000494 : extern "C" bool M2System_IsGenericSystemType (unsigned int sym)
    1121              : {
    1122      4000494 :   return (sym != SymbolTable_NulSym) && ((((M2System_IsWordN (sym)) || (sym == M2System_Word)) || (sym == M2System_Byte)) || (sym == M2System_Loc));
    1123              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1124              :   __builtin_unreachable ();
    1125              : }
    1126              : 
    1127              : 
    1128              : /*
    1129              :    IsSameSizePervasiveType - returns TRUE if a or b are CARDINAL, INTEGER, REAL,
    1130              :                              LONGREAL, SHORTREAL and the other type is the same
    1131              :                              size and of the same type.
    1132              : */
    1133              : 
    1134            0 : extern "C" bool M2System_IsSameSizePervasiveType (unsigned int a, unsigned int b)
    1135              : {
    1136            0 :   return ((((((((((((IsSameType (M2Base_Integer, (M2System_IsP) {(M2System_IsP_t) M2System_IsIntegerN}, a, b)) || (IsSameType (M2Base_Cardinal, (M2System_IsP) {(M2System_IsP_t) M2System_IsCardinalN}, a, b))) || (IsSameType (M2System_Word, (M2System_IsP) {(M2System_IsP_t) M2System_IsWordN}, a, b))) || (IsSameType (M2Base_Real, (M2System_IsP) {(M2System_IsP_t) M2System_IsRealN}, a, b))) || (IsSameType (M2Base_Complex, (M2System_IsP) {(M2System_IsP_t) M2System_IsComplexN}, a, b))) || (IsSameType (M2Base_LongInt, (M2System_IsP) {(M2System_IsP_t) M2System_IsIntegerN}, a, b))) || (IsSameType (M2Base_LongCard, (M2System_IsP) {(M2System_IsP_t) M2System_IsCardinalN}, a, b))) || (IsSameType (M2Base_LongComplex, (M2System_IsP) {(M2System_IsP_t) M2System_IsComplexN}, a, b))) || (IsSameType (M2Base_LongReal, (M2System_IsP) {(M2System_IsP_t) M2System_IsRealN}, a, b))) || (IsSameType (M2Base_ShortInt, (M2System_IsP) {(M2System_IsP_t) M2System_IsIntegerN}, a, b))) || (IsSameType (M2Base_ShortCard, (M2System_IsP) {(M2System_IsP_t) M2System_IsCardinalN}, a, b))) || (IsSameType (M2Base_ShortComplex, (M2System_IsP) {(M2System_IsP_t) M2System_IsComplexN}, a, b))) || (IsSameType (M2Base_ShortReal, (M2System_IsP) {(M2System_IsP_t) M2System_IsRealN}, a, b));
    1137              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1138              :   __builtin_unreachable ();
    1139              : }
    1140              : 
    1141              : 
    1142              : /*
    1143              :    IsSameSize - return TRUE if SIZE(a)=SIZE(b)
    1144              : */
    1145              : 
    1146        12646 : extern "C" bool M2System_IsSameSize (unsigned int a, unsigned int b)
    1147              : {
    1148        12646 :   return m2expr_AreConstantsEqual (m2expr_BuildSize (m2linemap_BuiltinsLocation (), SymbolConversion_Mod2Gcc (a), false), m2expr_BuildSize (m2linemap_BuiltinsLocation (), SymbolConversion_Mod2Gcc (b), false));
    1149              :   /* static analysis guarentees a RETURN statement will be used before here.  */
    1150              :   __builtin_unreachable ();
    1151              : }
    1152              : 
    1153        17024 : extern "C" void _M2_M2System_init (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
    1154              : {
    1155        17024 : }
    1156              : 
    1157            0 : extern "C" void _M2_M2System_fini (__attribute__((unused)) int argc, __attribute__((unused)) char *argv[], __attribute__((unused)) char *envp[])
    1158              : {
    1159            0 : }
        

Generated by: LCOV version 2.4-beta

LCOV profile is generated on x86_64 machine using following configure options: configure --disable-bootstrap --enable-coverage=opt --enable-languages=c,c++,fortran,go,jit,lto,rust,m2 --enable-host-shared. GCC test suite is run with the built compiler.