浏览代码

Add new procedure option: po_syscall_has_libsym,
include this option only of libsym field
is non NIL.
Use this option to only write redef of libsym if needed.
Adapt ppudump source to this new procedure option.

git-svn-id: trunk@28732 -

pierre 10 年之前
父节点
当前提交
aa6b62cf4c
共有 6 个文件被更改,包括 40 次插入13 次删除
  1. 10 4
      compiler/i386/symcpu.pas
  2. 10 4
      compiler/m68k/symcpu.pas
  3. 4 0
      compiler/pdecsub.pas
  4. 10 4
      compiler/powerpc/symcpu.pas
  5. 3 1
      compiler/symconst.pas
  6. 3 0
      compiler/utils/ppuutils/ppudump.pp

+ 10 - 4
compiler/i386/symcpu.pas

@@ -186,14 +186,16 @@ implementation
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.getderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.getderef(libsymderef);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.putderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.putderef(libsymderef);
     end;
     end;
 
 
 
 
@@ -208,14 +210,18 @@ implementation
   procedure tcpuprocdef.buildderef;
   procedure tcpuprocdef.buildderef;
     begin
     begin
       inherited;
       inherited;
-      libsymderef.build(libsym);
+      if po_syscall_has_libsym in procoptions then
+        libsymderef.build(libsym);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.deref;
   procedure tcpuprocdef.deref;
     begin
     begin
       inherited;
       inherited;
-      libsym:=tsym(libsymderef.resolve);
+      if po_syscall_has_libsym in procoptions then
+        libsym:=tsym(libsymderef.resolve)
+      else
+        libsym:=nil;
     end;
     end;
 
 
 
 

+ 10 - 4
compiler/m68k/symcpu.pas

@@ -186,14 +186,16 @@ implementation
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.getderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.getderef(libsymderef);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.putderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.putderef(libsymderef);
     end;
     end;
 
 
 
 
@@ -208,14 +210,18 @@ implementation
   procedure tcpuprocdef.buildderef;
   procedure tcpuprocdef.buildderef;
     begin
     begin
       inherited;
       inherited;
-      libsymderef.build(libsym);
+      if po_syscall_has_libsym in procoptions then
+        libsymderef.build(libsym);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.deref;
   procedure tcpuprocdef.deref;
     begin
     begin
       inherited;
       inherited;
-      libsym:=tsym(libsymderef.resolve);
+      if po_syscall_has_libsym in procoptions then
+        libsym:=tsym(libsymderef.resolve)
+      else
+        libsym:=nil;
     end;
     end;
 
 
 begin
 begin

+ 4 - 0
compiler/pdecsub.pas

@@ -1816,6 +1816,7 @@ begin
               is_32bitint(tabstractvarsym(sym).vardef)
               is_32bitint(tabstractvarsym(sym).vardef)
              ) then
              ) then
             begin
             begin
+              include(pd.procoptions,po_syscall_has_libsym);
               tcpuprocdef(pd).libsym:=sym;
               tcpuprocdef(pd).libsym:=sym;
               if po_syscall_legacy in tprocdef(pd).procoptions then
               if po_syscall_legacy in tprocdef(pd).procoptions then
                 begin
                 begin
@@ -1850,6 +1851,7 @@ begin
               is_32bitint(tabstractvarsym(sym).vardef)
               is_32bitint(tabstractvarsym(sym).vardef)
              ) then
              ) then
             begin
             begin
+              include(pd.procoptions,po_syscall_has_libsym);
               tcpuprocdef(pd).libsym:=sym;
               tcpuprocdef(pd).libsym:=sym;
               vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
               vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
               pd.parast.insert(vs);
               pd.parast.insert(vs);
@@ -1917,6 +1919,7 @@ begin
               is_32bitint(tabstractvarsym(sym).vardef)
               is_32bitint(tabstractvarsym(sym).vardef)
              ) then
              ) then
             begin
             begin
+              include(pd.procoptions,po_syscall_has_libsym);
               tcpuprocdef(pd).libsym:=sym;
               tcpuprocdef(pd).libsym:=sym;
               if po_syscall_legacy in tprocdef(pd).procoptions then
               if po_syscall_legacy in tprocdef(pd).procoptions then
                 begin
                 begin
