diff options
Diffstat (limited to 'gcc/ada/clean.adb')
-rw-r--r-- | gcc/ada/clean.adb | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb index 933a97bbee3..fa03e5cfac9 100644 --- a/gcc/ada/clean.adb +++ b/gcc/ada/clean.adb @@ -540,7 +540,7 @@ package body Clean is Last : Natural; Delete_File : Boolean; - Unit : Unit_Data; + Unit : Unit_Index; begin if Project.Library @@ -570,13 +570,11 @@ package body Clean is Canonical_Case_File_Name (Name (1 .. Last)); Delete_File := False; - -- Compare with source file names of the project + Unit := Units_Htable.Get_First (Project_Tree.Units_HT); - for Index in - 1 .. Unit_Table.Last (Project_Tree.Units) - loop - Unit := Project_Tree.Units.Table (Index); + -- Compare with source file names of the project + while Unit /= No_Unit_Index loop if Unit.File_Names (Impl) /= null and then Ultimate_Extending_Project_Of (Unit.File_Names (Impl).Project) = Project @@ -599,6 +597,8 @@ package body Clean is Delete_File := True; exit; end if; + + Unit := Units_Htable.Get_Next (Project_Tree.Units_HT); end loop; if Delete_File then @@ -733,15 +733,13 @@ package body Clean is if Last > 4 and then Name (Last - 3 .. Last) = ".ali" then declare - Unit : Unit_Data; + Unit : Unit_Index; begin -- Compare with ALI file names of the project - for - Index in 1 .. Unit_Table.Last (Project_Tree.Units) - loop - Unit := Project_Tree.Units.Table (Index); - + Unit := Units_Htable.Get_First + (Project_Tree.Units_HT); + while Unit /= No_Unit_Index loop if Unit.File_Names (Impl) /= null and then Unit.File_Names (Impl).Project /= No_Project @@ -781,6 +779,9 @@ package body Clean is exit; end if; end if; + + Unit := Units_Htable.Get_Next + (Project_Tree.Units_HT); end loop; end; end if; @@ -817,7 +818,7 @@ package body Clean is -- Name of the executable file Current_Dir : constant Dir_Name_Str := Get_Current_Dir; - U_Data : Unit_Data; + Unit : Unit_Index; File_Name1 : File_Name_Type; Index1 : Int; File_Name2 : File_Name_Type; @@ -879,10 +880,8 @@ package body Clean is if Has_Ada_Sources (Project) or else Project.Extends /= No_Project then - for Unit in Unit_Table.First .. - Unit_Table.Last (Project_Tree.Units) - loop - U_Data := Project_Tree.Units.Table (Unit); + Unit := Units_Htable.Get_First (Project_Tree.Units_HT); + while Unit /= No_Unit_Index loop File_Name1 := No_File; File_Name2 := No_File; @@ -890,29 +889,26 @@ package body Clean is -- project, check for the corresponding ALI file in the -- object directory. - if (U_Data.File_Names (Impl) /= null + if (Unit.File_Names (Impl) /= null and then In_Extension_Chain - (U_Data.File_Names (Impl).Project, Project)) + (Unit.File_Names (Impl).Project, Project)) or else - (U_Data.File_Names (Spec) /= null + (Unit.File_Names (Spec) /= null and then In_Extension_Chain - (U_Data.File_Names - (Spec).Project, Project)) + (Unit.File_Names (Spec).Project, Project)) then - if U_Data.File_Names (Impl) /= null then - File_Name1 := U_Data.File_Names (Impl).File; - Index1 := U_Data.File_Names (Impl).Index; + if Unit.File_Names (Impl) /= null then + File_Name1 := Unit.File_Names (Impl).File; + Index1 := Unit.File_Names (Impl).Index; else File_Name1 := No_File; Index1 := 0; end if; - if U_Data.File_Names (Spec) /= null then - File_Name2 := - U_Data.File_Names (Spec).File; - Index2 := - U_Data.File_Names (Spec).Index; + if Unit.File_Names (Spec) /= null then + File_Name2 := Unit.File_Names (Spec).File; + Index2 := Unit.File_Names (Spec).Index; else File_Name2 := No_File; Index2 := 0; @@ -1031,6 +1027,8 @@ package body Clean is end if; end; end if; + + Unit := Units_Htable.Get_Next (Project_Tree.Units_HT); end loop; end if; |