summaryrefslogtreecommitdiff
path: root/gcc/ada/clean.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-24 09:27:21 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-24 09:27:21 +0000
commit08d56cd132b9c87ba6eb48ea972d4c9559618fd0 (patch)
tree7ef9d1e9dfb650841e5c6382e473c3bd67fdfa35 /gcc/ada/clean.adb
parentdc95506e2f3a067d2a96eab512c1e5d0414ca989 (diff)
downloadgcc-08d56cd132b9c87ba6eb48ea972d4c9559618fd0.tar.gz
2009-06-24 Emmanuel Briot <briot@adacore.com>
* gnatcmd.adb, make.adb, mlib-prj.adb, prj.adb, prj.ads, clean.adb, prj-nmsc.adb, prj-env.adb, prj-proc.adb (Units_Table): Removed, since no longer useful. (Source_Data.Lang_Kind): Removed, since it duplicates information already available through Language.Config. (Source_Data.Compile): Removed, since information is already available through the language. (Is_Compilable): New subprogram. (Source_Data.Dependency): Removed, since already available through the language. (Source_Data.Object_Exist, Object_Linked): Removed since available through the language already. (Unit_Data.File_Names): Is now also set in multi_language mode, to bring the two modes closer in the resulting data structures. (Source_Data.Unit): Now a direct pointer to the unit data, rather than just the name that would point into a hash table. (Get_Language_From_Name): New subprogram. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148901 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/clean.adb')
-rw-r--r--gcc/ada/clean.adb58
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;