Prechádzať zdrojové kódy

* replaced tentryfile.get/putsmall/normalset() with a common tget/putset
that expects an open array of byte, and use it for all sets
o since all sets need to be typecasted to an array type of the appropriate
size, we'll get a compilation error in case this needs to be done and
that also tells us at the same time that the ppu version will need to
be increased
* enabled {$packset 1} for the compiler, as this is now safe with the above
changes

git-svn-id: trunk@43407 -

Jonas Maebe 5 rokov pred
rodič
commit
ac1e0f96bd

+ 4 - 3
compiler/aasmtai.pas

@@ -1021,7 +1021,8 @@ implementation
 {$endif x86}
 {$endif x86}
       SysUtils,
       SysUtils,
       verbose,
       verbose,
-      globals;
+      globals,
+      ppu;
 
 
     const
     const
       pputaimarker = 254;
       pputaimarker = 254;
@@ -1272,7 +1273,7 @@ implementation
         sectype:=TAsmSectiontype(ppufile.getbyte);
         sectype:=TAsmSectiontype(ppufile.getbyte);
         secalign:=ppufile.getlongint;
         secalign:=ppufile.getlongint;
         name:=ppufile.getpshortstring;
         name:=ppufile.getpshortstring;
-        secflags:=TSectionFlags(ppufile.getdword);
+        ppufile.getset(tppuset1(secflags));
         secprogbits:=TSectionProgbits(ppufile.getbyte);
         secprogbits:=TSectionProgbits(ppufile.getbyte);
         sec:=nil;
         sec:=nil;
       end;
       end;
@@ -1290,7 +1291,7 @@ implementation
         ppufile.putbyte(byte(sectype));
         ppufile.putbyte(byte(sectype));
         ppufile.putlongint(secalign);
         ppufile.putlongint(secalign);
         ppufile.putstring(name^);
         ppufile.putstring(name^);
-        ppufile.putbyte(dword(secflags));
+        ppufile.putset(tppuset1(secflags));
         ppufile.putbyte(byte(secprogbits));
         ppufile.putbyte(byte(secprogbits));
       end;
       end;
 
 

+ 13 - 60
compiler/entfile.pas

@@ -191,8 +191,6 @@ type
   { bestreal is defined based on the target architecture }
   { bestreal is defined based on the target architecture }
   entryreal=bestreal;
   entryreal=bestreal;
 
 
-
-
   { common part of the header for all kinds of entry files }
   { common part of the header for all kinds of entry files }
   tentryheader=record
   tentryheader=record
     id       : array[1..3] of char;
     id       : array[1..3] of char;
@@ -300,8 +298,7 @@ type
     function  getstring:string;
     function  getstring:string;
     function  getpshortstring:pshortstring;
     function  getpshortstring:pshortstring;
     function  getansistring:ansistring;
     function  getansistring:ansistring;
-    procedure getnormalset(out b);
-    procedure getsmallset(out b);
+    procedure getset(out arr: array of byte);
     function  skipuntilentry(untilb:byte):boolean;
     function  skipuntilentry(untilb:byte):boolean;
   {write}
   {write}
     function  createfile:boolean;virtual;
     function  createfile:boolean;virtual;
@@ -326,8 +323,8 @@ type
     procedure putboolean(b:boolean); {$ifdef USEINLINE}inline;{$endif}
     procedure putboolean(b:boolean); {$ifdef USEINLINE}inline;{$endif}
     procedure putstring(const s:string); {$ifdef USEINLINE}inline;{$endif}
     procedure putstring(const s:string); {$ifdef USEINLINE}inline;{$endif}
     procedure putansistring(const s:ansistring);
     procedure putansistring(const s:ansistring);
-    procedure putnormalset(const b); {$ifdef USEINLINE}inline;{$endif}
-    procedure putsmallset(const b); {$ifdef USEINLINE}inline;{$endif}
+
+    procedure putset(const arr: array of byte); {$ifdef USEINLINE}inline;{$endif}
     procedure tempclose;        // MG: not used, obsolete?
     procedure tempclose;        // MG: not used, obsolete?
     function  tempopen:boolean; // MG: not used, obsolete?
     function  tempopen:boolean; // MG: not used, obsolete?
   end;
   end;
@@ -1386,44 +1383,21 @@ begin
 end;
 end;
 
 
 
 
-procedure tentryfile.getsmallset(out b);
+procedure tentryfile.getset(out arr: array of byte);
 var
 var
   i : longint;
   i : longint;
 begin
 begin
 {$ifdef DEBUG_PPU}
 {$ifdef DEBUG_PPU}
-  ppu_log('putsmallset');
+  ppu_log('putset');
   inc_log_level;
   inc_log_level;
-  { putsmallset uses putlongint, thus we need
-    to add a call to ppu_log('longint') to get the same output }
-  ppu_log('longint');
 {$endif}
 {$endif}
-  getdata(b,4);
+  getdata(arr,sizeof(arr));
   if change_endian then
   if change_endian then
-    for i:=0 to 3 do
-      Pbyte(@b)[i]:=reverse_byte(Pbyte(@b)[i]);
+    for i:=low(arr) to high(arr) do
+      arr[i]:=reverse_byte(arr[i]);
 {$ifdef DEBUG_PPU}
 {$ifdef DEBUG_PPU}
   for i:=0 to 3 do
   for i:=0 to 3 do
-    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(pbyte(@b)[i],2));
-  dec_log_level;
-{$endif}
-end;
-
-
-procedure tentryfile.getnormalset(out b);
-var
-  i : longint;
-begin
-{$ifdef DEBUG_PPU}
-  ppu_log('putnormalset');
-  inc_log_level;
-{$endif}
-  getdata(b,32);
-  if change_endian then
-    for i:=0 to 31 do
-      Pbyte(@b)[i]:=reverse_byte(Pbyte(@b)[i]);
-{$ifdef DEBUG_PPU}
-  for i:=0 to 31 do
-    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(pbyte(@b)[i],2));
+    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(arr[i],2));
   dec_log_level;
   dec_log_level;
 {$endif}
 {$endif}
 end;
 end;
@@ -1881,41 +1855,20 @@ procedure tentryfile.putansistring(const s:ansistring);
   end;
   end;
 
 
 
 
