From aa6b62cf4c310f39520ee736902a31f931a8a23a Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 3 Oct 2014 19:26:16 +0000 Subject: [PATCH] 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 - --- compiler/i386/symcpu.pas | 14 ++++++++++---- compiler/m68k/symcpu.pas | 14 ++++++++++---- compiler/pdecsub.pas | 4 ++++ compiler/powerpc/symcpu.pas | 14 ++++++++++---- compiler/symconst.pas | 4 +++- compiler/utils/ppuutils/ppudump.pp | 3 +++ 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/compiler/i386/symcpu.pas b/compiler/i386/symcpu.pas index fc169323f3..6e4ab4bd78 100644 --- a/compiler/i386/symcpu.pas +++ b/compiler/i386/symcpu.pas @@ -186,14 +186,16 @@ implementation procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.getderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.getderef(libsymderef); end; procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.putderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.putderef(libsymderef); end; @@ -208,14 +210,18 @@ implementation procedure tcpuprocdef.buildderef; begin inherited; - libsymderef.build(libsym); + if po_syscall_has_libsym in procoptions then + libsymderef.build(libsym); end; procedure tcpuprocdef.deref; begin inherited; - libsym:=tsym(libsymderef.resolve); + if po_syscall_has_libsym in procoptions then + libsym:=tsym(libsymderef.resolve) + else + libsym:=nil; end; diff --git a/compiler/m68k/symcpu.pas b/compiler/m68k/symcpu.pas index 93702598cb..cb467ba937 100644 --- a/compiler/m68k/symcpu.pas +++ b/compiler/m68k/symcpu.pas @@ -186,14 +186,16 @@ implementation procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.getderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.getderef(libsymderef); end; procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.putderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.putderef(libsymderef); end; @@ -208,14 +210,18 @@ implementation procedure tcpuprocdef.buildderef; begin inherited; - libsymderef.build(libsym); + if po_syscall_has_libsym in procoptions then + libsymderef.build(libsym); end; procedure tcpuprocdef.deref; begin inherited; - libsym:=tsym(libsymderef.resolve); + if po_syscall_has_libsym in procoptions then + libsym:=tsym(libsymderef.resolve) + else + libsym:=nil; end; begin diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index d4f4b99dfb..b1c26a6e50 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -1816,6 +1816,7 @@ begin is_32bitint(tabstractvarsym(sym).vardef) ) then begin + include(pd.procoptions,po_syscall_has_libsym); tcpuprocdef(pd).libsym:=sym; if po_syscall_legacy in tprocdef(pd).procoptions then begin @@ -1850,6 +1851,7 @@ begin is_32bitint(tabstractvarsym(sym).vardef) ) then begin + include(pd.procoptions,po_syscall_has_libsym); tcpuprocdef(pd).libsym:=sym; vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]); pd.parast.insert(vs); @@ -1917,6 +1919,7 @@ begin is_32bitint(tabstractvarsym(sym).vardef) ) then begin + include(pd.procoptions,po_syscall_has_libsym); tcpuprocdef(pd).libsym:=sym; if po_syscall_legacy in tprocdef(pd).procoptions then begin @@ -1973,6 +1976,7 @@ begin is_32bitint(tabstractvarsym(sym).vardef) ) then begin + include(pd.procoptions,po_syscall_has_libsym); tcpuprocdef(pd).libsym:=sym; vs:=cparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]); pd.parast.insert(vs); diff --git a/compiler/powerpc/symcpu.pas b/compiler/powerpc/symcpu.pas index 0e76662a88..30bbefe212 100644 --- a/compiler/powerpc/symcpu.pas +++ b/compiler/powerpc/symcpu.pas @@ -186,14 +186,16 @@ implementation procedure tcpuprocdef.ppuload_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.getderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.getderef(libsymderef); end; procedure tcpuprocdef.ppuwrite_platform(ppufile: tcompilerppufile); begin inherited; - ppufile.putderef(libsymderef); + if po_syscall_has_libsym in procoptions then + ppufile.putderef(libsymderef); end; @@ -208,14 +210,18 @@ implementation procedure tcpuprocdef.buildderef; begin inherited; - libsymderef.build(libsym); + if po_syscall_has_libsym in procoptions then + libsymderef.build(libsym); end; procedure tcpuprocdef.deref; begin inherited; - libsym:=tsym(libsymderef.resolve); + if po_syscall_has_libsym in procoptions then + libsym:=tsym(libsymderef.resolve) + else + libsym:=nil; end; begin diff --git a/compiler/symconst.pas b/compiler/symconst.pas index f82929fd35..a59e3f450a 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -309,6 +309,8 @@ type po_syscall_basesysv, po_syscall_sysvbase, po_syscall_r12base, + { Used to record the fact that a symbol is asociated to this syscall } + po_syscall_has_libsym, { Procedure can be inlined } po_inline, { Procedure is used for internal compiler calls } @@ -461,7 +463,7 @@ type ); tobjectoptions=set of tobjectoption; - tarraydefoption=( + tarraydefoption=( ado_IsConvertedPointer, // array created from pointer (e.g. PInteger(Ptr)[1]) ado_IsDynamicArray, // dynamic array ado_IsVariant, // diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp index 63f6ccba50..e6bbe187f5 100644 --- a/compiler/utils/ppuutils/ppudump.pp +++ b/compiler/utils/ppuutils/ppudump.pp @@ -1739,6 +1739,7 @@ const (mask:po_syscall_basesysv;str:'SyscallBaseSysV'), (mask:po_syscall_sysvbase;str:'SyscallSysVBase'), (mask:po_syscall_r12base; str:'SyscallR12Base'), + (mask:po_syscall_has_libsym; str:'Has LibSym'), (mask:po_inline; str:'Inline'), (mask:po_compilerproc; str:'CompilerProc'), (mask:po_has_importdll; str:'HasImportDLL'), @@ -1817,6 +1818,8 @@ begin i:=ppufile.getbyte; ppufile.getdata(tempbuf,i); end; + if po_syscall_has_libsym in procoptions then + readderef(space); end;