mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Simplify parameterisable memory model variables.
This commit is contained in:
parent
20a97bb570
commit
1c94abedc6
201 changed files with 607 additions and 763 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -18,6 +18,6 @@ export void *Configuration__init(void)
|
|||
__DEFMOD;
|
||||
__REGMOD("Configuration", 0);
|
||||
/* BEGIN */
|
||||
__MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Configuration__h
|
||||
#define Configuration__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Console__h
|
||||
#define Console__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef Files__h
|
||||
#define Files__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
|
||||
|
||||
#ifndef Heap__h
|
||||
#define Heap__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Modules__h
|
||||
#define Modules__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
|
|||
OPB_err(126);
|
||||
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
|
||||
OPB_Convert(&x, OPT_linttyp);
|
||||
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) {
|
||||
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
|
||||
OPB_err(111);
|
||||
x->typ = OPT_linttyp;
|
||||
}
|
||||
|
|
@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
|
|||
OPB_err(126);
|
||||
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
|
||||
OPB_Convert(&x, OPT_linttyp);
|
||||
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) {
|
||||
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
|
||||
OPB_err(111);
|
||||
x->typ = OPT_linttyp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPB__h
|
||||
#define OPB__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ)
|
|||
OPC_Str1((CHAR*)", #), {", 8, typ->size);
|
||||
nofptrs = 0;
|
||||
OPC_PutPtrOffsets(typ, 0, &nofptrs);
|
||||
OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize));
|
||||
OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize));
|
||||
OPC_EndStat();
|
||||
}
|
||||
|
||||
|
|
@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
|
|||
if (OPC_ansi) {
|
||||
OPM_WriteInt(array->n);
|
||||
} else {
|
||||
OPC_IntLiteral(array->n, OPM_PointerSize);
|
||||
OPC_IntLiteral(array->n, OPM_AddressSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPC__h
|
||||
#define OPC__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -19,7 +19,7 @@ typedef
|
|||
|
||||
|
||||
static CHAR OPM_SourceFileName[256];
|
||||
export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet;
|
||||
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
export BOOLEAN OPM_noerr;
|
||||
|
|
@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
|||
case 'B':
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_IntSize = (int16)s[__X(i, s__len)] - 48;
|
||||
OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_PointerSize = (int16)s[__X(i, s__len)] - 48;
|
||||
OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
|
||||
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
||||
__ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
|
||||
__ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
|
||||
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
|
||||
if (OPM_IntegerSize == 2) {
|
||||
OPM_LongintSize = 4;
|
||||
OPM_SetSize = 4;
|
||||
} else {
|
||||
OPM_LongintSize = 8;
|
||||
OPM_SetSize = 8;
|
||||
}
|
||||
Files_SetSearchPath((CHAR*)"", 1);
|
||||
break;
|
||||
case 'F':
|
||||
|
|
@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j)
|
|||
static void OPM_VerboseListSizes (void)
|
||||
{
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"Type Size Alignement", 29);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"CHAR ", 14);
|
||||
OPM_LogWNum(OPM_CharSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
|
||||
OPM_LogWNum(OPM_BoolSize, 4);
|
||||
OPM_LogWStr((CHAR*)"Type Size", 17);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"SHORTINT ", 14);
|
||||
OPM_LogWNum(OPM_SIntSize, 4);
|
||||
OPM_LogWNum(OPM_ShortintSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"INTEGER ", 14);
|
||||
OPM_LogWNum(OPM_IntSize, 4);
|
||||
OPM_LogWNum(OPM_IntegerSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"LONGINT ", 14);
|
||||
OPM_LogWNum(OPM_LIntSize, 4);
|
||||
OPM_LogWNum(OPM_LongintSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"SET ", 14);
|
||||
OPM_LogWNum(OPM_SetSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"REAL ", 14);
|
||||
OPM_LogWNum(OPM_RealSize, 4);
|
||||
OPM_LogWStr((CHAR*)"ADDRESS ", 14);
|
||||
OPM_LogWNum(OPM_AddressSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
|
||||
OPM_LogWNum(OPM_LRealSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"PTR ", 14);
|
||||
OPM_LogWNum(OPM_PointerSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"PROC ", 14);
|
||||
OPM_LogWNum(OPM_ProcSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"RECORD ", 14);
|
||||
OPM_LogWNum(OPM_RecSize, 4);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"Alignment: ", 12);
|
||||
OPM_LogWNum(OPM_Alignment, 4);
|
||||
OPM_LogWLn();
|
||||
}
|
||||
|
||||
|
|
@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount)
|
|||
|
||||
static void OPM_GetProperties (void)
|
||||
{
|
||||
OPM_ProcSize = OPM_PointerSize;
|
||||
OPM_LIntSize = __ASHL(OPM_IntSize, 1);
|
||||
OPM_SetSize = OPM_LIntSize;
|
||||
if (OPM_RealSize == 4) {
|
||||
OPM_MaxReal = 3.40282346000000e+038;
|
||||
} else if (OPM_RealSize == 8) {
|
||||
OPM_MaxReal = 1.79769296342094e+308;
|
||||
}
|
||||
if (OPM_LRealSize == 4) {
|
||||
OPM_MaxLReal = 3.40282346000000e+038;
|
||||
} else if (OPM_LRealSize == 8) {
|
||||
OPM_MaxLReal = 1.79769296342094e+308;
|
||||
}
|
||||
OPM_MaxReal = 3.40282346000000e+038;
|
||||
OPM_MaxLReal = 1.79769296342094e+308;
|
||||
OPM_MinReal = -OPM_MaxReal;
|
||||
OPM_MinLReal = -OPM_MaxLReal;
|
||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize);
|
||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
||||
if (OPM_Verbose) {
|
||||
OPM_VerboseListSizes();
|
||||
}
|
||||
|
|
@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i)
|
|||
{
|
||||
CHAR s[24];
|
||||
int64 i1, k;
|
||||
if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) {
|
||||
if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
|
||||
OPM_Write('(');
|
||||
OPM_WriteInt(i + 1);
|
||||
OPM_WriteString((CHAR*)"-1)", 4);
|
||||
|
|
@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
|
|||
CHAR s[32];
|
||||
CHAR ch;
|
||||
int16 i;
|
||||
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) {
|
||||
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
|
||||
if (suffx == 'f') {
|
||||
OPM_WriteString((CHAR*)"(REAL)", 7);
|
||||
} else {
|
||||
|
|
@ -1073,15 +1054,11 @@ export void *OPM__init(void)
|
|||
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
|
||||
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
|
||||
Files_SetSearchPath(OPM_OBERON, 1024);
|
||||
OPM_CharSize = 1;
|
||||
OPM_BoolSize = 1;
|
||||
OPM_SIntSize = 1;
|
||||
OPM_RecSize = 1;
|
||||
OPM_ByteSize = 1;
|
||||
OPM_RealSize = 4;
|
||||
OPM_LRealSize = 8;
|
||||
OPM_PointerSize = 8;
|
||||
OPM_AddressSize = 8;
|
||||
OPM_Alignment = 8;
|
||||
OPM_IntSize = 4;
|
||||
OPM_ShortintSize = 1;
|
||||
OPM_IntegerSize = 4;
|
||||
OPM_LongintSize = 8;
|
||||
OPM_SetSize = 8;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPM__h
|
||||
#define OPM__h
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
#include "SYSTEM.h"
|
||||
|
||||
|
||||
import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet;
|
||||
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
|
||||
import int64 OPM_MaxIndex;
|
||||
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
import BOOLEAN OPM_noerr;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPP__h
|
||||
#define OPP__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
|
||||
|
||||
#ifndef OPS__h
|
||||
#define OPS__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -89,7 +89,7 @@ typedef
|
|||
|
||||
export void (*OPT_typSize)(OPT_Struct);
|
||||
export OPT_Object OPT_topScope;
|
||||
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
export int8 OPT_nofGmod;
|
||||
export OPT_Object OPT_GlbMod[64];
|
||||
|
|
@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ)
|
|||
switch (tag) {
|
||||
case 36:
|
||||
(*typ)->form = 11;
|
||||
(*typ)->size = OPM_PointerSize;
|
||||
(*typ)->size = OPM_AddressSize;
|
||||
(*typ)->n = 0;
|
||||
OPT_InStruct(&(*typ)->BaseTyp);
|
||||
break;
|
||||
|
|
@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ)
|
|||
break;
|
||||
case 40:
|
||||
(*typ)->form = 12;
|
||||
(*typ)->size = OPM_ProcSize;
|
||||
(*typ)->size = OPM_AddressSize;
|
||||
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
|
|||
{
|
||||
*typ = OPT_NewStr(form, 1);
|
||||
(*typ)->ref = form;
|
||||
(*typ)->size = OPM_ByteSize;
|
||||
(*typ)->size = 1;
|
||||
(*typ)->allocated = 1;
|
||||
(*typ)->strobj = OPT_NewObj();
|
||||
(*typ)->pbfp = form;
|
||||
|
|
@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*))
|
|||
P(OPT_sinttyp);
|
||||
P(OPT_inttyp);
|
||||
P(OPT_linttyp);
|
||||
P(OPT_hinttyp);
|
||||
P(OPT_adrtyp);
|
||||
P(OPT_int8typ);
|
||||
P(OPT_int16typ);
|
||||
|
|
@ -1916,9 +1917,9 @@ export void *OPT__init(void)
|
|||
OPT_InitStruct(&OPT_notyp, 10);
|
||||
OPT_InitStruct(&OPT_stringtyp, 8);
|
||||
OPT_InitStruct(&OPT_niltyp, 9);
|
||||
OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp);
|
||||
OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp);
|
||||
OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp);
|
||||
OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp);
|
||||
OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp);
|
||||
OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp);
|
||||
OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ);
|
||||
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
|
||||
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
|
||||
|
|
@ -1938,11 +1939,12 @@ export void *OPT__init(void)
|
|||
OPT_syslink = OPT_topScope->right;
|
||||
OPT_universe = OPT_topScope;
|
||||
OPT_topScope->right = NIL;
|
||||
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp);
|
||||
OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp);
|
||||
OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp);
|
||||
OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp);
|
||||
OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp);
|
||||
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
|
||||
OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
|
||||
OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
|
||||
OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
|
||||
OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
|
||||
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
|
||||
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
|
||||
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPT__h
|
||||
#define OPT__h
|
||||
|
|
@ -68,7 +68,7 @@ typedef
|
|||
|
||||
import void (*OPT_typSize)(OPT_Struct);
|
||||
import OPT_Object OPT_topScope;
|
||||
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
|
||||
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
|
||||
import int8 OPT_nofGmod;
|
||||
import OPT_Object OPT_GlbMod[64];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ)
|
|||
btyp = typ->BaseTyp;
|
||||
if (btyp == NIL) {
|
||||
offset = 0;
|
||||
base = OPC_SizeAlignment(OPM_RecSize);
|
||||
base = 1;
|
||||
} else {
|
||||
OPV_TypSize(btyp);
|
||||
offset = btyp->size - __ASHR(btyp->sysflag, 8);
|
||||
|
|
@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ)
|
|||
OPV_TypSize(typ->BaseTyp);
|
||||
typ->size = typ->n * typ->BaseTyp->size;
|
||||
} else if (f == 11) {
|
||||
typ->size = OPM_PointerSize;
|
||||
typ->size = OPM_AddressSize;
|
||||
if (typ->BaseTyp == OPT_undftyp) {
|
||||
OPM_Mark(128, typ->n);
|
||||
} else {
|
||||
OPV_TypSize(typ->BaseTyp);
|
||||
}
|
||||
} else if (f == 12) {
|
||||
typ->size = OPM_ProcSize;
|
||||
typ->size = OPM_AddressSize;
|
||||
} else if (c == 3) {
|
||||
btyp = typ->BaseTyp;
|
||||
OPV_TypSize(btyp);
|
||||
|
|
@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
|
|||
OPT_int16typ->strobj->linkadr = 2;
|
||||
OPT_int32typ->strobj->linkadr = 2;
|
||||
OPT_int64typ->strobj->linkadr = 2;
|
||||
OPT_hinttyp->strobj->linkadr = 2;
|
||||
OPT_lrltyp->strobj->linkadr = 2;
|
||||
OPT_booltyp->strobj->linkadr = 2;
|
||||
OPT_bytetyp->strobj->linkadr = 2;
|
||||
|
|
@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
|||
} else if (comp == 3) {
|
||||
if (n->class == 7) {
|
||||
OPM_WriteString((CHAR*)", ", 3);
|
||||
OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize);
|
||||
OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize);
|
||||
} else {
|
||||
aptyp = n->typ;
|
||||
dim = 0;
|
||||
|
|
@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
|||
dim += 1;
|
||||
aptyp = aptyp->BaseTyp;
|
||||
}
|
||||
OPV_ParIntLiteral(aptyp->size, OPM_PointerSize);
|
||||
OPV_ParIntLiteral(aptyp->size, OPM_AddressSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
|
|||
OPM_WriteString((CHAR*)", ", 3);
|
||||
if (typ->comp == 3) {
|
||||
if (x->class == 7) {
|
||||
OPC_IntLiteral(x->conval->intval, OPM_PointerSize);
|
||||
OPC_IntLiteral(x->conval->intval, OPM_AddressSize);
|
||||
} else {
|
||||
OPM_WriteString((CHAR*)"((address)(", 12);
|
||||
OPV_expr(x, 10);
|
||||
|
|
@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
|
|||
}
|
||||
x = x->link;
|
||||
} else {
|
||||
OPC_IntLiteral(typ->n, OPM_PointerSize);
|
||||
OPC_IntLiteral(typ->n, OPM_AddressSize);
|
||||
}
|
||||
typ = typ->BaseTyp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef OPV__h
|
||||
#define OPV__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Platform__h
|
||||
#define Platform__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Reals__h
|
||||
#define Reals__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Strings__h
|
||||
#define Strings__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef Texts__h
|
||||
#define Texts__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done)
|
|||
|
||||
static void Vishap_PropagateElementaryTypeSizes (void)
|
||||
{
|
||||
OPT_bytetyp->size = OPM_ByteSize;
|
||||
OPT_sysptrtyp->size = OPM_PointerSize;
|
||||
OPT_chartyp->size = OPM_CharSize;
|
||||
OPT_sysptrtyp->size = OPM_AddressSize;
|
||||
OPT_adrtyp->size = OPM_AddressSize;
|
||||
OPT_settyp->size = OPM_SetSize;
|
||||
OPT_realtyp->size = OPM_RealSize;
|
||||
OPT_adrtyp->size = OPM_PointerSize;
|
||||
OPT_lrltyp->size = OPM_LRealSize;
|
||||
OPT_booltyp->size = OPM_BoolSize;
|
||||
OPT_sinttyp = OPT_int8typ;
|
||||
if (OPM_IntSize == 2) {
|
||||
OPT_inttyp = OPT_int16typ;
|
||||
OPT_linttyp = OPT_int32typ;
|
||||
} else {
|
||||
OPT_inttyp = OPT_int32typ;
|
||||
OPT_linttyp = OPT_int64typ;
|
||||
}
|
||||
OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
|
||||
OPT_inttyp = OPT_IntType(OPM_IntegerSize);
|
||||
OPT_linttyp = OPT_IntType(OPM_LongintSize);
|
||||
OPT_sintobj->typ = OPT_sinttyp;
|
||||
OPT_intobj->typ = OPT_inttyp;
|
||||
OPT_lintobj->typ = OPT_linttyp;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef errors__h
|
||||
#define errors__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef extTools__h
|
||||
#define extTools__h
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */
|
||||
/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
|
||||
|
||||
#ifndef vt100__h
|
||||
#define vt100__h
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue