mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 00:09:23 +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
|
else
|
||||||
Message1(unit_f_ppu_invalid_entry,tostr(b));
|
Message1(unit_f_ppu_invalid_entry,tostr(b));
|
||||||
end;
|
end;
|
||||||
|
{ we can already stop when we know that we must recompile }
|
||||||
|
if do_compile then
|
||||||
|
exit;
|
||||||
until false;
|
until false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1521,7 +1524,10 @@ uses
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* fix storing of localst in ppu
|
||||||
|
|
||||||
Revision 1.56 2004/07/05 21:26:28 olle
|
Revision 1.56 2004/07/05 21:26:28 olle
|
||||||
|
@ -1238,10 +1238,10 @@ implementation
|
|||||||
|
|
||||||
procedure proc_program(islibrary : boolean);
|
procedure proc_program(islibrary : boolean);
|
||||||
var
|
var
|
||||||
main_file: tinputfile;
|
main_file : tinputfile;
|
||||||
st : tsymtable;
|
st : tsymtable;
|
||||||
hp : tmodule;
|
hp,hp2 : tmodule;
|
||||||
pd : tprocdef;
|
pd : tprocdef;
|
||||||
begin
|
begin
|
||||||
DLLsource:=islibrary;
|
DLLsource:=islibrary;
|
||||||
Status.IsLibrary:=IsLibrary;
|
Status.IsLibrary:=IsLibrary;
|
||||||
@ -1481,6 +1481,17 @@ implementation
|
|||||||
{ create the executable when we are at level 1 }
|
{ create the executable when we are at level 1 }
|
||||||
if (compile_level=1) then
|
if (compile_level=1) then
|
||||||
begin
|
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 }
|
{ insert all .o files from all loaded units }
|
||||||
hp:=tmodule(loaded_units.first);
|
hp:=tmodule(loaded_units.first);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
@ -1505,7 +1516,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* only enable dwarf for supported platforms
|
||||||
|
|
||||||
Revision 1.158 2004/06/20 08:55:30 florian
|
Revision 1.158 2004/06/20 08:55:30 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user