mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 16:09:31 +02:00
+ 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:
parent
4c42f70a3d
commit
a0b1fbfa0e
@ -43,7 +43,7 @@ type
|
||||
{$endif Test_Double_checksum}
|
||||
|
||||
const
|
||||
CurrentPPUVersion=66;
|
||||
CurrentPPUVersion=67;
|
||||
|
||||
{ buffer sizes }
|
||||
maxentrysize = 1024;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user