-procedure tentryfile.putsmallset(const b);
-  var
-    l : longint;
-{$ifdef DEBUG_PPU}
-    i : byte;
-{$endif}
-  begin
-{$ifdef DEBUG_PPU}
-  ppu_log('putsmallset');
-  inc_log_level;
-{$endif}
-    l:=longint(b);
-    putlongint(l);
-{$ifdef DEBUG_PPU}
-  for i:=0 to 3 do
-    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(pbyte(@b)[i],2));
-  dec_log_level;
-{$endif}
-  end;
-
-
-procedure tentryfile.putnormalset(const b);
+procedure tentryfile.putset(const arr: array of byte);
 {$ifdef DEBUG_PPU}
 {$ifdef DEBUG_PPU}
   var
   var
     i : byte;
     i : byte;
 {$endif}
 {$endif}
   begin
   begin
 {$ifdef DEBUG_PPU}
 {$ifdef DEBUG_PPU}
-  ppu_log('putnormalset');
+  ppu_log('putset');
   inc_log_level;
   inc_log_level;
 {$endif}
 {$endif}
-    putdata(b,32);
+    putdata(arr,sizeof(arr));
 {$ifdef DEBUG_PPU}
 {$ifdef DEBUG_PPU}
   for i:=0 to 31 do
   for i:=0 to 31 do
-    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(pbyte(@b)[i],2));
+    ppu_log_val('byte['+tostr(i)+']=$'+hexstr(arr[i],2));
   dec_log_level;
   dec_log_level;
 {$endif}
 {$endif}
   end;
   end;

+ 0 - 6
compiler/fpcdefs.inc

@@ -7,13 +7,7 @@
 
 
 { This reduces the memory requirements a lot }
 { This reduces the memory requirements a lot }
 {$PACKENUM 1}
 {$PACKENUM 1}
-{$ifndef FPC_BIG_ENDIAN}
-{ $define USE_PACKSET1}
-{$endif}
-
-{$ifdef USE_PACKSET1}
 {$PACKSET 1}
 {$PACKSET 1}
-{$endif USE_PACKSET1}
 
 
 { We don't use exceptions, so turn off the implicit
 { We don't use exceptions, so turn off the implicit
   exceptions in the constructors }
   exceptions in the constructors }

+ 7 - 7
compiler/fppu.pas

@@ -1028,7 +1028,7 @@ var
         old_docrc:=ppufile.do_crc;
         old_docrc:=ppufile.do_crc;
         ppufile.do_crc:=false;
         ppufile.do_crc:=false;
         ppufile.putlongint(longint(CurrentPPULongVersion));
         ppufile.putlongint(longint(CurrentPPULongVersion));
-        ppufile.putsmallset(moduleflags);
+        ppufile.putset(tppuset4(moduleflags));
         ppufile.writeentry(ibextraheader);
         ppufile.writeentry(ibextraheader);
         ppufile.do_crc:=old_docrc;
         ppufile.do_crc:=old_docrc;
       end;
       end;
@@ -1380,7 +1380,7 @@ var
     procedure tppumodule.readextraheader;
     procedure tppumodule.readextraheader;
       begin
       begin
         longversion:=cardinal(ppufile.getlongint);
         longversion:=cardinal(ppufile.getlongint);
-        ppufile.getsmallset(moduleflags);
+        ppufile.getset(tppuset4(moduleflags));
       end;
       end;
 
 
 
 
@@ -1414,11 +1414,11 @@ var
                end;
                end;
              ibfeatures :
              ibfeatures :
                begin
                begin
-                 ppufile.getsmallset(features);
+                 ppufile.getset(tppuset4(features));
                end;
                end;
              ibmoduleoptions:
              ibmoduleoptions:
                begin
                begin
-                 ppufile.getsmallset(moduleoptions);
+                 ppufile.getset(tppuset1(moduleoptions));
                  if mo_has_deprecated_msg in moduleoptions then
                  if mo_has_deprecated_msg in moduleoptions then
                    begin
                    begin
                      stringdispose(deprecatedmsg);
                      stringdispose(deprecatedmsg);
@@ -1533,7 +1533,7 @@ var
          ppufile.putstring(realmodulename^);
          ppufile.putstring(realmodulename^);
          ppufile.writeentry(ibmodulename);
          ppufile.writeentry(ibmodulename);
 
 
-         ppufile.putsmallset(moduleoptions);
+         ppufile.putset(tppuset1(moduleoptions));
          if mo_has_deprecated_msg in moduleoptions then
          if mo_has_deprecated_msg in moduleoptions then
            ppufile.putstring(deprecatedmsg^);
            ppufile.putstring(deprecatedmsg^);
          ppufile.writeentry(ibmoduleoptions);
          ppufile.writeentry(ibmoduleoptions);
@@ -1547,7 +1547,7 @@ var
 
 
          if cs_compilesystem in current_settings.moduleswitches then
          if cs_compilesystem in current_settings.moduleswitches then
            begin
            begin
-             ppufile.putsmallset(features);
+             ppufile.putset(tppuset4(features));
              ppufile.writeentry(ibfeatures);
              ppufile.writeentry(ibfeatures);
            end;
            end;
 
 
@@ -1715,7 +1715,7 @@ var
          { extra header (sub version, module flags) }
          { extra header (sub version, module flags) }
          writeextraheader;
          writeextraheader;
 
 
-         ppufile.putsmallset(moduleoptions);
+         ppufile.putset(tppuset1(moduleoptions));
          if mo_has_deprecated_msg in moduleoptions then
          if mo_has_deprecated_msg in moduleoptions then
            ppufile.putstring(deprecatedmsg^);
            ppufile.putstring(deprecatedmsg^);
          ppufile.writeentry(ibmoduleoptions);
          ppufile.writeentry(ibmoduleoptions);

+ 3 - 2
compiler/nbas.pas

@@ -338,6 +338,7 @@ implementation
 
 
     uses
     uses
       verbose,globals,systems,
       verbose,globals,systems,
+      ppu,
       symconst,symdef,defutil,defcmp,
       symconst,symdef,defutil,defcmp,
       pass_1,
       pass_1,
       nutils,nld,
       nutils,nld,
@@ -1287,7 +1288,7 @@ implementation
         size:=ppufile.getlongint;
         size:=ppufile.getlongint;
         new(tempinfo);
         new(tempinfo);
         fillchar(tempinfo^,sizeof(tempinfo^),0);
         fillchar(tempinfo^,sizeof(tempinfo^),0);
-        ppufile.getsmallset(tempinfo^.flags);
+        ppufile.getset(tppuset2(tempinfo^.flags));
         ppufile.getderef(tempinfo^.typedefderef);
         ppufile.getderef(tempinfo^.typedefderef);
         tempinfo^.temptype := ttemptype(ppufile.getbyte);
         tempinfo^.temptype := ttemptype(ppufile.getbyte);
         tempinfo^.owner:=self;
         tempinfo^.owner:=self;
@@ -1300,7 +1301,7 @@ implementation
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putlongint(size);
         ppufile.putlongint(size);
