Browse Source

Try to fix ppudump for generic/inline.

   * entfile.pas: Differenciate ibsymtableoptions and ibrecsymtableoptions.
   * ppu.pas: Increase ppu unit CurrentPPULongVersion value.
   * utils/ppuutils/ppudump.pp: Add current_symtable_options variable.
     Change readsymtableoptions from procedure to function returning
     the new tsymtableoptions.

git-svn-id: trunk@42530 -
pierre 6 years ago
parent
commit
dca8147958
3 changed files with 25 additions and 14 deletions
  1. 1 1
      compiler/entfile.pas
  2. 1 1
      compiler/ppu.pas
  3. 23 12
      compiler/utils/ppuutils/ppudump.pp

+ 1 - 1
compiler/entfile.pas

@@ -126,9 +126,9 @@ const
 
 
   ibmainname       = 90;
   ibmainname       = 90;
   ibsymtableoptions = 91;
   ibsymtableoptions = 91;
-  ibrecsymtableoptions = 91;
   ibpackagefiles   = 92;
   ibpackagefiles   = 92;
   ibpackagename    = 93;
   ibpackagename    = 93;
+  ibrecsymtableoptions = 94;
   { target-specific things }
   { target-specific things }
   iblinkotherframeworks = 100;
   iblinkotherframeworks = 100;
   ibjvmnamespace = 101;
   ibjvmnamespace = 101;

+ 1 - 1
compiler/ppu.pas

@@ -50,7 +50,7 @@ const
   CurrentPPUVersion = 207;
   CurrentPPUVersion = 207;
   { for any other changes to the ppu format, increase this version number
   { for any other changes to the ppu format, increase this version number
     (it's a cardinal) }
     (it's a cardinal) }
-  CurrentPPULongVersion = 5;
+  CurrentPPULongVersion = 6;
 
 
 { unit flags }
 { unit flags }
   uf_big_endian          = $000004;
   uf_big_endian          = $000004;

+ 23 - 12
compiler/utils/ppuutils/ppudump.pp

@@ -468,6 +468,11 @@ var
   SkipVersionCheck: boolean;
   SkipVersionCheck: boolean;
   SymAnsiStr: boolean;
   SymAnsiStr: boolean;
 
 
+var
+  { needed during tobjectdef parsing... }
+  current_defoptions : tdefoptions;
+  current_objectoptions : tobjectoptions;
+  current_symtable_options : tsymtableoptions;
 
 
 {****************************************************************************
 {****************************************************************************
                           Helper Routines
                           Helper Routines
@@ -922,7 +927,7 @@ begin
   readmanagementoperatoroptions(space,'Fields have MOPs');
   readmanagementoperatoroptions(space,'Fields have MOPs');
 end;
 end;
 
 
-procedure readsymtableoptions(const s: string);
+function readsymtableoptions(const s: string) : tsymtableoptions;
 type
 type
   tsymtblopt=record
   tsymtblopt=record
     mask : tsymtableoption;
     mask : tsymtableoption;
@@ -967,16 +972,27 @@ begin
   else
   else
    write('none');
    write('none');
   writeln;
   writeln;
+  readsymtableoptions:=options;
 end;
 end;
 
 
 procedure readdefinitions(const s:string; ParentDef: TPpuContainerDef); forward;
 procedure readdefinitions(const s:string; ParentDef: TPpuContainerDef); forward;
 procedure readsymbols(const s:string; ParentDef: TPpuContainerDef = nil); forward;
 procedure readsymbols(const s:string; ParentDef: TPpuContainerDef = nil); forward;
 
 
 procedure readsymtable(const s: string; ParentDef: TPpuContainerDef = nil);
 procedure readsymtable(const s: string; ParentDef: TPpuContainerDef = nil);
+var
+  stored_symtable_options : tsymtableoptions;
 begin
 begin
-  readsymtableoptions(s);
+  stored_symtable_options:=current_symtable_options;
+  current_symtable_options:=readsymtableoptions(s);
   readdefinitions(s, ParentDef);
   readdefinitions(s, ParentDef);
   readsymbols(s, ParentDef);
   readsymbols(s, ParentDef);
+  current_symtable_options:=stored_symtable_options;
+end;
+
+procedure readrecordsymtable(const s: string; ParentDef: TPpuContainerDef = nil);
+begin
+  readrecsymtableoptions;
+  readsymtable(s, ParentDef);
 end;
 end;
 
 
 Procedure ReadLinkContainer(const prefix:string);
 Procedure ReadLinkContainer(const prefix:string);
@@ -1851,11 +1867,6 @@ begin
     end;
     end;
 end;
 end;
 
 
-var
-  { needed during tobjectdef parsing... }
-  current_defoptions : tdefoptions;
-  current_objectoptions : tobjectoptions;
-
 procedure readcommondef(const s:string; out defoptions: tdefoptions; Def: TPpuDef = nil);
 procedure readcommondef(const s:string; out defoptions: tdefoptions; Def: TPpuDef = nil);
 type
 type
   tdefopt=record
   tdefopt=record
@@ -4075,7 +4086,9 @@ begin
              readsymtable('parast', TPpuProcDef(def));
              readsymtable('parast', TPpuProcDef(def));
              { localst }
              { localst }
              if (pio_has_inlininginfo in implprocoptions) then
              if (pio_has_inlininginfo in implprocoptions) then
-                readsymtable('localst');
+                readsymtable('inline localst')
+             else if (df_generic in defoptions) then
+                readsymtable('generic localst');
              if (pio_has_inlininginfo in implprocoptions) then
              if (pio_has_inlininginfo in implprocoptions) then
                readnodetree;
                readnodetree;
              delete(space,1,4);
              delete(space,1,4);
@@ -4175,8 +4188,7 @@ begin
              if not(df_copied_def in current_defoptions) then
              if not(df_copied_def in current_defoptions) then
                begin
                begin
                  space:='    '+space;
                  space:='    '+space;
-                 readrecsymtableoptions;
-                 readsymtable('fields',TPpuRecordDef(def));
+                 readrecordsymtable('fields',TPpuRecordDef(def));
                  Delete(space,1,4);
                  Delete(space,1,4);
                end;
                end;
              if not EndOfEntry then
              if not EndOfEntry then
@@ -4295,8 +4307,7 @@ begin
                begin
                begin
                  {read the record definitions and symbols}
                  {read the record definitions and symbols}
                  space:='    '+space;
                  space:='    '+space;
-                 readrecsymtableoptions;
-                 readsymtable('fields',objdef);
+                 readrecordsymtable('fields',objdef);
                  Delete(space,1,4);
                  Delete(space,1,4);
               end;
               end;
              if not EndOfEntry then
              if not EndOfEntry then