Răsfoiți Sursa

+ write varstate for parameter symbols, enables constant folding for
inlined procedures loaded from ppu files

git-svn-id: trunk@5055 -

florian 19 ani în urmă
părinte
comite
a0b1fbfa0e
3 a modificat fișierele cu 15 adăugiri și 1 ștergeri
  1. 1 1
      compiler/ppu.pas
  2. 13 0
      compiler/symsym.pas
  3. 1 0
      compiler/utils/ppudump.pp

+ 1 - 1
compiler/ppu.pas

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

+ 13 - 0
compiler/symsym.pas

@@ -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;

+ 1 - 0
compiler/utils/ppudump.pp

@@ -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;