+ write varstate for parameter symbols, enables constant folding for

inlined procedures loaded from ppu files

git-svn-id: trunk@5055 -
This commit is contained in:
florian 2006-10-29 10:46:47 +00:00
parent 4c42f70a3d
commit a0b1fbfa0e
3 changed files with 15 additions and 1 deletions

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
CurrentPPUVersion=66;
CurrentPPUVersion=67;
{ buffer sizes }
maxentrysize = 1024;

View File

@ -1553,6 +1553,13 @@ implementation
begin
inherited ppuload(paravarsym,ppufile);
paranr:=ppufile.getword;
{ The var state of parameter symbols is fixed after writing them so
we write them to the unit file.
This enables constant folding for inline procedures loaded from units
}
varstate:=tvarstate(ppufile.getbyte);
paraloc[calleeside].init;
paraloc[callerside].init;
if vo_has_explicit_paraloc in varoptions then
@ -1571,6 +1578,12 @@ implementation
begin
inherited ppuwrite(ppufile);
ppufile.putword(paranr);
{ The var state of parameter symbols is fixed after writing them so
we write them to the unit file.
This enables constant folding for inline procedures loaded from units
}
ppufile.putbyte(ord(varstate));
if vo_has_explicit_paraloc in varoptions then
begin
paraloc[callerside].check_simple_location;

View File

@ -1497,6 +1497,7 @@ begin
write (space,' DefaultConst : ');
readderef;
writeln(space,' ParaNr : ',getword);
writeln(space,' VarState : ',getbyte);
if (vo_has_explicit_paraloc in varoptions) then
begin
i:=getbyte;