mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* remove unused and not loaded units before linking
This commit is contained in:
parent
9d8ee60223
commit
9d7048d917
@ -877,6 +877,9 @@ uses
|
||||
else
|
||||
Message1(unit_f_ppu_invalid_entry,tostr(b));
|
||||
end;
|
||||
{ we can already stop when we know that we must recompile }
|
||||
if do_compile then
|
||||
exit;
|
||||
until false;
|
||||
end;
|
||||
|
||||
@ -1521,7 +1524,10 @@ uses
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.57 2004-07-06 19:52:04 peter
|
||||
Revision 1.58 2004-07-06 20:23:25 peter
|
||||
* remove unused and not loaded units before linking
|
||||
|
||||
Revision 1.57 2004/07/06 19:52:04 peter
|
||||
* fix storing of localst in ppu
|
||||
|
||||
Revision 1.56 2004/07/05 21:26:28 olle
|
||||
|
@ -1238,10 +1238,10 @@ implementation
|
||||
|
||||
procedure proc_program(islibrary : boolean);
|
||||
var
|
||||
main_file: tinputfile;
|
||||
st : tsymtable;
|
||||
hp : tmodule;
|
||||
pd : tprocdef;
|
||||
main_file : tinputfile;
|
||||
st : tsymtable;
|
||||
hp,hp2 : tmodule;
|
||||
pd : tprocdef;
|
||||
begin
|
||||
DLLsource:=islibrary;
|
||||
Status.IsLibrary:=IsLibrary;
|
||||
@ -1481,6 +1481,17 @@ implementation
|
||||
{ create the executable when we are at level 1 }
|
||||
if (compile_level=1) then
|
||||
begin
|
||||
{ remove all unused units, this happends when units are removed
|
||||
from the uses clause in the source and the ppu was already being loaded }
|
||||
hp:=tmodule(loaded_units.first);
|
||||
while assigned(hp) do
|
||||
begin
|
||||
hp2:=hp;
|
||||
hp:=tmodule(hp.next);
|
||||
if hp2.is_unit and
|
||||
not assigned(hp2.globalsymtable) then
|
||||
loaded_units.remove(hp2);
|
||||
end;
|
||||
{ insert all .o files from all loaded units }
|
||||
hp:=tmodule(loaded_units.first);
|
||||
while assigned(hp) do
|
||||
@ -1505,7 +1516,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.159 2004-06-29 21:00:08 peter
|
||||
Revision 1.160 2004-07-06 20:23:25 peter
|
||||
* remove unused and not loaded units before linking
|
||||
|
||||
Revision 1.159 2004/06/29 21:00:08 peter
|
||||
* only enable dwarf for supported platforms
|
||||
|
||||
Revision 1.158 2004/06/20 08:55:30 florian
|
||||
|
Loading…
Reference in New Issue
Block a user