Commit c98b8253 by Arnaud Charlet

[multiple changes]

2014-07-30  Robert Dewar  <dewar@adacore.com>

	* sem_ch3.adb, sem_ch3.ads: Minor code reorganization.

2014-07-30  Pascal Obry  <obry@adacore.com>

	* clean.adb (Clean_Project): Properly check for directory
	existence before trying to enter it.

From-SVN: r213284
parent 2e471ec7
2014-07-30 Robert Dewar <dewar@adacore.com> 2014-07-30 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, sem_ch3.ads: Minor code reorganization.
2014-07-30 Pascal Obry <obry@adacore.com>
* clean.adb (Clean_Project): Properly check for directory
existence before trying to enter it.
2014-07-30 Robert Dewar <dewar@adacore.com>
* sem_ch3.ads, prj.ads, prj-nmsc.adb: Minor reformatting. * sem_ch3.ads, prj.ads, prj-nmsc.adb: Minor reformatting.
2014-07-30 Robert Dewar <dewar@adacore.com> 2014-07-30 Robert Dewar <dewar@adacore.com>
......
...@@ -666,51 +666,58 @@ package body Clean is ...@@ -666,51 +666,58 @@ package body Clean is
Canonical_Case_File_Name (Archive_Name); Canonical_Case_File_Name (Archive_Name);
Canonical_Case_File_Name (DLL_Name); Canonical_Case_File_Name (DLL_Name);
Change_Dir (Lib_Directory); if Is_Directory (Lib_Directory) then
Open (Direc, "."); Change_Dir (Lib_Directory);
Open (Direc, ".");
-- For each regular file in the directory, if switch -n has not -- For each regular file in the directory, if switch -n has not
-- been specified, make it writable and delete the file if it is -- not been specified, make it writable and delete the file if
-- the library file. -- it is the library file.
loop loop
Read (Direc, Name, Last); Read (Direc, Name, Last);
exit when Last = 0; exit when Last = 0;
declare
Filename : constant String := Name (1 .. Last);
begin declare
if Is_Regular_File (Filename) Filename : constant String := Name (1 .. Last);
or else Is_Symbolic_Link (Filename)
then
Canonical_Case_File_Name (Name (1 .. Last));
Delete_File := False;
if (Project.Library_Kind = Static begin
and then Name (1 .. Last) = Archive_Name) if Is_Regular_File (Filename)
or else or else Is_Symbolic_Link (Filename)
((Project.Library_Kind = Dynamic
or else
Project.Library_Kind = Relocatable)
and then
(Name (1 .. Last) = DLL_Name
or else
Name (1 .. Last) = Minor.all
or else
Name (1 .. Last) = Major.all))
then then
if not Do_Nothing then Canonical_Case_File_Name (Name (1 .. Last));
Set_Writable (Filename); Delete_File := False;
end if;
if (Project.Library_Kind = Static
and then Name (1 .. Last) = Archive_Name)
or else
((Project.Library_Kind = Dynamic
or else
Project.Library_Kind = Relocatable)
and then
(Name (1 .. Last) = DLL_Name
or else
Name (1 .. Last) = Minor.all
or else
Name (1 .. Last) = Major.all))
then
if not Do_Nothing then
Set_Writable (Filename);
end if;
Delete (Lib_Directory, Filename); Delete (Lib_Directory, Filename);
end if;
end if; end if;
end if; end;
end; end loop;
end loop;
Close (Direc); Close (Direc);
end if;
if not Is_Directory (Lib_ALI_Directory) then
-- Nothing more to do, return now
return;
end if;
Change_Dir (Lib_ALI_Directory); Change_Dir (Lib_ALI_Directory);
Open (Direc, "."); Open (Direc, ".");
...@@ -860,7 +867,10 @@ package body Clean is ...@@ -860,7 +867,10 @@ package body Clean is
Processed_Projects.Increment_Last; Processed_Projects.Increment_Last;
Processed_Projects.Table (Processed_Projects.Last) := Project; Processed_Projects.Table (Processed_Projects.Last) := Project;
if Project.Object_Directory /= No_Path_Information then if Project.Object_Directory /= No_Path_Information
and then Is_Directory
(Get_Name_String (Project.Object_Directory.Display_Name))
then
declare declare
Obj_Dir : constant String := Obj_Dir : constant String :=
Get_Name_String (Project.Object_Directory.Display_Name); Get_Name_String (Project.Object_Directory.Display_Name);
...@@ -1188,7 +1198,10 @@ package body Clean is ...@@ -1188,7 +1198,10 @@ package body Clean is
end; end;
end if; end if;
if Project.Object_Directory /= No_Path_Information then if Project.Object_Directory /= No_Path_Information
and then Is_Directory
(Get_Name_String (Project.Object_Directory.Display_Name))
then
Delete_Binder_Generated_Files Delete_Binder_Generated_Files
(Get_Name_String (Project.Object_Directory.Display_Name), (Get_Name_String (Project.Object_Directory.Display_Name),
Strip_Suffix (Main_Source_File)); Strip_Suffix (Main_Source_File));
......
...@@ -193,7 +193,7 @@ package Sem_Ch3 is ...@@ -193,7 +193,7 @@ package Sem_Ch3 is
-- C is automatically visible. -- C is automatically visible.
procedure Make_Index procedure Make_Index
(I : Node_Id; (N : Node_Id;
Related_Nod : Node_Id; Related_Nod : Node_Id;
Related_Id : Entity_Id := Empty; Related_Id : Entity_Id := Empty;
Suffix_Index : Nat := 1; Suffix_Index : Nat := 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment