Browse Source

* write parameter refs to ppu (only 1=used; 0=unsed), fixes parameter usage checking of inlined procedures loaded from units

git-svn-id: trunk@21482 -
florian 13 years ago
parent
commit
31b1678757
3 changed files with 8 additions and 1 deletions
  1. 1 1
      compiler/ppu.pas
  2. 6 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 = 148;
+  CurrentPPUVersion = 149;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 6 - 0
compiler/symsym.pas

@@ -1833,6 +1833,9 @@ implementation
          }
          varstate:=tvarstate(ppufile.getbyte);
 
+         { read usage info }
+         refs:=ppufile.getbyte;
+
          paraloc[calleeside].init;
          paraloc[callerside].init;
          if vo_has_explicit_paraloc in varoptions then
@@ -1863,6 +1866,9 @@ implementation
          oldintfcrc:=ppufile.do_crc;
          ppufile.do_crc:=false;
          ppufile.putbyte(ord(varstate));
+         { write also info about the usage of parameters,
+           the absolute usage does not matter }
+         ppufile.putbyte(min(1,refs));
          ppufile.do_crc:=oldintfcrc;
 
          if vo_has_explicit_paraloc in varoptions then

+ 1 - 0
compiler/utils/ppudump.pp

@@ -2130,6 +2130,7 @@ begin
              writeln(space,'       ParaNr : ',getword);
              writeln(space,'        Univ  : ',boolean(getbyte));
              writeln(space,'     VarState : ',getbyte);
+             writeln(space,'         Refs : ',getbyte);
              if (vo_has_explicit_paraloc in varoptions) then
                begin
                  i:=getbyte;