mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-05 16:12:34 +02:00
codetools: added consistency check for TFindDeclarationTool.AddToolDependency
git-svn-id: trunk@24271 -
This commit is contained in:
parent
e88dd4706f
commit
eff858c038
@ -66,6 +66,7 @@ interface
|
|||||||
{ $DEFINE ShowCacheDependencies}
|
{ $DEFINE ShowCacheDependencies}
|
||||||
{ $DEFINE ShowCollect}
|
{ $DEFINE ShowCollect}
|
||||||
{ $DEFINE ShowProcSearch}
|
{ $DEFINE ShowProcSearch}
|
||||||
|
{$DEFINE DebugAddToolDependency}
|
||||||
|
|
||||||
{$IFDEF CTDEBUG}{$DEFINE DebugPrefix}{$ENDIF}
|
{$IFDEF CTDEBUG}{$DEFINE DebugPrefix}{$ENDIF}
|
||||||
{$IFDEF ShowTriedIdentifiers}{$DEFINE DebugPrefix}{$ENDIF}
|
{$IFDEF ShowTriedIdentifiers}{$DEFINE DebugPrefix}{$ENDIF}
|
||||||
@ -8599,6 +8600,11 @@ end;
|
|||||||
procedure TFindDeclarationTool.AddToolDependency(
|
procedure TFindDeclarationTool.AddToolDependency(
|
||||||
DependOnTool: TFindDeclarationTool);
|
DependOnTool: TFindDeclarationTool);
|
||||||
// build a relationship: this tool depends on DependOnTool
|
// build a relationship: this tool depends on DependOnTool
|
||||||
|
{$IFDEF DebugAddToolDependency}
|
||||||
|
var
|
||||||
|
AVLNode: TAVLTreeNode;
|
||||||
|
Tool: TFindDeclarationTool;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFDEF ShowCacheDependencies}
|
{$IFDEF ShowCacheDependencies}
|
||||||
DebugLn('[TFindDeclarationTool.AddToolDependency] "',MainFilename,'" depends on "',DependOnTool.MainFilename,'"');
|
DebugLn('[TFindDeclarationTool.AddToolDependency] "',MainFilename,'" depends on "',DependOnTool.MainFilename,'"');
|
||||||
@ -8607,10 +8613,24 @@ begin
|
|||||||
DependOnTool.FDependentCodeTools:=TAVLTree.Create;
|
DependOnTool.FDependentCodeTools:=TAVLTree.Create;
|
||||||
if DependOnTool.FDependentCodeTools.Find(Self)=nil then
|
if DependOnTool.FDependentCodeTools.Find(Self)=nil then
|
||||||
DependOnTool.FDependentCodeTools.Add(Self);
|
DependOnTool.FDependentCodeTools.Add(Self);
|
||||||
|
|
||||||
if FDependsOnCodeTools=nil then
|
if FDependsOnCodeTools=nil then
|
||||||
FDependsOnCodeTools:=TAVLTree.Create;
|
FDependsOnCodeTools:=TAVLTree.Create;
|
||||||
if FDependsOnCodeTools.Find(DependOnTool)=nil then
|
|
||||||
|
if FDependsOnCodeTools.Find(DependOnTool)=nil then begin
|
||||||
|
{$IFDEF DebugAddToolDependency}
|
||||||
|
AVLNode:=FDependsOnCodeTools.FindLowest;
|
||||||
|
while AVLNode<>nil do begin
|
||||||
|
Tool:=TFindDeclarationTool(AVLNode.Data);
|
||||||
|
if CompareFilenames(ExtractFilename(Tool.MainFilename),ExtractFilename(DependOnTool.MainFilename))=0 then begin
|
||||||
|
DebugLn(['TFindDeclarationTool.AddToolDependency inconsistency: ',Tool.MainFilename,' ',DependOnTool.MainFilename]);
|
||||||
|
end;
|
||||||
|
AVLNode:=FDependsOnCodeTools.FindSuccessor(AVLNode);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
FDependsOnCodeTools.Add(DependOnTool);
|
FDependsOnCodeTools.Add(DependOnTool);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFindDeclarationTool.ConsistencyCheck;
|
procedure TFindDeclarationTool.ConsistencyCheck;
|
||||||
|
Loading…
Reference in New Issue
Block a user