@@ -1973,6 +1976,7 @@ begin
               is_32bitint(tabstractvarsym(sym).vardef)
               is_32bitint(tabstractvarsym(sym).vardef)
              ) then
              ) then
             begin
             begin
+              include(pd.procoptions,po_syscall_has_libsym);
               tcpuprocdef(pd).libsym:=sym;
               tcpuprocdef(pd).libsym:=sym;
               vs:=cparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
               vs:=cparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
               pd.parast.insert(vs);
               pd.parast.insert(vs);

+ 10 - 4
compiler/powerpc/symcpu.pas

@@ -186,14 +186,16 @@ implementation
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.getderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.getderef(libsymderef);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
   procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile);
     begin
     begin
       inherited;
       inherited;
-      ppufile.putderef(libsymderef);
+      if po_syscall_has_libsym in procoptions then
+        ppufile.putderef(libsymderef);
     end;
     end;
 
 
 
 
@@ -208,14 +210,18 @@ implementation
   procedure tcpuprocdef.buildderef;
   procedure tcpuprocdef.buildderef;
     begin
     begin
       inherited;
       inherited;
-      libsymderef.build(libsym);
+      if po_syscall_has_libsym in procoptions then
+        libsymderef.build(libsym);
     end;
     end;
 
 
 
 
   procedure tcpuprocdef.deref;
   procedure tcpuprocdef.deref;
     begin
     begin
       inherited;
       inherited;
-      libsym:=tsym(libsymderef.resolve);
+      if po_syscall_has_libsym in procoptions then
+        libsym:=tsym(libsymderef.resolve)
+      else
+        libsym:=nil;
     end;
     end;
 
 
 begin
 begin

+ 3 - 1
compiler/symconst.pas

@@ -309,6 +309,8 @@ type
     po_syscall_basesysv,
     po_syscall_basesysv,
     po_syscall_sysvbase,
     po_syscall_sysvbase,
     po_syscall_r12base,
     po_syscall_r12base,
+    { Used to record the fact that a symbol is asociated to this syscall }
+    po_syscall_has_libsym,
     { Procedure can be inlined }
     { Procedure can be inlined }
     po_inline,
     po_inline,
     { Procedure is used for internal compiler calls }
     { Procedure is used for internal compiler calls }
@@ -461,7 +463,7 @@ type
   );
   );
   tobjectoptions=set of tobjectoption;
   tobjectoptions=set of tobjectoption;
 
 
-  tarraydefoption=(    
+  tarraydefoption=(
     ado_IsConvertedPointer, // array created from pointer (e.g. PInteger(Ptr)[1])
     ado_IsConvertedPointer, // array created from pointer (e.g. PInteger(Ptr)[1])
     ado_IsDynamicArray,     // dynamic array
     ado_IsDynamicArray,     // dynamic array
     ado_IsVariant,          //
     ado_IsVariant,          //

+ 3 - 0
compiler/utils/ppuutils/ppudump.pp

@@ -1739,6 +1739,7 @@ const
      (mask:po_syscall_basesysv;str:'SyscallBaseSysV'),
      (mask:po_syscall_basesysv;str:'SyscallBaseSysV'),
      (mask:po_syscall_sysvbase;str:'SyscallSysVBase'),
      (mask:po_syscall_sysvbase;str:'SyscallSysVBase'),
      (mask:po_syscall_r12base; str:'SyscallR12Base'),
      (mask:po_syscall_r12base; str:'SyscallR12Base'),
+     (mask:po_syscall_has_libsym; str:'Has LibSym'),
      (mask:po_inline;          str:'Inline'),
      (mask:po_inline;          str:'Inline'),
      (mask:po_compilerproc;    str:'CompilerProc'),
      (mask:po_compilerproc;    str:'CompilerProc'),
      (mask:po_has_importdll;   str:'HasImportDLL'),
      (mask:po_has_importdll;   str:'HasImportDLL'),
@@ -1817,6 +1818,8 @@ begin
       i:=ppufile.getbyte;
       i:=ppufile.getbyte;
       ppufile.getdata(tempbuf,i);
       ppufile.getdata(tempbuf,i);
     end;
     end;
+  if po_syscall_has_libsym in procoptions then
+      readderef(space);
 end;
 end;