-        ppufile.putsmallset(tempinfo^.flags);
+        ppufile.putset(tppuset2(tempinfo^.flags));
         ppufile.putderef(tempinfo^.typedefderef);
         ppufile.putderef(tempinfo^.typedefderef);
         ppufile.putbyte(byte(tempinfo^.temptype));
         ppufile.putbyte(byte(tempinfo^.temptype));
         ppuwritenode(ppufile,tempinfo^.withnode);
         ppuwritenode(ppufile,tempinfo^.withnode);

+ 5 - 5
compiler/ncal.pas

@@ -315,7 +315,7 @@ implementation
 
 
     uses
     uses
       systems,
       systems,
-      verbose,globals,fmodule,
+      verbose,globals,fmodule,ppu,
       aasmbase,aasmdata,
       aasmbase,aasmdata,
       symconst,defutil,defcmp,compinnr,
       symconst,defutil,defcmp,compinnr,
       htypechk,pass_1,
       htypechk,pass_1,
@@ -960,7 +960,7 @@ implementation
     constructor tcallparanode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
     constructor tcallparanode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
       begin
       begin
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
-        ppufile.getsmallset(callparaflags);
+        ppufile.getset(tppuset1(callparaflags));
         fparainit:=ppuloadnode(ppufile);
         fparainit:=ppuloadnode(ppufile);
         fparacopyback:=ppuloadnode(ppufile);
         fparacopyback:=ppuloadnode(ppufile);
       end;
       end;
@@ -969,7 +969,7 @@ implementation
     procedure tcallparanode.ppuwrite(ppufile:tcompilerppufile);
     procedure tcallparanode.ppuwrite(ppufile:tcompilerppufile);
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
-        ppufile.putsmallset(callparaflags);
+        ppufile.putset(tppuset1(callparaflags));
         ppuwritenode(ppufile,fparainit);
         ppuwritenode(ppufile,fparainit);
         ppuwritenode(ppufile,fparacopyback);
         ppuwritenode(ppufile,fparacopyback);
       end;
       end;
@@ -1644,7 +1644,7 @@ implementation
 { TODO: FIXME: No withsymtable support}
 { TODO: FIXME: No withsymtable support}
         symtableproc:=nil;
         symtableproc:=nil;
         ppufile.getderef(procdefinitionderef);
         ppufile.getderef(procdefinitionderef);
-        ppufile.getsmallset(callnodeflags);
+        ppufile.getset(tppuset4(callnodeflags));
       end;
       end;
 
 
 
 
@@ -1659,7 +1659,7 @@ implementation
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putderef(symtableprocentryderef);
         ppufile.putderef(symtableprocentryderef);
         ppufile.putderef(procdefinitionderef);
         ppufile.putderef(procdefinitionderef);
-        ppufile.putsmallset(callnodeflags);
+        ppufile.putset(tppuset4(callnodeflags));
       end;
       end;
 
 
 
 

+ 3 - 3
compiler/ncnv.pas

@@ -318,7 +318,7 @@ implementation
 
 
    uses
    uses
       globtype,systems,constexp,compinnr,
       globtype,systems,constexp,compinnr,
-      cutils,verbose,globals,widestr,
+      cutils,verbose,globals,widestr,ppu,
       symconst,symdef,symsym,symcpu,symtable,
       symconst,symdef,symsym,symcpu,symtable,
       ncon,ncal,nset,nadd,nmem,nmat,nbas,nutils,ninl,
       ncon,ncal,nset,nadd,nmem,nmat,nbas,nutils,ninl,
       cgbase,procinfo,
       cgbase,procinfo,
@@ -990,7 +990,7 @@ implementation
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
         ppufile.getderef(totypedefderef);
         ppufile.getderef(totypedefderef);
         convtype:=tconverttype(ppufile.getbyte);
         convtype:=tconverttype(ppufile.getbyte);
-        ppufile.getsmallset(convnodeflags);
+        ppufile.getset(tppuset1(convnodeflags));
       end;
       end;
 
 
 
 
@@ -999,7 +999,7 @@ implementation
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putderef(totypedefderef);
         ppufile.putderef(totypedefderef);
         ppufile.putbyte(byte(convtype));
         ppufile.putbyte(byte(convtype));
-        ppufile.putsmallset(convnodeflags);
+        ppufile.putset(tppuset1(convnodeflags));
       end;
       end;
 
 
 
 

+ 3 - 3
compiler/ncon.pas

@@ -218,7 +218,7 @@ implementation
 
 
     uses
     uses
       cutils,
       cutils,
-      verbose,systems,sysutils,
+      verbose,systems,sysutils,ppu,
       defcmp,defutil,procinfo,
       defcmp,defutil,procinfo,
       aasmdata,aasmtai,
       aasmdata,aasmtai,
       cgbase,
       cgbase,
@@ -1235,7 +1235,7 @@ implementation
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
         ppufile.getderef(typedefderef);
         ppufile.getderef(typedefderef);
         new(value_set);
         new(value_set);
-        ppufile.getnormalset(value_set^);
+        ppufile.getset(tppuset32(value_set^));
       end;
       end;
 
 
 
 
@@ -1243,7 +1243,7 @@ implementation
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putderef(typedefderef);
         ppufile.putderef(typedefderef);
-        ppufile.putnormalset(value_set^);
+        ppufile.putset(tppuset32(value_set^));
       end;
       end;
 
 
 
 

+ 3 - 3
compiler/nflw.pas

@@ -284,7 +284,7 @@ implementation
 
 
     uses
     uses
       globtype,systems,constexp,compinnr,
       globtype,systems,constexp,compinnr,
-      cutils,verbose,globals,
+      cutils,verbose,globals,ppu,
       symtable,paramgr,defcmp,defutil,htypechk,pass_1,
       symtable,paramgr,defcmp,defutil,htypechk,pass_1,
       ncal,nadd,ncon,nmem,nld,ncnv,nbas,nutils,ninl,nset,ngenutil,
       ncal,nadd,ncon,nmem,nld,ncnv,nbas,nutils,ninl,nset,ngenutil,
     {$ifdef state_tracking}
     {$ifdef state_tracking}
@@ -1020,7 +1020,7 @@ implementation
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
         t1:=ppuloadnode(ppufile);
         t1:=ppuloadnode(ppufile);
         t2:=ppuloadnode(ppufile);
         t2:=ppuloadnode(ppufile);
-        ppufile.getsmallset(loopflags);
+        ppufile.getset(tppuset1(loopflags));
       end;
       end;
 
 
 
 
@@ -1029,7 +1029,7 @@ implementation
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppuwritenode(ppufile,t1);
         ppuwritenode(ppufile,t1);
         ppuwritenode(ppufile,t2);
         ppuwritenode(ppufile,t2);
