* revert has_localst patch

* replace aktstaticsymtable/aktglobalsymtable with current_module
This commit is contained in:
peter 2004-07-09 22:17:31 +00:00
parent fab51678da
commit a939095dbe
9 changed files with 92 additions and 56 deletions

View File

@ -911,11 +911,11 @@ uses
i : longint; i : longint;
begin begin
{ load local symtable first } { load local symtable first }
if ((flags and uf_local_browser)<>0) then {if ((flags and uf_local_browser)<>0) then
begin begin
localsymtable:=tstaticsymtable.create(modulename^); localsymtable:=tstaticsymtable.create(modulename^);
tstaticsymtable(localsymtable).ppuload(ppufile); tstaticsymtable(localsymtable).ppuload(ppufile);
end; end;}
{ load browser } { load browser }
if (flags and uf_has_browser)<>0 then if (flags and uf_has_browser)<>0 then
@ -988,15 +988,13 @@ uses
{ generate implementation deref data, the interface deref data is { generate implementation deref data, the interface deref data is
already generated when calculating the interface crc } already generated when calculating the interface crc }
aktglobalsymtable:=tstoredsymtable(globalsymtable);
aktstaticsymtable:=tstoredsymtable(localsymtable);
if (cs_compilesystem in aktmoduleswitches) then if (cs_compilesystem in aktmoduleswitches) then
begin begin
tstoredsymtable(globalsymtable).buildderef; tstoredsymtable(globalsymtable).buildderef;
derefdataintflen:=derefdata.size; derefdataintflen:=derefdata.size;
end; end;
tstoredsymtable(globalsymtable).buildderefimpl; tstoredsymtable(globalsymtable).buildderefimpl;
if ((flags and uf_local_browser)<>0) and if {((flags and uf_local_browser)<>0) and}
assigned(localsymtable) then assigned(localsymtable) then
begin begin
tstoredsymtable(localsymtable).buildderef; tstoredsymtable(localsymtable).buildderef;
@ -1023,7 +1021,7 @@ uses
{ write static symtable { write static symtable
needed for local debugging of unit functions } needed for local debugging of unit functions }
if ((flags and uf_local_browser)<>0) and if {((flags and uf_local_browser)<>0) and}
assigned(localsymtable) then assigned(localsymtable) then
tstoredsymtable(localsymtable).ppuwrite(ppufile); tstoredsymtable(localsymtable).ppuwrite(ppufile);
@ -1093,7 +1091,6 @@ uses
{ deref data of interface that affect the crc } { deref data of interface that affect the crc }
derefdata.reset; derefdata.reset;
aktglobalsymtable:=tstoredsymtable(globalsymtable);
tstoredsymtable(globalsymtable).buildderef; tstoredsymtable(globalsymtable).buildderef;
derefdataintflen:=derefdata.size; derefdataintflen:=derefdata.size;
writederefdata; writederefdata;
@ -1220,11 +1217,13 @@ uses
end; end;
numberunits; numberunits;
{ load implementation symtable }
localsymtable:=tstaticsymtable.create(modulename^);
tstaticsymtable(localsymtable).ppuload(ppufile);
{ we can now derefence all pointers to the implementation parts } { we can now derefence all pointers to the implementation parts }
oldobjectlibrary:=objectlibrary; oldobjectlibrary:=objectlibrary;
objectlibrary:=librarydata; objectlibrary:=librarydata;
aktglobalsymtable:=tstoredsymtable(globalsymtable);
aktstaticsymtable:=tstoredsymtable(localsymtable);
tstoredsymtable(globalsymtable).derefimpl; tstoredsymtable(globalsymtable).derefimpl;
if assigned(localsymtable) then if assigned(localsymtable) then
tstoredsymtable(localsymtable).derefimpl; tstoredsymtable(localsymtable).derefimpl;
@ -1309,12 +1308,10 @@ uses
if interface_compiled then if interface_compiled then
begin begin
Message1(unit_u_reresolving_unit,modulename^); Message1(unit_u_reresolving_unit,modulename^);
aktglobalsymtable:=tstoredsymtable(globalsymtable);
tstoredsymtable(globalsymtable).deref; tstoredsymtable(globalsymtable).deref;
tstoredsymtable(globalsymtable).derefimpl; tstoredsymtable(globalsymtable).derefimpl;
if assigned(localsymtable) then if assigned(localsymtable) then
begin begin
aktstaticsymtable:=tstoredsymtable(localsymtable);
tstoredsymtable(localsymtable).deref; tstoredsymtable(localsymtable).deref;
tstoredsymtable(localsymtable).derefimpl; tstoredsymtable(localsymtable).derefimpl;
end; end;
@ -1524,7 +1521,11 @@ uses
end. end.
{ {
$Log$ $Log$
Revision 1.58 2004-07-06 20:23:25 peter Revision 1.59 2004-07-09 22:17:31 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.58 2004/07/06 20:23:25 peter
* remove unused and not loaded units before linking * remove unused and not loaded units before linking
Revision 1.57 2004/07/06 19:52:04 peter Revision 1.57 2004/07/06 19:52:04 peter

View File

@ -704,8 +704,8 @@ implementation
if (procdefcoll^.data.proccalloption<>pd.proccalloption) or if (procdefcoll^.data.proccalloption<>pd.proccalloption) or
(procdefcoll^.data.proctypeoption<>pd.proctypeoption) or (procdefcoll^.data.proctypeoption<>pd.proctypeoption) or
((procdefcoll^.data.procoptions- ((procdefcoll^.data.procoptions-
[po_abstractmethod,po_overridingmethod,po_assembler,po_overload,po_public,po_haslocalst,po_reintroduce])<> [po_abstractmethod,po_overridingmethod,po_assembler,po_overload,po_public,po_reintroduce])<>
(pd.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler,po_overload,po_public,po_haslocalst,po_reintroduce])) then (pd.procoptions-[po_abstractmethod,po_overridingmethod,po_assembler,po_overload,po_public,po_reintroduce])) then
begin begin
MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,pd.fullprocname(false)); MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,pd.fullprocname(false));
tprocsym(procdefcoll^.data.procsym).write_parameter_lists(pd); tprocsym(procdefcoll^.data.procsym).write_parameter_lists(pd);
@ -1382,7 +1382,11 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.73 2004-07-06 20:58:50 peter Revision 1.74 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.73 2004/07/06 20:58:50 peter
* ignore po_haslocalst * ignore po_haslocalst
Revision 1.72 2004/06/29 20:58:46 peter Revision 1.72 2004/06/29 20:58:46 peter

