mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-22 07:58:42 +02:00
* Do not implicitly load Variants unit when compiling units. Doing so is mostly waste of time, and introduces unwanted build dependencies. It is enough to set uf_uses_variants flag for units, and examine these flags when compiling program/library. Resolves #24880.
git-svn-id: trunk@25269 -
This commit is contained in:
parent
4db6a866a1
commit
e1ddd914ac
@ -195,20 +195,24 @@ implementation
|
|||||||
procedure maybeloadvariantsunit;
|
procedure maybeloadvariantsunit;
|
||||||
var
|
var
|
||||||
hp : tmodule;
|
hp : tmodule;
|
||||||
|
load : boolean;
|
||||||
begin
|
begin
|
||||||
{ Do we need the variants unit? Skip this
|
{ Must not be called for units }
|
||||||
for VarUtils unit for bootstrapping }
|
if current_module.is_unit then
|
||||||
if (current_module.flags and uf_uses_variants=0) or
|
InternalError(2013081601);
|
||||||
(current_module.modulename^='VARUTILS') then
|
|
||||||
exit;
|
|
||||||
{ Variants unit already loaded? }
|
{ Variants unit already loaded? }
|
||||||
|
load:=(current_module.flags and uf_uses_variants)<>0;
|
||||||
hp:=tmodule(loaded_units.first);
|
hp:=tmodule(loaded_units.first);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
begin
|
begin
|
||||||
if hp.modulename^='VARIANTS' then
|
if hp.modulename^='VARIANTS' then
|
||||||
exit;
|
exit;
|
||||||
|
if (hp.flags and uf_uses_variants)<>0 then
|
||||||
|
load:=true;
|
||||||
hp:=tmodule(hp.next);
|
hp:=tmodule(hp.next);
|
||||||
end;
|
end;
|
||||||
|
if (not load) then
|
||||||
|
exit;
|
||||||
{ Variants unit is not loaded yet, load it now }
|
{ Variants unit is not loaded yet, load it now }
|
||||||
Message(parser_w_implicit_uses_of_variants_unit);
|
Message(parser_w_implicit_uses_of_variants_unit);
|
||||||
AddUnit('variants');
|
AddUnit('variants');
|
||||||
@ -1158,9 +1162,6 @@ type
|
|||||||
{ if an Objective-C module, generate rtti and module info }
|
{ if an Objective-C module, generate rtti and module info }
|
||||||
MaybeGenerateObjectiveCImageInfo(current_module.globalsymtable,current_module.localsymtable);
|
MaybeGenerateObjectiveCImageInfo(current_module.globalsymtable,current_module.localsymtable);
|
||||||
|
|
||||||
{ do we need to add the variants unit? }
|
|
||||||
maybeloadvariantsunit;
|
|
||||||
|
|
||||||
{ generate rtti/init tables }
|
{ generate rtti/init tables }
|
||||||
write_persistent_type_info(current_module.globalsymtable,true);
|
write_persistent_type_info(current_module.globalsymtable,true);
|
||||||
write_persistent_type_info(current_module.localsymtable,false);
|
write_persistent_type_info(current_module.localsymtable,false);
|
||||||
|
Loading…
Reference in New Issue
Block a user