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 -
This commit is contained in:
pierre 2014-10-03 19:26:16 +00:00
parent de42f2f2f7
commit aa6b62cf4c
6 changed files with 40 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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, //

View File

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