View File

@ -938,7 +938,6 @@ implementation
if procdef.parast.symtablelevel>=normal_function_level then if procdef.parast.symtablelevel>=normal_function_level then
procdef.localst.free; procdef.localst.free;
procdef.localst:=nil; procdef.localst:=nil;
exclude(procdef.procoptions,po_haslocalst);
end; end;
{ remove code tree, if not inline procedure } { remove code tree, if not inline procedure }
@ -1384,7 +1383,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.197 2004-07-06 19:52:04 peter Revision 1.198 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.197 2004/07/06 19:52:04 peter
* fix storing of localst in ppu * fix storing of localst in ppu
Revision 1.196 2004/06/20 08:55:30 florian Revision 1.196 2004/06/20 08:55:30 florian

View File

@ -138,8 +138,6 @@ interface
symtablestack : tsymtable; { linked list of symtables } symtablestack : tsymtable; { linked list of symtables }
aktrecordsymtable : tsymtable; { current record symtable } aktrecordsymtable : tsymtable; { current record symtable }
aktstaticsymtable : tsymtable; { current static symtable }
aktglobalsymtable : tsymtable; { current global symtable }
aktparasymtable : tsymtable; { current proc para symtable } aktparasymtable : tsymtable; { current proc para symtable }
aktlocalsymtable : tsymtable; { current proc local symtable } aktlocalsymtable : tsymtable; { current proc local symtable }
@ -333,7 +331,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.21 2004-06-20 08:55:30 florian Revision 1.22 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.21 2004/06/20 08:55:30 florian
* logs truncated * logs truncated
Revision 1.20 2004/03/02 17:32:12 florian Revision 1.20 2004/03/02 17:32:12 florian

View File

@ -235,9 +235,7 @@ type
conventions like that one of MorphOS } conventions like that one of MorphOS }
po_explicitparaloc, po_explicitparaloc,
{ no stackframe will be generated, used by lowlevel assembler like get_frame } { no stackframe will be generated, used by lowlevel assembler like get_frame }
po_nostackframe, po_nostackframe
{ localst is valid }
po_haslocalst
); );
tprocoptions=set of tprocoption; tprocoptions=set of tprocoption;
@ -411,7 +409,11 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.85 2004-07-06 19:52:04 peter Revision 1.86 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.85 2004/07/06 19:52:04 peter
* fix storing of localst in ppu * fix storing of localst in ppu
Revision 1.84 2004/06/20 08:55:30 florian Revision 1.84 2004/06/20 08:55:30 florian

View File

