* 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 -
This commit is contained in:
Jonas Maebe 2019-11-06 21:50:19 +00:00
parent 3b867da924
commit ac1e0f96bd
17 changed files with 141 additions and 154 deletions

View File

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

View File

@ -191,8 +191,6 @@ type
{ bestreal is defined based on the target architecture }
entryreal=bestreal;
{ common part of the header for all kinds of entry files }
tentryheader=record
id : array[1..3] of char;
@ -300,8 +298,7 @@ type
function getstring:string;
function getpshortstring:pshortstring;
function getansistring:ansistring;
procedure getnormalset(out b);
procedure getsmallset(out b);
procedure getset(out arr: array of byte);
function skipuntilentry(untilb:byte):boolean;
{write}
function createfile:boolean;virtual;
@ -326,8 +323,8 @@ type
procedure putboolean(b:boolean); {$ifdef USEINLINE}inline;{$endif}
procedure putstring(const s:string); {$ifdef USEINLINE}inline;{$endif}
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?
function tempopen:boolean; // MG: not used, obsolete?
end;
@ -1386,44 +1383,21 @@ begin
end;
procedure tentryfile.getsmallset(out b);
procedure tentryfile.getset(out arr: array of byte);
var
i : longint;
begin
{$ifdef DEBUG_PPU}
ppu_log('putsmallset');
ppu_log('putset');
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}
getdata(b,4);
getdata(arr,sizeof(arr));
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}
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;
{$endif}
end;
@ -1881,41 +1855,20 @@ procedure tentryfile.putansistring(const s:ansistring);
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}
var
i : byte;
{$endif}
begin
{$ifdef DEBUG_PPU}
ppu_log('putnormalset');
ppu_log('putset');
inc_log_level;
{$endif}
putdata(b,32);
putdata(arr,sizeof(arr));
{$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;
{$endif}
end;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -50,7 +50,7 @@ const
CurrentPPUVersion = 207;
{ for any other changes to the ppu format, increase this version number
(it's a cardinal) }
CurrentPPULongVersion = 6;
CurrentPPULongVersion = 7;
{ unit flags }
uf_big_endian = $000004;
@ -67,6 +67,42 @@ type
{ bestreal is defined based on the target architecture }
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);
tppuheader=record

View File

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

View File

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

View File

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

View File

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