-        ppufile.putsmallset(loopflags);
+        ppufile.putset(tppuset1(loopflags));
       end;
       end;
 
 
 
 

+ 3 - 2
compiler/nld.pas

@@ -184,6 +184,7 @@ implementation
 
 
     uses
     uses
       verbose,globtype,globals,systems,constexp,compinnr,
       verbose,globtype,globals,systems,constexp,compinnr,
+      ppu,
       symtable,
       symtable,
       defutil,defcmp,
       defutil,defcmp,
       cpuinfo,
       cpuinfo,
@@ -231,7 +232,7 @@ implementation
         ppufile.getderef(symtableentryderef);
         ppufile.getderef(symtableentryderef);
         symtable:=nil;
         symtable:=nil;
         ppufile.getderef(fprocdefderef);
         ppufile.getderef(fprocdefderef);
-        ppufile.getsmallset(loadnodeflags);
+        ppufile.getset(tppuset1(loadnodeflags));
       end;
       end;
 
 
 
 
@@ -240,7 +241,7 @@ implementation
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putderef(symtableentryderef);
         ppufile.putderef(symtableentryderef);
         ppufile.putderef(fprocdefderef);
         ppufile.putderef(fprocdefderef);
-        ppufile.putsmallset(loadnodeflags);
+        ppufile.putset(tppuset1(loadnodeflags));
       end;
       end;
 
 
 
 

+ 3 - 3
compiler/nmem.pas

@@ -159,7 +159,7 @@ implementation
 
 
     uses
     uses
       globtype,systems,constexp,
       globtype,systems,constexp,
-      cutils,verbose,globals,
+      cutils,verbose,globals,ppu,
       symconst,defutil,defcmp,
       symconst,defutil,defcmp,
       nadd,nbas,nflw,nutils,objcutil,
       nadd,nbas,nflw,nutils,objcutil,
       wpobase,
       wpobase,
@@ -438,7 +438,7 @@ implementation
       begin
       begin
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
         ppufile.getderef(getprocvardefderef);
         ppufile.getderef(getprocvardefderef);
-        ppufile.getsmallset(addrnodeflags);
+        ppufile.getset(tppuset1(addrnodeflags));
       end;
       end;
 
 
 
 
@@ -446,7 +446,7 @@ implementation
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putderef(getprocvardefderef);
         ppufile.putderef(getprocvardefderef);
-        ppufile.putsmallset(addrnodeflags);
+        ppufile.putset(tppuset1(addrnodeflags));
       end;
       end;
 
 
     procedure Taddrnode.mark_write;
     procedure Taddrnode.mark_write;

+ 5 - 4
compiler/node.pas

@@ -521,6 +521,7 @@ implementation
 {$ifdef DEBUG_NODE_XML}
 {$ifdef DEBUG_NODE_XML}
        cutils,
        cutils,
 {$endif DEBUG_NODE_XML}
 {$endif DEBUG_NODE_XML}
+       ppu,
        symconst,
        symconst,
        nutils,nflw,
        nutils,nflw,
        defutil;
        defutil;
@@ -797,10 +798,10 @@ implementation
         { tnode fields }
         { tnode fields }
         blocktype:=tblock_type(ppufile.getbyte);
         blocktype:=tblock_type(ppufile.getbyte);
         ppufile.getposinfo(fileinfo);
         ppufile.getposinfo(fileinfo);
-        ppufile.getsmallset(localswitches);
+        ppufile.getset(tppuset5(localswitches));
         verbosity:=ppufile.getlongint;
         verbosity:=ppufile.getlongint;
         ppufile.getderef(resultdefderef);
         ppufile.getderef(resultdefderef);
-        ppufile.getsmallset(flags);
+        ppufile.getset(tppuset4(flags));
         { updated by firstpass }
         { updated by firstpass }
         expectloc:=LOC_INVALID;
         expectloc:=LOC_INVALID;
         { updated by secondpass }
         { updated by secondpass }
@@ -812,10 +813,10 @@ implementation
       begin
       begin
         ppufile.putbyte(byte(block_type));
         ppufile.putbyte(byte(block_type));
         ppufile.putposinfo(fileinfo);
         ppufile.putposinfo(fileinfo);
-        ppufile.putsmallset(localswitches);
+        ppufile.putset(tppuset5(localswitches));
         ppufile.putlongint(verbosity);
         ppufile.putlongint(verbosity);
         ppufile.putderef(resultdefderef);
         ppufile.putderef(resultdefderef);
-        ppufile.putsmallset(flags);
+        ppufile.putset(tppuset4(flags));
       end;
       end;
 
 
 
 

+ 37 - 1
compiler/ppu.pas