@ -3697,7 +3697,8 @@ implementation
tparasymtable(parast).ppuload(ppufile); tparasymtable(parast).ppuload(ppufile);
parast.defowner:=self; parast.defowner:=self;
{ load local symtable } { load local symtable }
if (po_haslocalst in procoptions) then if ((proccalloption=pocall_inline) or
((current_module.flags and uf_local_browser)<>0)) then
begin begin
localst:=tlocalsymtable.create(level); localst:=tlocalsymtable.create(level);
tlocalsymtable(localst).ppuload(ppufile); tlocalsymtable(localst).ppuload(ppufile);
@ -3829,7 +3830,9 @@ implementation
{ save localsymtable for inline procedures or when local { save localsymtable for inline procedures or when local
browser info is requested, this has no influence on the crc } browser info is requested, this has no influence on the crc }
if (po_haslocalst in procoptions) then if assigned(localst) and
((proccalloption=pocall_inline) or
((current_module.flags and uf_local_browser)<>0)) then
begin begin
oldintfcrc:=ppufile.do_crc; oldintfcrc:=ppufile.do_crc;
ppufile.do_crc:=false; ppufile.do_crc:=false;
@ -3851,14 +3854,13 @@ implementation
procedure tprocdef.insert_localst; procedure tprocdef.insert_localst;
begin begin
localst:=tlocalsymtable.create(parast.symtablelevel); localst:=tlocalsymtable.create(parast.symtablelevel);
localst.defowner:=self; localst.defowner:=self;
{ this is used by insert { this is used by insert
to check same names in parast and localst } to check same names in parast and localst }
localst.next:=parast; localst.next:=parast;
include(procoptions,po_haslocalst); end;
end;
function tprocdef.fullprocname(showhidden:boolean):string; function tprocdef.fullprocname(showhidden:boolean):string;
@ -3987,7 +3989,7 @@ implementation
if move_last then if move_last then
lastwritten:=lastref; lastwritten:=lastref;
if ((current_module.flags and uf_local_browser)<>0) and if ((current_module.flags and uf_local_browser)<>0) and
(po_haslocalst in procoptions) and assigned(localst) and
locals then locals then
begin begin
tparasymtable(parast).load_references(ppufile,locals); tparasymtable(parast).load_references(ppufile,locals);
@ -4047,7 +4049,7 @@ implementation
ppufile.writeentry(ibdefref); ppufile.writeentry(ibdefref);
write_references:=true; write_references:=true;
if ((current_module.flags and uf_local_browser)<>0) and if ((current_module.flags and uf_local_browser)<>0) and
(po_haslocalst in procoptions) and assigned(localst) and
locals then locals then
begin begin
pdo:=_class; pdo:=_class;
@ -4195,7 +4197,9 @@ implementation
inherited buildderefimpl; inherited buildderefimpl;
{ Locals } { Locals }
if (po_haslocalst in procoptions) then if assigned(localst) and
((proccalloption=pocall_inline) or
((current_module.flags and uf_local_browser)<>0)) then
begin begin
tlocalsymtable(localst).buildderef; tlocalsymtable(localst).buildderef;
tlocalsymtable(localst).buildderefimpl; tlocalsymtable(localst).buildderefimpl;
@ -4253,7 +4257,7 @@ implementation
aktlocalsymtable:=localst; aktlocalsymtable:=localst;
{ Locals } { Locals }
if (po_haslocalst in procoptions) then if assigned(localst) then
begin begin
tlocalsymtable(localst).deref; tlocalsymtable(localst).deref;
tlocalsymtable(localst).derefimpl; tlocalsymtable(localst).derefimpl;
@ -6125,7 +6129,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.244 2004-07-06 19:52:04 peter Revision 1.245 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.244 2004/07/06 19:52:04 peter
* fix storing of localst in ppu * fix storing of localst in ppu
Revision 1.243 2004/06/20 08:55:30 florian Revision 1.243 2004/06/20 08:55:30 florian

View File

