mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 11:09:14 +02:00
fcl-passrc: added TPasResolver.ImplementationUsesUnit
git-svn-id: trunk@46846 -
This commit is contained in:
parent
f281e52ea3
commit
aed1866db9
@ -2395,6 +2395,8 @@ type
|
||||
function GetLastSection: TPasSection;
|
||||
function GetParentSection(El: TPasElement): TPasSection;
|
||||
function FindUsedUnitInSection(aMod: TPasModule; Section: TPasSection): TPasUsesUnit;
|
||||
function FirstSectionUsesUnit(aModule: TPasModule): boolean;
|
||||
function ImplementationUsesUnit(aModule: TPasModule; NotInIntf: boolean = true): boolean;
|
||||
function GetShiftAndMaskForLoHiFunc(BaseType: TResolverBaseType;
|
||||
isLoFunc: Boolean; out Mask: LongWord): Integer;
|
||||
public
|
||||
@ -29590,6 +29592,31 @@ begin
|
||||
if Clause[i].Module=aMod then exit(Clause[i]);
|
||||
end;
|
||||
|
||||
function TPasResolver.FirstSectionUsesUnit(aModule: TPasModule): boolean;
|
||||
var
|
||||
aSection: TPasSection;
|
||||
begin
|
||||
Result:=false;
|
||||
aSection:=GetFirstSection(false);
|
||||
if aSection=nil then
|
||||
exit;
|
||||
Result:=FindUsedUnitInSection(aModule,aSection)<>nil;
|
||||
end;
|
||||
|
||||
function TPasResolver.ImplementationUsesUnit(aModule: TPasModule;
|
||||
NotInIntf: boolean): boolean;
|
||||
var
|
||||
MyModule: TPasModule;
|
||||
begin
|
||||
Result:=false;
|
||||
MyModule:=RootElement;
|
||||
if MyModule=nil then exit;
|
||||
if FindUsedUnitInSection(aModule,MyModule.ImplementationSection)=nil then
|
||||
exit;
|
||||
if NotInIntf then
|
||||
Result:=not FirstSectionUsesUnit(aModule);
|
||||
end;
|
||||
|
||||
function TPasResolver.GetShiftAndMaskForLoHiFunc(BaseType: TResolverBaseType;
|
||||
isLoFunc: Boolean; out Mask: LongWord): Integer;
|
||||
const
|
||||
|
Loading…
Reference in New Issue
Block a user