mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 03:32:31 +02:00
* fix checking for forwards in static symtable
This commit is contained in:
parent
b3225df663
commit
d4dcaeafaf
@ -1118,9 +1118,6 @@ implementation
|
|||||||
{ the last char should always be a point }
|
{ the last char should always be a point }
|
||||||
consume(_POINT);
|
consume(_POINT);
|
||||||
|
|
||||||
{ generate a list of threadvars }
|
|
||||||
InsertThreadvars;
|
|
||||||
|
|
||||||
{ Generate resoucestrings }
|
{ Generate resoucestrings }
|
||||||
If ResourceStrings.ResStrCount>0 then
|
If ResourceStrings.ResStrCount>0 then
|
||||||
begin
|
begin
|
||||||
@ -1131,18 +1128,6 @@ implementation
|
|||||||
ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
|
ResourceStrings.WriteResourceFile(ForceExtension(current_module.ppufilename^,'.rst'));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (Errorcount=0) then
|
|
||||||
begin
|
|
||||||
{ test static symtable }
|
|
||||||
tstoredsymtable(st).allsymbolsused;
|
|
||||||
tstoredsymtable(st).allprivatesused;
|
|
||||||
current_module.allunitsused;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$ifdef GDB}
|
|
||||||
write_gdb_info;
|
|
||||||
{$endif GDB}
|
|
||||||
|
|
||||||
if (Errorcount=0) then
|
if (Errorcount=0) then
|
||||||
begin
|
begin
|
||||||
{ tests, if all (interface) forwards are resolved }
|
{ tests, if all (interface) forwards are resolved }
|
||||||
@ -1151,6 +1136,16 @@ implementation
|
|||||||
tstoredsymtable(symtablestack).allprivatesused;
|
tstoredsymtable(symtablestack).allprivatesused;
|
||||||
{ remove cross unit overloads }
|
{ remove cross unit overloads }
|
||||||
tstoredsymtable(symtablestack).unchain_overloaded;
|
tstoredsymtable(symtablestack).unchain_overloaded;
|
||||||
|
|
||||||
|
{ test static symtable }
|
||||||
|
tstoredsymtable(st).allsymbolsused;
|
||||||
|
tstoredsymtable(st).allprivatesused;
|
||||||
|
tstoredsymtable(st).check_forwards;
|
||||||
|
tstoredsymtable(st).checklabels;
|
||||||
|
tstoredsymtable(st).unchain_overloaded;
|
||||||
|
|
||||||
|
{ used units }
|
||||||
|
current_module.allunitsused;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ leave when we got an error }
|
{ leave when we got an error }
|
||||||
@ -1161,6 +1156,14 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ generate debuginfo }
|
||||||
|
{$ifdef GDB}
|
||||||
|
write_gdb_info;
|
||||||
|
{$endif GDB}
|
||||||
|
|
||||||
|
{ generate a list of threadvars }
|
||||||
|
InsertThreadvars;
|
||||||
|
|
||||||
{ generate imports }
|
{ generate imports }
|
||||||
if current_module.uses_imports then
|
if current_module.uses_imports then
|
||||||
importlib.generatelib;
|
importlib.generatelib;
|
||||||
@ -1388,9 +1391,16 @@ implementation
|
|||||||
{ consume the last point }
|
{ consume the last point }
|
||||||
consume(_POINT);
|
consume(_POINT);
|
||||||
|
|
||||||
{$ifdef GDB}
|
if (Errorcount=0) then
|
||||||
write_gdb_info;
|
begin
|
||||||
{$endif GDB}
|
{ test static symtable }
|
||||||
|
tstoredsymtable(st).allsymbolsused;
|
||||||
|
tstoredsymtable(st).allprivatesused;
|
||||||
|
tstoredsymtable(st).check_forwards;
|
||||||
|
tstoredsymtable(st).checklabels;
|
||||||
|
tstoredsymtable(st).unchain_overloaded;
|
||||||
|
current_module.allunitsused;
|
||||||
|
end;
|
||||||
|
|
||||||
{ leave when we got an error }
|
{ leave when we got an error }
|
||||||
if (Errorcount>0) and not status.skip_error then
|
if (Errorcount>0) and not status.skip_error then
|
||||||
@ -1400,13 +1410,10 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (Errorcount=0) then
|
{ generate debuginfo }
|
||||||
begin
|
{$ifdef GDB}
|
||||||
{ test static symtable }
|
write_gdb_info;
|
||||||
tstoredsymtable(st).allsymbolsused;
|
{$endif GDB}
|
||||||
tstoredsymtable(st).allprivatesused;
|
|
||||||
current_module.allunitsused;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ generate a list of threadvars }
|
{ generate a list of threadvars }
|
||||||
InsertThreadvars;
|
InsertThreadvars;
|
||||||
@ -1473,7 +1480,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.151 2004-05-11 18:22:16 olle
|
Revision 1.152 2004-05-16 13:29:21 peter
|
||||||
|
* fix checking for forwards in static symtable
|
||||||
|
|
||||||
|
Revision 1.151 2004/05/11 18:22:16 olle
|
||||||
* changed $mode mac to $mode macpas (macro defined should be FPC_MACPAS)
|
* changed $mode mac to $mode macpas (macro defined should be FPC_MACPAS)
|
||||||
|
|
||||||
Revision 1.150 2004/05/03 09:55:27 olle
|
Revision 1.150 2004/05/03 09:55:27 olle
|
||||||
|
@ -959,39 +959,38 @@ implementation
|
|||||||
exitswitches:=aktlocalswitches;
|
exitswitches:=aktlocalswitches;
|
||||||
exitpos:=last_endtoken_filepos;
|
exitpos:=last_endtoken_filepos;
|
||||||
|
|
||||||
if assigned(code) then
|
|
||||||
begin
|
|
||||||
{ get a better entry point }
|
|
||||||
entrypos:=code.fileinfo;
|
|
||||||
|
|
||||||
{ the procedure is now defined }
|
{ the procedure is now defined }
|
||||||
procdef.forwarddef:=false;
|
procdef.forwarddef:=false;
|
||||||
|
|
||||||
if (Errorcount=0) then
|
{ Check for unused labels, forwards, symbols for procedures. Static
|
||||||
|
symtable is checked in pmodules }
|
||||||
|
if (Errorcount=0) and
|
||||||
|
(tstoredsymtable(procdef.localst).symtabletype<>staticsymtable) then
|
||||||
begin
|
begin
|
||||||
{ add implicit entry and exit code }
|
|
||||||
add_entry_exit_code;
|
|
||||||
{ check if forwards are resolved }
|
{ check if forwards are resolved }
|
||||||
tstoredsymtable(procdef.localst).check_forwards;
|
tstoredsymtable(procdef.localst).check_forwards;
|
||||||
{ check if all labels are used }
|
{ check if all labels are used }
|
||||||
tstoredsymtable(procdef.localst).checklabels;
|
tstoredsymtable(procdef.localst).checklabels;
|
||||||
{ remove cross unit overloads }
|
{ remove cross unit overloads }
|
||||||
tstoredsymtable(procdef.localst).unchain_overloaded;
|
tstoredsymtable(procdef.localst).unchain_overloaded;
|
||||||
end;
|
|
||||||
|
|
||||||
{ check for unused symbols, but only if there is no asm block }
|
{ check for unused symbols, but only if there is no asm block }
|
||||||
if not(pi_uses_asm in flags) then
|
if not(pi_uses_asm in flags) then
|
||||||
begin
|
begin
|
||||||
{ not for unit init, becuase the var can be used in finalize,
|
|
||||||
it will be done in proc_unit }
|
|
||||||
if not(procdef.proctypeoption in [potype_proginit,potype_unitinit,potype_unitfinalize]) then
|
|
||||||
tstoredsymtable(procdef.localst).allsymbolsused;
|
tstoredsymtable(procdef.localst).allsymbolsused;
|
||||||
tstoredsymtable(procdef.parast).allsymbolsused;
|
tstoredsymtable(procdef.parast).allsymbolsused;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if assigned(code) then
|
||||||
|
begin
|
||||||
|
{ get a better entry point }
|
||||||
|
entrypos:=code.fileinfo;
|
||||||
|
|
||||||
|
{ add implicit entry and exit code }
|
||||||
|
add_entry_exit_code;
|
||||||
|
|
||||||
{ Finish type checking pass }
|
{ Finish type checking pass }
|
||||||
do_resulttypepass(code);
|
do_resulttypepass(code);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ store a copy of the original tree for inline, for
|
{ store a copy of the original tree for inline, for
|
||||||
@ -1346,7 +1345,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.187 2004-04-11 12:37:30 peter
|
Revision 1.188 2004-05-16 13:29:21 peter
|
||||||
|
* fix checking for forwards in static symtable
|
||||||
|
|
||||||
|
Revision 1.187 2004/04/11 12:37:30 peter
|
||||||
* fix tree printing
|
* fix tree printing
|
||||||
|
|
||||||
Revision 1.186 2004/02/19 17:07:42 florian
|
Revision 1.186 2004/02/19 17:07:42 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user