mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 06:22:25 +00:00
Make address strobj be equiv int type and remove param checking hack.
This commit is contained in:
parent
d683df3e72
commit
8ab4057a10
3 changed files with 14 additions and 10 deletions
|
|
@ -1380,11 +1380,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ;
|
WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ;
|
||||||
IF q = NIL THEN err(111) END
|
IF q = NIL THEN err(111) END
|
||||||
ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *)
|
ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *)
|
||||||
ELSIF (ap^.typ # fp^.typ) THEN
|
ELSIF (ap^.typ # fp^.typ)
|
||||||
IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *)
|
& ~( (fp^.typ^.form = OPT.Byte)
|
||||||
ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *)
|
& (ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int})
|
||||||
ELSE err(123)
|
& (ap.typ.size = 1)) THEN err(123)
|
||||||
END
|
|
||||||
ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123)
|
ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123)
|
||||||
END
|
END
|
||||||
ELSIF fp^.typ^.comp = OPT.DynArr THEN
|
ELSIF fp^.typ^.comp = OPT.DynArr THEN
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,15 @@ MODULE Vishap; (* J. Templ 3.2.95 *)
|
||||||
|
|
||||||
|
|
||||||
PROCEDURE PropagateElementaryTypeSizes;
|
PROCEDURE PropagateElementaryTypeSizes;
|
||||||
|
VAR adrinttyp: OPT.Struct;
|
||||||
BEGIN
|
BEGIN
|
||||||
OPT.sysptrtyp.size := OPM.AddressSize;
|
OPT.sysptrtyp.size := OPM.AddressSize;
|
||||||
OPT.adrtyp.size := OPM.AddressSize;
|
OPT.adrtyp.size := OPM.AddressSize;
|
||||||
OPT.settyp.size := OPM.SetSize;
|
OPT.settyp.size := OPM.SetSize;
|
||||||
|
|
||||||
|
adrinttyp := OPT.IntType(OPM.AddressSize);
|
||||||
|
OPT.adrtyp.strobj := adrinttyp.strobj;
|
||||||
|
|
||||||
OPT.sinttyp := OPT.IntType(OPM.ShortintSize);
|
OPT.sinttyp := OPT.IntType(OPM.ShortintSize);
|
||||||
OPT.inttyp := OPT.IntType(OPM.IntegerSize);
|
OPT.inttyp := OPT.IntType(OPM.IntegerSize);
|
||||||
OPT.linttyp := OPT.IntType(OPM.LongintSize);
|
OPT.linttyp := OPT.IntType(OPM.LongintSize);
|
||||||
|
|
|
||||||
|
|
@ -126,26 +126,27 @@ void determineOS() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define optimize " -O1"
|
||||||
|
|
||||||
void determineCCompiler() {
|
void determineCCompiler() {
|
||||||
snprintf(libspec, sizeof(libspec), " -l %s", oname);
|
snprintf(libspec, sizeof(libspec), " -l %s", oname);
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
compiler = "mingw";
|
compiler = "mingw";
|
||||||
if (sizeof (void*) == 4) {
|
if (sizeof (void*) == 4) {
|
||||||
cc = "i686-w64-mingw32-gcc -g -O1";
|
cc = "i686-w64-mingw32-gcc -g" optimize;
|
||||||
} else {
|
} else {
|
||||||
cc = "x86_64-w64-mingw32-gcc -g -O1";
|
cc = "x86_64-w64-mingw32-gcc -g" optimize;
|
||||||
}
|
}
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
compiler = "clang";
|
compiler = "clang";
|
||||||
cc = "clang -fPIC -g -O1";
|
cc = "clang -fPIC -g" optimize;
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
compiler = "gcc";
|
compiler = "gcc";
|
||||||
if (strncasecmp(os, "cygwin", 6) == 0) {
|
if (strncasecmp(os, "cygwin", 6) == 0) {
|
||||||
// Avoid cygwin specific warning that -fPIC is ignored.
|
// Avoid cygwin specific warning that -fPIC is ignored.
|
||||||
cc = "gcc -g -O1";
|
cc = "gcc -g" optimize;
|
||||||
} else {
|
} else {
|
||||||
cc = "gcc -fPIC -g -O1";
|
cc = "gcc -fPIC -g" optimize;
|
||||||
}
|
}
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
compiler = "MSC";
|
compiler = "MSC";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue