mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:06:18 +02:00
* detect whether or not a def/sym is registered based on its defid, so we
don't need a separate field for this o changed the order in which symid and realname are stored to/loaded from the ppufile (because tsym.create now initialised tsym.symid, and it's called from ppuload) -> increased ppu version git-svn-id: trunk@32031 -
This commit is contained in:
parent
20e5b3e586
commit
2d2b8c635d
@ -43,7 +43,7 @@ type
|
|||||||
{$endif Test_Double_checksum}
|
{$endif Test_Double_checksum}
|
||||||
|
|
||||||
const
|
const
|
||||||
CurrentPPUVersion = 178;
|
CurrentPPUVersion = 179;
|
||||||
|
|
||||||
{ buffer sizes }
|
{ buffer sizes }
|
||||||
maxentrysize = 1024;
|
maxentrysize = 1024;
|
||||||
|
@ -145,6 +145,16 @@ const
|
|||||||
{ prefix for names of class helper procsyms added to regular symtables }
|
{ prefix for names of class helper procsyms added to regular symtables }
|
||||||
class_helper_prefix = 'CH$';
|
class_helper_prefix = 'CH$';
|
||||||
|
|
||||||
|
{ tsym.symid value in case the sym has not yet been registered }
|
||||||
|
symid_not_registered = -1;
|
||||||
|
{ tsym.symid value in case the sym has been registered, but not put in a
|
||||||
|
symtable }
|
||||||
|
symid_registered_nost = -2;
|
||||||
|
{ tdef.defid value in case the def has not yet been registered }
|
||||||
|
defid_not_registered = -1;
|
||||||
|
{ tdef.defid value in case the sym has been registered, but not put in a
|
||||||
|
symtable }
|
||||||
|
defid_registered_nost = -2;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ keep this in sync with TIntfFlag in rtl/objpas/typinfo.pp }
|
{ keep this in sync with TIntfFlag in rtl/objpas/typinfo.pp }
|
||||||
|
@ -69,7 +69,7 @@ interface
|
|||||||
protected
|
protected
|
||||||
typesymderef : tderef;
|
typesymderef : tderef;
|
||||||
{ whether this def is already registered in the unit's def list }
|
{ whether this def is already registered in the unit's def list }
|
||||||
registered : boolean;
|
function registered : boolean;
|
||||||
procedure ppuwrite_platform(ppufile:tcompilerppufile);virtual;
|
procedure ppuwrite_platform(ppufile:tcompilerppufile);virtual;
|
||||||
procedure ppuload_platform(ppufile:tcompilerppufile);virtual;
|
procedure ppuload_platform(ppufile:tcompilerppufile);virtual;
|
||||||
public
|
public
|
||||||
@ -1647,6 +1647,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tstoreddef.registered: boolean;
|
||||||
|
begin
|
||||||
|
result:=defid<>defid_not_registered;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tstoreddef.ppuwrite_platform(ppufile: tcompilerppufile);
|
procedure tstoreddef.ppuwrite_platform(ppufile: tcompilerppufile);
|
||||||
begin
|
begin
|
||||||
{ by default: do nothing }
|
{ by default: do nothing }
|
||||||
@ -1710,8 +1716,6 @@ implementation
|
|||||||
begin
|
begin
|
||||||
inherited create(dt);
|
inherited create(dt);
|
||||||
DefId:=ppufile.getlongint;
|
DefId:=ppufile.getlongint;
|
||||||
{ defs loaded from ppu are always owned }
|
|
||||||
registered:=true;
|
|
||||||
current_module.deflist[DefId]:=self;
|
current_module.deflist[DefId]:=self;
|
||||||
{$ifdef EXTDEBUG}
|
{$ifdef EXTDEBUG}
|
||||||
fillchar(fileinfo,sizeof(fileinfo),0);
|
fillchar(fileinfo,sizeof(fileinfo),0);
|
||||||
@ -2141,7 +2145,9 @@ implementation
|
|||||||
begin
|
begin
|
||||||
current_module.deflist.Add(self);
|
current_module.deflist.Add(self);
|
||||||
DefId:=current_module.deflist.Count-1;
|
DefId:=current_module.deflist.Count-1;
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
DefId:=defid_registered_nost;
|
||||||
{ Register in symtable stack }
|
{ Register in symtable stack }
|
||||||
if assigned(symtablestack) then
|
if assigned(symtablestack) then
|
||||||
begin
|
begin
|
||||||
@ -2155,7 +2161,6 @@ implementation
|
|||||||
internalerror(2015022301);
|
internalerror(2015022301);
|
||||||
insertstack^.symtable.insertdef(self);
|
insertstack^.symtable.insertdef(self);
|
||||||
end;
|
end;
|
||||||
registered:=true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ interface
|
|||||||
{ this class is the base for all symbol objects }
|
{ this class is the base for all symbol objects }
|
||||||
tstoredsym = class(tsym)
|
tstoredsym = class(tsym)
|
||||||
private
|
private
|
||||||
registered : boolean;
|
function registered : boolean;
|
||||||
procedure writeentry(ppufile: tcompilerppufile; ibnr: byte);
|
procedure writeentry(ppufile: tcompilerppufile; ibnr: byte);
|
||||||
protected
|
protected
|
||||||
procedure ppuwrite_platform(ppufile: tcompilerppufile);virtual;
|
procedure ppuwrite_platform(ppufile: tcompilerppufile);virtual;
|
||||||
@ -555,10 +555,8 @@ implementation
|
|||||||
|
|
||||||
constructor tstoredsym.ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
constructor tstoredsym.ppuload(st:tsymtyp;ppufile:tcompilerppufile);
|
||||||
begin
|
begin
|
||||||
SymId:=ppufile.getlongint;
|
|
||||||
inherited Create(st,ppufile.getstring);
|
inherited Create(st,ppufile.getstring);
|
||||||
{ Register symbol }
|
SymId:=ppufile.getlongint;
|
||||||
registered:=true;
|
|
||||||
current_module.symlist[SymId]:=self;
|
current_module.symlist[SymId]:=self;
|
||||||
ppufile.getposinfo(fileinfo);
|
ppufile.getposinfo(fileinfo);
|
||||||
visibility:=tvisibility(ppufile.getbyte);
|
visibility:=tvisibility(ppufile.getbyte);
|
||||||
@ -574,8 +572,8 @@ implementation
|
|||||||
var
|
var
|
||||||
oldintfcrc : boolean;
|
oldintfcrc : boolean;
|
||||||
begin
|
begin
|
||||||
ppufile.putlongint(SymId);
|
|
||||||
ppufile.putstring(realname);
|
ppufile.putstring(realname);
|
||||||
|
ppufile.putlongint(SymId);
|
||||||
ppufile.putposinfo(fileinfo);
|
ppufile.putposinfo(fileinfo);
|
||||||
ppufile.putbyte(byte(visibility));
|
ppufile.putbyte(byte(visibility));
|
||||||
{ symoptions can differ between interface and implementation, except
|
{ symoptions can differ between interface and implementation, except
|
||||||
@ -594,6 +592,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tstoredsym.registered: boolean;
|
||||||
|
begin
|
||||||
|
result:=symid<>symid_not_registered;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tstoredsym.writeentry(ppufile: tcompilerppufile; ibnr: byte);
|
procedure tstoredsym.writeentry(ppufile: tcompilerppufile; ibnr: byte);
|
||||||
begin
|
begin
|
||||||
ppuwrite_platform(ppufile);
|
ppuwrite_platform(ppufile);
|
||||||
@ -627,8 +631,9 @@ implementation
|
|||||||
begin
|
begin
|
||||||
current_module.symlist.Add(self);
|
current_module.symlist.Add(self);
|
||||||
SymId:=current_module.symlist.Count-1;
|
SymId:=current_module.symlist.Count-1;
|
||||||
end;
|
end
|
||||||
registered:=true;
|
else
|
||||||
|
SymId:=symid_registered_nost;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
|
@ -264,6 +264,7 @@ implementation
|
|||||||
defoptions:=[];
|
defoptions:=[];
|
||||||
dbg_state:=dbg_state_unused;
|
dbg_state:=dbg_state_unused;
|
||||||
stab_number:=0;
|
stab_number:=0;
|
||||||
|
defid:=defid_not_registered;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -402,6 +403,7 @@ implementation
|
|||||||
isdbgwritten := false;
|
isdbgwritten := false;
|
||||||
visibility:=vis_public;
|
visibility:=vis_public;
|
||||||
deprecatedmsg:=nil;
|
deprecatedmsg:=nil;
|
||||||
|
symid:=symid_not_registered;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor Tsym.destroy;
|
destructor Tsym.destroy;
|
||||||
|
Loading…
Reference in New Issue
Block a user