@ -1414,8 +1414,6 @@ implementation
procedure tstaticsymtable.ppuload(ppufile:tcompilerppufile); procedure tstaticsymtable.ppuload(ppufile:tcompilerppufile);
begin begin
aktstaticsymtable:=self;
next:=symtablestack; next:=symtablestack;
symtablestack:=self; symtablestack:=self;
@ -1431,24 +1429,18 @@ implementation
procedure tstaticsymtable.ppuwrite(ppufile:tcompilerppufile); procedure tstaticsymtable.ppuwrite(ppufile:tcompilerppufile);
begin begin
aktstaticsymtable:=self;
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
end; end;
procedure tstaticsymtable.load_references(ppufile:tcompilerppufile;locals:boolean); procedure tstaticsymtable.load_references(ppufile:tcompilerppufile;locals:boolean);
begin begin
aktstaticsymtable:=self;
inherited load_references(ppufile,locals); inherited load_references(ppufile,locals);
end; end;
procedure tstaticsymtable.write_references(ppufile:tcompilerppufile;locals:boolean); procedure tstaticsymtable.write_references(ppufile:tcompilerppufile;locals:boolean);
begin begin
aktstaticsymtable:=self;
inherited write_references(ppufile,locals); inherited write_references(ppufile,locals);
end; end;
@ -1526,8 +1518,6 @@ implementation
end; end;
{$endif GDB} {$endif GDB}
aktglobalsymtable:=self;
next:=symtablestack; next:=symtablestack;
symtablestack:=self; symtablestack:=self;
@ -1566,8 +1556,6 @@ implementation
procedure tglobalsymtable.ppuwrite(ppufile:tcompilerppufile); procedure tglobalsymtable.ppuwrite(ppufile:tcompilerppufile);
begin begin
aktglobalsymtable:=self;
{ write the symtable entries } { write the symtable entries }
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
@ -1589,16 +1577,12 @@ implementation
procedure tglobalsymtable.load_references(ppufile:tcompilerppufile;locals:boolean); procedure tglobalsymtable.load_references(ppufile:tcompilerppufile;locals:boolean);
begin begin
aktglobalsymtable:=self;
inherited load_references(ppufile,locals); inherited load_references(ppufile,locals);
end; end;
procedure tglobalsymtable.write_references(ppufile:tcompilerppufile;locals:boolean); procedure tglobalsymtable.write_references(ppufile:tcompilerppufile;locals:boolean);
begin begin
aktglobalsymtable:=self;
inherited write_references(ppufile,locals); inherited write_references(ppufile,locals);
end; end;
@ -2332,7 +2316,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.151 2004-06-23 16:22:45 peter Revision 1.152 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.151 2004/06/23 16:22:45 peter
* include unit name in error messages when types are the same * include unit name in error messages when types are the same
Revision 1.150 2004/06/20 08:55:30 florian Revision 1.150 2004/06/20 08:55:30 florian

View File

@ -867,7 +867,7 @@ implementation
staticsymtable : staticsymtable :
begin begin
{ only references to the current static symtable are allowed } { only references to the current static symtable are allowed }
if s.owner<>aktstaticsymtable then if s.owner<>current_module.localsymtable then
internalerror(200306233); internalerror(200306233);
data[len]:=ord(deref_aktstatic); data[len]:=ord(deref_aktstatic);
inc(len); inc(len);
@ -1094,9 +1094,9 @@ implementation
deref_aktrecord : deref_aktrecord :
st:=aktrecordsymtable; st:=aktrecordsymtable;
deref_aktstatic : deref_aktstatic :
st:=aktstaticsymtable; st:=current_module.localsymtable;
deref_aktglobal : deref_aktglobal :
st:=aktglobalsymtable; st:=current_module.globalsymtable;
deref_aktlocal : deref_aktlocal :
st:=aktlocalsymtable; st:=aktlocalsymtable;
deref_aktpara : deref_aktpara :
@ -1487,7 +1487,11 @@ finalization
end. end.
{ {
$Log$ $Log$
Revision 1.43 2004-06-20 08:55:30 florian Revision 1.44 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.43 2004/06/20 08:55:30 florian
* logs truncated * logs truncated
Revision 1.42 2004/06/16 20:07:10 florian Revision 1.42 2004/06/16 20:07:10 florian

View File

@ -1851,6 +1851,26 @@ begin
readsymbols('implementation'); readsymbols('implementation');
end; end;
end; end;
{read the definitions}
if (verbose and v_defs)<>0 then
begin
Writeln;
Writeln('Implementation definitions');
Writeln('----------------------');
readdefinitions('implementation',false);
end
else
ppufile.skipuntilentry(ibenddefs);
{read the symbols}
if (verbose and v_syms)<>0 then
begin
Writeln;
Writeln('Implementation Symbols');
Writeln('------------------');
readsymbols('implementation');
end
else
ppufile.skipuntilentry(ibendsyms);
{read the browser units stuff} {read the browser units stuff}
if (ppufile.header.flags and uf_has_browser)<>0 then if (ppufile.header.flags and uf_has_browser)<>0 then
begin begin
@ -1961,7 +1981,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.51 2004-07-06 19:52:04 peter Revision 1.52 2004-07-09 22:17:32 peter
* revert has_localst patch
* replace aktstaticsymtable/aktglobalsymtable with current_module
Revision 1.51 2004/07/06 19:52:04 peter
* fix storing of localst in ppu * fix storing of localst in ppu
Revision 1.50 2003/12/16 21:29:25 florian Revision 1.50 2003/12/16 21:29:25 florian