mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 09:59:39 +01:00
Fix inlining of record methods across units if the unit with the method definitions is already compiled.
symdef.pas: + tabstractrecorddef: implement buildderefimpl and derefimpl which works on the symtable (especially derefimpl is important here) - trecorddef & tobjectdef: remove buildderefimpl; it's already handled by the tabstractrecorddef one now - tobjectdef: remove the part of derefimpl that's already handled by tabstractrecorddef git-svn-id: trunk@28267 -
This commit is contained in:
parent
0d96963459
commit
d46ae01589
@ -259,6 +259,8 @@ interface
|
|||||||
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
procedure buildderefimpl;override;
|
||||||
|
procedure derefimpl;override;
|
||||||
procedure check_forwards; virtual;
|
procedure check_forwards; virtual;
|
||||||
function find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
function find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
||||||
function GetSymtable(t:tGetSymtable):TSymtable;override;
|
function GetSymtable(t:tGetSymtable):TSymtable;override;
|
||||||
@ -303,7 +305,6 @@ interface
|
|||||||
override ppuwrite_platform instead }
|
override ppuwrite_platform instead }
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
|
||||||
procedure buildderef;override;
|
procedure buildderef;override;
|
||||||
procedure buildderefimpl;override;
|
|
||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
function size:asizeint;override;
|
function size:asizeint;override;
|
||||||
function alignment : shortint;override;
|
function alignment : shortint;override;
|
||||||
@ -410,7 +411,6 @@ interface
|
|||||||
function GetTypeName:string;override;
|
function GetTypeName:string;override;
|
||||||
procedure buildderef;override;
|
procedure buildderef;override;
|
||||||
procedure deref;override;
|
procedure deref;override;
|
||||||
procedure buildderefimpl;override;
|
|
||||||
procedure derefimpl;override;
|
procedure derefimpl;override;
|
||||||
procedure resetvmtentries;
|
procedure resetvmtentries;
|
||||||
procedure copyvmtentries(objdef:tobjectdef);
|
procedure copyvmtentries(objdef:tobjectdef);
|
||||||
@ -3705,6 +3705,23 @@ implementation
|
|||||||
inherited destroy;
|
inherited destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure tabstractrecorddef.buildderefimpl;
|
||||||
|
begin
|
||||||
|
inherited buildderefimpl;
|
||||||
|
if not (df_copied_def in defoptions) then
|
||||||
|
tstoredsymtable(symtable).buildderefimpl;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure tabstractrecorddef.derefimpl;
|
||||||
|
begin
|
||||||
|
inherited derefimpl;
|
||||||
|
if not (df_copied_def in defoptions) then
|
||||||
|
tstoredsymtable(symtable).derefimpl;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tabstractrecorddef.check_forwards;
|
procedure tabstractrecorddef.check_forwards;
|
||||||
begin
|
begin
|
||||||
{ the defs of a copied def are defined for the original type only }
|
{ the defs of a copied def are defined for the original type only }
|
||||||
@ -4016,14 +4033,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure trecorddef.buildderefimpl;
|
|
||||||
begin
|
|
||||||
inherited buildderefimpl;
|
|
||||||
if not (df_copied_def in defoptions) then
|
|
||||||
tstoredsymtable(symtable).buildderefimpl;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure trecorddef.deref;
|
procedure trecorddef.deref;
|
||||||
begin
|
begin
|
||||||
inherited deref;
|
inherited deref;
|
||||||
@ -6183,19 +6192,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tobjectdef.buildderefimpl;
|
|
||||||
begin
|
|
||||||
inherited buildderefimpl;
|
|
||||||
if not (df_copied_def in defoptions) then
|
|
||||||
tstoredsymtable(symtable).buildderefimpl;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure tobjectdef.derefimpl;
|
procedure tobjectdef.derefimpl;
|
||||||
begin
|
begin
|
||||||
inherited derefimpl;
|
inherited derefimpl;
|
||||||
if not (df_copied_def in defoptions) then
|
|
||||||
tstoredsymtable(symtable).derefimpl;
|
|
||||||
{ the procdefs are not owned by the class helper procsyms, so they
|
{ the procdefs are not owned by the class helper procsyms, so they
|
||||||
are not stored/restored either -> re-add them here }
|
are not stored/restored either -> re-add them here }
|
||||||
if (objecttype=odt_objcclass) or
|
if (objecttype=odt_objcclass) or
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user