@@ -50,7 +50,7 @@ const
   CurrentPPUVersion = 207;
   CurrentPPUVersion = 207;
   { for any other changes to the ppu format, increase this version number
   { for any other changes to the ppu format, increase this version number
     (it's a cardinal) }
     (it's a cardinal) }
-  CurrentPPULongVersion = 6;
+  CurrentPPULongVersion = 7;
 
 
 { unit flags }
 { unit flags }
   uf_big_endian          = $000004;
   uf_big_endian          = $000004;
@@ -67,6 +67,42 @@ type
   { bestreal is defined based on the target architecture }
   { bestreal is defined based on the target architecture }
   ppureal=bestreal;
   ppureal=bestreal;
 
 
+  { set type aliases. We cast all sets to a corresponding array type so
+    that if the set changes size, compilation will fail and we know that
+    we have have to increase the ppu version }
+  tppuset1 = array[0..0] of byte;
+  tppuset2 = array[0..1] of byte;
+  { tppuset3 = array[0..2] of byte; (sets of 3 bytes are rounded up to 4 bytes) }
+  tppuset4 = array[0..3] of byte;
+  tppuset5 = array[0..4] of byte;
+  tppuset6 = array[0..5] of byte;
+  tppuset7 = array[0..6] of byte;
+  tppuset8 = array[0..7] of byte;
+  tppuset9 = array[0..8] of byte;
+  tppuset10 = array[0..9] of byte;
+  tppuset11 = array[0..10] of byte;
+  tppuset12 = array[0..11] of byte;
+  tppuset13 = array[0..12] of byte;
+  tppuset14 = array[0..13] of byte;
+  tppuset15 = array[0..14] of byte;
+  tppuset16 = array[0..15] of byte;
+  tppuset17 = array[0..16] of byte;
+  tppuset18 = array[0..17] of byte;
+  tppuset19 = array[0..18] of byte;
+  tppuset20 = array[0..19] of byte;
+  tppuset21 = array[0..20] of byte;
+  tppuset22 = array[0..21] of byte;
+  tppuset23 = array[0..22] of byte;
+  tppuset24 = array[0..23] of byte;
+  tppuset25 = array[0..24] of byte;
+  tppuset26 = array[0..25] of byte;
+  tppuset27 = array[0..26] of byte;
+  tppuset28 = array[0..27] of byte;
+  tppuset29 = array[0..28] of byte;
+  tppuset30 = array[0..29] of byte;
+  tppuset31 = array[0..30] of byte;
+  tppuset32 = array[0..31] of byte;
+
   tppuerror=(ppuentrytoobig,ppuentryerror);
   tppuerror=(ppuentrytoobig,ppuentryerror);
 
 
   tppuheader=record
   tppuheader=record

+ 21 - 21
compiler/symdef.pas

@@ -1301,7 +1301,7 @@ implementation
       { parser }
       { parser }
       pgenutil,
       pgenutil,
       { module }
       { module }
-      fmodule,
+      fmodule,ppu,
       { other }
       { other }
       aasmbase,
       aasmbase,
       gendef,
       gendef,
@@ -1790,7 +1790,7 @@ implementation
         cnt,i : longint;
         cnt,i : longint;
         intfderef : pderef;
         intfderef : pderef;
       begin
       begin
-        ppufile.getsmallset(flags);
+        ppufile.getset(tppuset1(flags));
         cnt:=ppufile.getlongint;
         cnt:=ppufile.getlongint;
         for i:=0 to cnt-1 do
         for i:=0 to cnt-1 do
           begin
           begin
@@ -1805,7 +1805,7 @@ implementation
       var
       var
         i : longint;
         i : longint;
       begin
       begin
-        ppufile.putsmallset(flags);
+        ppufile.putset(tppuset1(flags));
         ppufile.putlongint(interfacesderef.count);
         ppufile.putlongint(interfacesderef.count);
         for i:=0 to interfacesderef.count-1 do
         for i:=0 to interfacesderef.count-1 do
           ppufile.putderef(pderef(interfacesderef[i])^);
           ppufile.putderef(pderef(interfacesderef[i])^);
@@ -1941,8 +1941,8 @@ implementation
 {$endif}
 {$endif}
          { load }
          { load }
          ppufile.getderef(typesymderef);
          ppufile.getderef(typesymderef);
-         ppufile.getsmallset(defoptions);
-         ppufile.getsmallset(defstates);
+         ppufile.getset(tppuset2(defoptions));
+         ppufile.getset(tppuset1(defstates));
          if df_genconstraint in defoptions then
          if df_genconstraint in defoptions then
            begin
            begin
              genconstraintdata:=tgenericconstraintdata.create;
              genconstraintdata:=tgenericconstraintdata.create;
@@ -2109,10 +2109,10 @@ implementation
           internalerror(2015101401);
           internalerror(2015101401);
         ppufile.putlongint(DefId);
         ppufile.putlongint(DefId);
         ppufile.putderef(typesymderef);
         ppufile.putderef(typesymderef);
-        ppufile.putsmallset(defoptions);
+        ppufile.putset(tppuset2(defoptions));
         oldintfcrc:=ppufile.do_crc;
         oldintfcrc:=ppufile.do_crc;
         ppufile.do_crc:=false;
         ppufile.do_crc:=false;
-        ppufile.putsmallset(defstates);
+        ppufile.putset(tppuset1(defstates));
         if df_genconstraint in defoptions then
         if df_genconstraint in defoptions then
           genconstraintdata.ppuwrite(ppufile);
           genconstraintdata.ppuwrite(ppufile);
         if [df_generic,df_specialization]*defoptions<>[] then
         if [df_generic,df_specialization]*defoptions<>[] then
@@ -4125,7 +4125,7 @@ implementation
          ppufile.getderef(rangedefderef);
          ppufile.getderef(rangedefderef);
          lowrange:=ppufile.getasizeint;
          lowrange:=ppufile.getasizeint;
          highrange:=ppufile.getasizeint;
          highrange:=ppufile.getasizeint;
-         ppufile.getsmallset(arrayoptions);
+         ppufile.getset(tppuset1(arrayoptions));
          ppuload_platform(ppufile);
          ppuload_platform(ppufile);
          symtable:=tarraysymtable.create(self);
          symtable:=tarraysymtable.create(self);
          tarraysymtable(symtable).ppuload(ppufile)
          tarraysymtable(symtable).ppuload(ppufile)
@@ -4165,7 +4165,7 @@ implementation
          ppufile.putderef(rangedefderef);
          ppufile.putderef(rangedefderef);
          ppufile.putasizeint(lowrange);
          ppufile.putasizeint(lowrange);
          ppufile.putasizeint(highrange);
          ppufile.putasizeint(highrange);
-         ppufile.putsmallset(arrayoptions);
+         ppufile.putset(tppuset1(arrayoptions));
          writeentry(ppufile,ibarraydef);
          writeentry(ppufile,ibarraydef);
          tarraysymtable(symtable).ppuwrite(ppufile);
          tarraysymtable(symtable).ppuwrite(ppufile);
       end;
       end;
@@ -4393,7 +4393,7 @@ implementation
         { only used for external C++ classes and Java classes/records }
         { only used for external C++ classes and Java classes/records }
         if (import_lib^='') then
         if (import_lib^='') then
           stringdispose(import_lib);
           stringdispose(import_lib);
-        ppufile.getsmallset(objectoptions);
+        ppufile.getset(tppuset4(objectoptions));
       end;
       end;
 
 
     procedure tabstractrecorddef.ppuwrite(ppufile: tcompilerppufile);
     procedure tabstractrecorddef.ppuwrite(ppufile: tcompilerppufile);
@@ -4404,7 +4404,7 @@ implementation
           ppufile.putstring(import_lib^)
           ppufile.putstring(import_lib^)
         else
         else
           ppufile.putstring('');
           ppufile.putstring('');
-        ppufile.putsmallset(objectoptions);
+        ppufile.putset(tppuset4(objectoptions));
       end;
       end;
 
 
     destructor tabstractrecorddef.destroy;
     destructor tabstractrecorddef.destroy;
@@ -4901,7 +4901,7 @@ implementation
              trecordsymtable(symtable).recordalignmin:=shortint(ppufile.getbyte);
              trecordsymtable(symtable).recordalignmin:=shortint(ppufile.getbyte);
              trecordsymtable(symtable).datasize:=ppufile.getasizeint;
              trecordsymtable(symtable).datasize:=ppufile.getasizeint;
              trecordsymtable(symtable).paddingsize:=ppufile.getword;
              trecordsymtable(symtable).paddingsize:=ppufile.getword;
-             ppufile.getsmallset(trecordsymtable(symtable).managementoperators);
+             ppufile.getset(tppuset1(trecordsymtable(symtable).managementoperators));
              { position of ppuload_platform call must correspond
              { position of ppuload_platform call must correspond
                to position of writeentry in ppuwrite method }
                to position of writeentry in ppuwrite method }
              ppuload_platform(ppufile);
              ppuload_platform(ppufile);
@@ -5059,7 +5059,7 @@ implementation
              ppufile.putbyte(byte(trecordsymtable(symtable).recordalignmin));
              ppufile.putbyte(byte(trecordsymtable(symtable).recordalignmin));
              ppufile.putasizeint(trecordsymtable(symtable).datasize);
              ppufile.putasizeint(trecordsymtable(symtable).datasize);
              ppufile.putword(trecordsymtable(symtable).paddingsize);
              ppufile.putword(trecordsymtable(symtable).paddingsize);
-             ppufile.putsmallset(trecordsymtable(symtable).managementoperators);
+             ppufile.putset(tppuset1(trecordsymtable(symtable).managementoperators));
              { the variantrecdesc is needed only for iso-like new statements new(prec,1,2,3 ...);
              { the variantrecdesc is needed only for iso-like new statements new(prec,1,2,3 ...);
                but because iso mode supports no units, there is no need to store the variantrecdesc
                but because iso mode supports no units, there is no need to store the variantrecdesc
                in the ppu
                in the ppu
@@ -5293,7 +5293,7 @@ implementation
          ppufile.getderef(returndefderef);
          ppufile.getderef(returndefderef);
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
-         ppufile.getnormalset(procoptions);
+         ppufile.getset(tppuset8(procoptions));
 
 
          funcretloc[callerside].init;
          funcretloc[callerside].init;
          if po_explicitparaloc in procoptions then
          if po_explicitparaloc in procoptions then
@@ -5318,7 +5318,7 @@ implementation
          ppufile.do_interface_crc:=false;
          ppufile.do_interface_crc:=false;
          ppufile.putbyte(ord(proctypeoption));
          ppufile.putbyte(ord(proctypeoption));
          ppufile.putbyte(ord(proccalloption));
          ppufile.putbyte(ord(proccalloption));
-         ppufile.putnormalset(procoptions);
+         ppufile.putset(tppuset8(procoptions));
          ppufile.do_interface_crc:=oldintfcrc;
          ppufile.do_interface_crc:=oldintfcrc;
 
 
          if (po_explicitparaloc in procoptions) then
          if (po_explicitparaloc in procoptions) then
@@ -5986,7 +5986,7 @@ implementation
          ppufile.getderef(procsymderef);
          ppufile.getderef(procsymderef);
          ppufile.getposinfo(fileinfo);
          ppufile.getposinfo(fileinfo);
          visibility:=tvisibility(ppufile.getbyte);
          visibility:=tvisibility(ppufile.getbyte);
-         ppufile.getsmallset(symoptions);
+         ppufile.getset(tppuset2(symoptions));
          if sp_has_deprecated_msg in symoptions then
          if sp_has_deprecated_msg in symoptions then
            deprecatedmsg:=ppufile.getpshortstring
            deprecatedmsg:=ppufile.getpshortstring
          else
          else
@@ -6008,12 +6008,12 @@ implementation
          if (po_dispid in procoptions) then
          if (po_dispid in procoptions) then
            dispid:=ppufile.getlongint;
            dispid:=ppufile.getlongint;
          { inline stuff }
          { inline stuff }
-         ppufile.getsmallset(implprocoptions);
+         ppufile.getset(tppuset1(implprocoptions));
          if has_inlininginfo then
          if has_inlininginfo then
            begin
            begin
              ppufile.getderef(funcretsymderef);
              ppufile.getderef(funcretsymderef);
              new(inlininginfo);
              new(inlininginfo);
-             ppufile.getsmallset(inlininginfo^.flags);
+             ppufile.getset(tppuset4(inlininginfo^.flags));
            end
            end
          else
          else
            begin
            begin
@@ -6159,7 +6159,7 @@ implementation
          ppufile.putderef(procsymderef);
          ppufile.putderef(procsymderef);
          ppufile.putposinfo(fileinfo);
          ppufile.putposinfo(fileinfo);
          ppufile.putbyte(byte(visibility));
          ppufile.putbyte(byte(visibility));
-         ppufile.putsmallset(symoptions);
+         ppufile.putset(tppuset2(symoptions));
          if sp_has_deprecated_msg in symoptions then
          if sp_has_deprecated_msg in symoptions then
            ppufile.putstring(deprecatedmsg^);
            ppufile.putstring(deprecatedmsg^);
          { import }
          { import }
@@ -6177,11 +6177,11 @@ implementation
          { inline stuff }
          { inline stuff }
          oldintfcrc:=ppufile.do_crc;
          oldintfcrc:=ppufile.do_crc;
          ppufile.do_crc:=false;
          ppufile.do_crc:=false;
-         ppufile.putsmallset(implprocoptions);
+         ppufile.putset(tppuset1(implprocoptions));
          if has_inlininginfo then
          if has_inlininginfo then
            begin
            begin
              ppufile.putderef(funcretsymderef);
              ppufile.putderef(funcretsymderef);
-             ppufile.putsmallset(inlininginfo^.flags);
+             ppufile.putset(tppuset4(inlininginfo^.flags));
            end;
            end;
 
 
          { count alias names }
          { count alias names }

+ 9 - 9
compiler/symsym.pas

@@ -507,7 +507,7 @@ implementation
        paramgr,
        paramgr,
        procinfo,
        procinfo,
        { ppu }
        { ppu }
-       entfile
+       entfile,ppu
        ;
        ;
 
 
 {****************************************************************************
 {****************************************************************************
@@ -568,7 +568,7 @@ implementation
          current_module.symlist[SymId]:=self;
          current_module.symlist[SymId]:=self;
          ppufile.getposinfo(fileinfo);
          ppufile.getposinfo(fileinfo);
          visibility:=tvisibility(ppufile.getbyte);
          visibility:=tvisibility(ppufile.getbyte);
-         ppufile.getsmallset(symoptions);
+         ppufile.getset(tppuset2(symoptions));
          if sp_has_deprecated_msg in symoptions then
          if sp_has_deprecated_msg in symoptions then
            deprecatedmsg:=ppufile.getpshortstring
            deprecatedmsg:=ppufile.getpshortstring
          else
          else
@@ -594,7 +594,7 @@ implementation
          }
          }
          oldintfcrc:=ppufile.do_interface_crc;
          oldintfcrc:=ppufile.do_interface_crc;
          ppufile.do_interface_crc:=false;
          ppufile.do_interface_crc:=false;
-         ppufile.putsmallset(symoptions);
+         ppufile.putset(tppuset2(symoptions));
          if sp_has_deprecated_msg in symoptions then
          if sp_has_deprecated_msg in symoptions then
            ppufile.putstring(deprecatedmsg^);
            ppufile.putstring(deprecatedmsg^);
          ppufile.do_interface_crc:=oldintfcrc;
          ppufile.do_interface_crc:=oldintfcrc;
@@ -1380,7 +1380,7 @@ implementation
         pap : tpropaccesslisttypes;
         pap : tpropaccesslisttypes;
       begin
       begin
          inherited ppuload(propertysym,ppufile);
          inherited ppuload(propertysym,ppufile);
-         ppufile.getsmallset(propoptions);
+         ppufile.getset(tppuset2(propoptions));
          if ppo_overrides in propoptions then
          if ppo_overrides in propoptions then
            ppufile.getderef(overriddenpropsymderef);
            ppufile.getderef(overriddenpropsymderef);
          ppufile.getderef(propdefderef);
          ppufile.getderef(propdefderef);
@@ -1602,7 +1602,7 @@ implementation
         pap : tpropaccesslisttypes;
         pap : tpropaccesslisttypes;
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
-        ppufile.putsmallset(propoptions);
+        ppufile.putset(tppuset2(propoptions));
         if ppo_overrides in propoptions then
         if ppo_overrides in propoptions then
           ppufile.putderef(overriddenpropsymderef);
           ppufile.putderef(overriddenpropsymderef);
         ppufile.putderef(propdefderef);
         ppufile.putderef(propdefderef);
@@ -1641,7 +1641,7 @@ implementation
          addr_taken:=ppufile.getboolean;
          addr_taken:=ppufile.getboolean;
          different_scope:=ppufile.getboolean;
          different_scope:=ppufile.getboolean;
          ppufile.getderef(vardefderef);
          ppufile.getderef(vardefderef);
-         ppufile.getsmallset(varoptions);
+         ppufile.getset(tppuset4(varoptions));
       end;
       end;
 
 
 
 
@@ -1675,7 +1675,7 @@ implementation
          ppufile.putboolean(different_scope);
          ppufile.putboolean(different_scope);
          ppufile.do_crc:=oldintfcrc;
          ppufile.do_crc:=oldintfcrc;
          ppufile.putderef(vardefderef);
          ppufile.putderef(vardefderef);
-         ppufile.putsmallset(varoptions);
+         ppufile.putset(tppuset4(varoptions));
       end;
       end;
 
 
 
 
@@ -2453,7 +2453,7 @@ implementation
              begin
              begin
                ppufile.getderef(constdefderef);
                ppufile.getderef(constdefderef);
                new(ps);
                new(ps);
-               ppufile.getnormalset(ps^);
+               ppufile.getset(tppuset32(ps^));
                value.valueptr:=ps;
                value.valueptr:=ps;
              end;
              end;
            constguid :
            constguid :
@@ -2561,7 +2561,7 @@ implementation
            constset :
            constset :
              begin
              begin
                ppufile.putderef(constdefderef);
                ppufile.putderef(constdefderef);
-               ppufile.putnormalset(value.valueptr^);
+               ppufile.putset(tppuset32(value.valueptr^));
              end;
              end;
            constguid :
            constguid :
              begin
              begin

+ 5 - 5
compiler/symtable.pas

@@ -482,7 +482,7 @@ implementation
       { codegen }
       { codegen }
       procinfo,
       procinfo,
       { ppu }
       { ppu }
-      entfile,
+      entfile,ppu,
       { parser }
       { parser }
       scanner
       scanner
       ;
       ;
@@ -525,7 +525,7 @@ implementation
         { load the table's flags }
         { load the table's flags }
         if ppufile.readentry<>ibsymtableoptions then
         if ppufile.readentry<>ibsymtableoptions then
           Message(unit_f_ppu_read_error);
           Message(unit_f_ppu_read_error);
-        ppufile.getsmallset(tableoptions);
+        ppufile.getset(tppuset1(tableoptions));
 
 
         { load definitions }
         { load definitions }
         loaddefs(ppufile);
         loaddefs(ppufile);
@@ -544,7 +544,7 @@ implementation
            needs_init_final;
            needs_init_final;
 
 
          { write the table's flags }
          { write the table's flags }
-         ppufile.putsmallset(tableoptions);
+         ppufile.putset(tppuset1(tableoptions));
          ppufile.writeentry(ibsymtableoptions);
          ppufile.writeentry(ibsymtableoptions);
 
 
          { write definitions }
          { write definitions }
@@ -1246,7 +1246,7 @@ implementation
         recordalignmin:=shortint(ppufile.getbyte);
         recordalignmin:=shortint(ppufile.getbyte);
         if (usefieldalignment=C_alignment) then
         if (usefieldalignment=C_alignment) then
           fieldalignment:=shortint(ppufile.getbyte);
           fieldalignment:=shortint(ppufile.getbyte);
-        ppufile.getsmallset(has_fields_with_mop);
+        ppufile.getset(tppuset1(has_fields_with_mop));
         inherited ppuload(ppufile);
         inherited ppuload(ppufile);
       end;
       end;
 
 
@@ -1267,7 +1267,7 @@ implementation
          { it's not really a "symtableoption", but loading this from the record
          { it's not really a "symtableoption", but loading this from the record
            def requires storing the set in the recorddef at least between
            def requires storing the set in the recorddef at least between
            ppuload and deref/derefimpl }
            ppuload and deref/derefimpl }
-         ppufile.putsmallset(has_fields_with_mop);
+         ppufile.putset(tppuset1(has_fields_with_mop));
          ppufile.writeentry(ibrecsymtableoptions);
          ppufile.writeentry(ibrecsymtableoptions);
 
 
          inherited ppuwrite(ppufile);
          inherited ppuwrite(ppufile);

+ 17 - 17
compiler/utils/ppuutils/ppudump.pp

@@ -964,7 +964,7 @@ begin
       SetHasErrors;
       SetHasErrors;
       exit;
       exit;
     end;
     end;
-  ppufile.getsmallset(options);
+  ppufile.getset(tppuset1(options));
   if space<>'' then
   if space<>'' then
    writeln([space,'------ ',s,' ------']);
    writeln([space,'------ ',s,' ------']);
   write([space,'Symtable options: ']);
   write([space,'Symtable options: ']);
@@ -1635,7 +1635,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(procinfooptions);
+  ppufile.getset(tppuset4(procinfooptions));
   if procinfooptions<>[] then
   if procinfooptions<>[] then
    begin
    begin
      first:=true;
      first:=true;
@@ -1681,7 +1681,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(symoptions);
+  ppufile.getset(tppuset2(symoptions));
   if symoptions<>[] then
   if symoptions<>[] then
    begin
    begin
      if Def <> nil then
      if Def <> nil then
@@ -2765,7 +2765,7 @@ begin
   else
   else
     readderef('');
     readderef('');
   write  ([space,'       DefOptions : ']);
   write  ([space,'       DefOptions : ']);
-  ppufile.getsmallset(defoptions);
+  ppufile.getset(tppuset2(defoptions));
   if defoptions<>[] then
   if defoptions<>[] then
     begin
     begin
       first:=true;
       first:=true;
@@ -2782,7 +2782,7 @@ begin
   writeln;
   writeln;
 
 
   write  ([space,'        DefStates : ']);
   write  ([space,'        DefStates : ']);
-  ppufile.getsmallset(defstates);
+  ppufile.getset(tppuset1(defstates));
   if defstates<>[] then
   if defstates<>[] then
     begin
     begin
       first:=true;
       first:=true;
@@ -2800,7 +2800,7 @@ begin
 
 
   if df_genconstraint in defoptions then
   if df_genconstraint in defoptions then
     begin
     begin
-      ppufile.getsmallset(genconstr);
+      ppufile.getset(tppuset1(genconstr));
       write  ([space,'   GenConstraints : ']);
       write  ([space,'   GenConstraints : ']);
       if genconstr<>[] then
       if genconstr<>[] then
         begin
         begin
@@ -2997,7 +2997,7 @@ begin
   writeln;
   writeln;
   proccalloption:=tproccalloption(ppufile.getbyte);
   proccalloption:=tproccalloption(ppufile.getbyte);
   writeln([space,'       CallOption : ',proccalloptionStr[proccalloption]]);
   writeln([space,'       CallOption : ',proccalloptionStr[proccalloption]]);
-  ppufile.getnormalset(procoptions);
+  ppufile.getset(tppuset8(procoptions));
   if procoptions<>[] then
   if procoptions<>[] then
    begin
    begin
      if po_classmethod in procoptions then Include(ProcDef.Options, poClassMethod);
      if po_classmethod in procoptions then Include(ProcDef.Options, poClassMethod);
@@ -3094,7 +3094,7 @@ begin
     readderef('',VarDef.VarType)
     readderef('',VarDef.VarType)
   else
   else
     readderef('');
     readderef('');
-  ppufile.getsmallset(varoptions);
+  ppufile.getset(tppuset4(varoptions));
   if varoptions<>[] then
   if varoptions<>[] then
    begin
    begin
      if (VarDef <> nil) and (VarDef.DefType = dtParam) and (vo_is_hidden_para in varoptions) then
      if (VarDef <> nil) and (VarDef.DefType = dtParam) and (vo_is_hidden_para in varoptions) then
@@ -3153,7 +3153,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(current_objectoptions);
+  ppufile.getset(tppuset4(current_objectoptions));
   if current_objectoptions<>[] then
   if current_objectoptions<>[] then
    begin
    begin
      if ObjDef <> nil then
      if ObjDef <> nil then
@@ -3194,7 +3194,7 @@ var
   i: timplprocoption;
   i: timplprocoption;
   first: boolean;
   first: boolean;
 begin
 begin
-  ppufile.getsmallset(implprocoptions);
+  ppufile.getset(tppuset1(implprocoptions));
   if implprocoptions<>[] then
   if implprocoptions<>[] then
     begin
     begin
       first:=true;
       first:=true;
@@ -3231,7 +3231,7 @@ var
   i: tarraydefoption;
   i: tarraydefoption;
   first: boolean;
   first: boolean;
 begin
 begin
-  ppufile.getsmallset(symoptions);
+  ppufile.getset(tppuset1(symoptions));
   if symoptions<>[] then
   if symoptions<>[] then
    begin
    begin
      if ado_IsDynamicArray in symoptions then Include(ArrayDef.Options, aoDynamic);
      if ado_IsDynamicArray in symoptions then Include(ArrayDef.Options, aoDynamic);
@@ -3284,7 +3284,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(result);
+  ppufile.getset(tppuset2(result));
   if result<>[] then
   if result<>[] then
    begin
    begin
      first:=true;
      first:=true;
@@ -3329,7 +3329,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(result);
+  ppufile.getset(tppuset1(result));
   if result<>[] then
   if result<>[] then
    begin
    begin
      first:=true;
      first:=true;
@@ -4645,7 +4645,7 @@ var
   i      : longint;
   i      : longint;
   first  : boolean;
   first  : boolean;
 begin
 begin
-  ppufile.getsmallset(moduleoptions);
+  ppufile.getset(tppuset1(moduleoptions));
   if moduleoptions<>[] then
   if moduleoptions<>[] then
    begin
    begin
      first:=true;
      first:=true;
@@ -4686,7 +4686,7 @@ begin
            begin
            begin
              CurUnit.LongVersion:=cardinal(getlongint);
              CurUnit.LongVersion:=cardinal(getlongint);
              Writeln(['LongVersion: ',CurUnit.LongVersion]);
              Writeln(['LongVersion: ',CurUnit.LongVersion]);
-             getsmallset(CurUnit.ModuleFlags);
+             getset(tppuset4(CurUnit.ModuleFlags));
              if mf_symansistr in CurUnit.ModuleFlags then
              if mf_symansistr in CurUnit.ModuleFlags then
                SymAnsiStr:=true;
                SymAnsiStr:=true;
            end;
            end;
@@ -4700,7 +4700,7 @@ begin
 
 
          ibfeatures :
          ibfeatures :
            begin
            begin
-             getsmallset(features);
+             getset(tppuset4(features));
              Writeln('Features: ');
              Writeln('Features: ');
              for feature:=low(tfeatures) to high(tfeature) do
              for feature:=low(tfeatures) to high(tfeature) do
                if feature in features then
                if feature in features then
@@ -4880,7 +4880,7 @@ begin
     exit;
     exit;
   CurUnit.LongVersion:=cardinal(ppufile.getlongint);
   CurUnit.LongVersion:=cardinal(ppufile.getlongint);
   Writeln(['LongVersion: ',CurUnit.LongVersion]);
   Writeln(['LongVersion: ',CurUnit.LongVersion]);
-  ppufile.getsmallset(CurUnit.ModuleFlags);
+  ppufile.getset(tppuset4(CurUnit.ModuleFlags));
   result:=ppufile.EndOfEntry;
   result:=ppufile.EndOfEntry;
 end;
 end;