summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-06-17 15:00:26 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-17 15:00:26 +0200
commit6f76a2575b040ada4b58e1aea71ce609bffa5c06 (patch)
tree6a2625010c5e52e487613f192efd5e4aa354c359 /gcc/ada
parentcfab0c49a4c675d04dafd77b48069a482cf6701d (diff)
downloadgcc-6f76a2575b040ada4b58e1aea71ce609bffa5c06.tar.gz
[multiple changes]
2010-06-17 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Expand_Call): Do not expand a call to an internal protected operation if the subprogram has been eliminated. 2010-06-17 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Check_Library_Attributes): Allow the different directories associated with a library to be any directory when the library project is externally built. 2010-06-17 Vincent Celier <celier@adacore.com> * make.adb (Check): If switch -m is used, deallocate the memory that may be allocated when computing the checksum. From-SVN: r160907
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog16
-rw-r--r--gcc/ada/exp_ch6.adb2
-rw-r--r--gcc/ada/make.adb7
-rw-r--r--gcc/ada/prj-nmsc.adb163
4 files changed, 109 insertions, 79 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0cb6c9c9765..c3c02be18c3 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,19 @@
+2010-06-17 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_Call): Do not expand a call to an internal
+ protected operation if the subprogram has been eliminated.
+
+2010-06-17 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Check_Library_Attributes): Allow the different
+ directories associated with a library to be any directory when the
+ library project is externally built.
+
+2010-06-17 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Check): If switch -m is used, deallocate the memory that
+ may be allocated when computing the checksum.
+
2010-06-17 Eric Botcazou <ebotcazou@adacore.com>
* g-socthi-mingw.adb (C_Recvmsg): Add 'use type' clause for C.size_t;
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 49a0a0f5d4c..39e62d5d19a 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -3095,12 +3095,14 @@ package body Exp_Ch6 is
-- In Ada 2005, this may be an indirect call to an access parameter that
-- is an access_to_subprogram. In that case the anonymous type has a
-- scope that is a protected operation, but the call is a regular one.
+ -- In either case do not expand call if subprogram is eliminated.
Scop := Scope (Subp);
if Nkind (N) /= N_Entry_Call_Statement
and then Is_Protected_Type (Scop)
and then Ekind (Subp) /= E_Subprogram_Type
+ and then not Is_Eliminated (Subp)
then
-- If the call is an internal one, it is rewritten as a call to the
-- corresponding unprotected subprogram.
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 82d4e9f2edd..f9df7fc2c50 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -1785,6 +1785,13 @@ package body Make is
Modified_Source := Time_Stamp_Mismatch (ALI, Read_Only);
+ -- To avoid using too much memory when switch -m is used, free the
+ -- memory allocated for the source file when computing the checksum.
+
+ if Minimal_Recompilation then
+ Sinput.P.Clear_Source_File_Table;
+ end if;
+
if Modified_Source /= No_File then
ALI := No_ALI_Id;
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 7dc8ad3250f..ea3ae29e707 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -3631,99 +3631,103 @@ package body Prj.Nmsc is
"library directory { does not exist",
Lib_Dir.Location, Project);
+ elsif not Project.Externally_Built then
+
-- The library directory cannot be the same as the Object
-- directory.
- elsif Project.Library_Dir.Name = Project.Object_Directory.Name then
- Error_Msg
- (Data.Flags,
- "library directory cannot be the same " &
- "as object directory",
- Lib_Dir.Location, Project);
- Project.Library_Dir := No_Path_Information;
-
- else
- declare
- OK : Boolean := True;
- Dirs_Id : String_List_Id;
- Dir_Elem : String_Element;
- Pid : Project_List;
-
- begin
- -- The library directory cannot be the same as a source
- -- directory of the current project.
-
- Dirs_Id := Project.Source_Dirs;
- while Dirs_Id /= Nil_String loop
- Dir_Elem := Data.Tree.String_Elements.Table (Dirs_Id);
- Dirs_Id := Dir_Elem.Next;
-
- if Project.Library_Dir.Name =
- Path_Name_Type (Dir_Elem.Value)
- then
- Err_Vars.Error_Msg_File_1 :=
- File_Name_Type (Dir_Elem.Value);
- Error_Msg
- (Data.Flags,
- "library directory cannot be the same " &
- "as source directory {",
- Lib_Dir.Location, Project);
- OK := False;
- exit;
- end if;
- end loop;
+ if Project.Library_Dir.Name = Project.Object_Directory.Name then
+ Error_Msg
+ (Data.Flags,
+ "library directory cannot be the same " &
+ "as object directory",
+ Lib_Dir.Location, Project);
+ Project.Library_Dir := No_Path_Information;
- if OK then
+ else
+ declare
+ OK : Boolean := True;
+ Dirs_Id : String_List_Id;
+ Dir_Elem : String_Element;
+ Pid : Project_List;
+ begin
-- The library directory cannot be the same as a source
- -- directory of another project either.
+ -- directory of the current project.
- Pid := Data.Tree.Projects;
- Project_Loop : loop
- exit Project_Loop when Pid = null;
+ Dirs_Id := Project.Source_Dirs;
+ while Dirs_Id /= Nil_String loop
+ Dir_Elem := Data.Tree.String_Elements.Table (Dirs_Id);
+ Dirs_Id := Dir_Elem.Next;
+
+ if Project.Library_Dir.Name =
+ Path_Name_Type (Dir_Elem.Value)
+ then
+ Err_Vars.Error_Msg_File_1 :=
+ File_Name_Type (Dir_Elem.Value);
+ Error_Msg
+ (Data.Flags,
+ "library directory cannot be the same " &
+ "as source directory {",
+ Lib_Dir.Location, Project);
+ OK := False;
+ exit;
+ end if;
+ end loop;
- if Pid.Project /= Project then
- Dirs_Id := Pid.Project.Source_Dirs;
+ if OK then
- Dir_Loop : while Dirs_Id /= Nil_String loop
- Dir_Elem :=
- Data.Tree.String_Elements.Table (Dirs_Id);
- Dirs_Id := Dir_Elem.Next;
+ -- The library directory cannot be the same as a
+ -- source directory of another project either.
- if Project.Library_Dir.Name =
- Path_Name_Type (Dir_Elem.Value)
- then
- Err_Vars.Error_Msg_File_1 :=
- File_Name_Type (Dir_Elem.Value);
- Err_Vars.Error_Msg_Name_1 := Pid.Project.Name;
+ Pid := Data.Tree.Projects;
+ Project_Loop : loop
+ exit Project_Loop when Pid = null;
- Error_Msg
- (Data.Flags,
- "library directory cannot be the same " &
- "as source directory { of project %%",
- Lib_Dir.Location, Project);
- OK := False;
- exit Project_Loop;
- end if;
- end loop Dir_Loop;
- end if;
+ if Pid.Project /= Project then
+ Dirs_Id := Pid.Project.Source_Dirs;
+
+ Dir_Loop : while Dirs_Id /= Nil_String loop
+ Dir_Elem :=
+ Data.Tree.String_Elements.Table (Dirs_Id);
+ Dirs_Id := Dir_Elem.Next;
+
+ if Project.Library_Dir.Name =
+ Path_Name_Type (Dir_Elem.Value)
+ then
+ Err_Vars.Error_Msg_File_1 :=
+ File_Name_Type (Dir_Elem.Value);
+ Err_Vars.Error_Msg_Name_1 :=
+ Pid.Project.Name;
+
+ Error_Msg
+ (Data.Flags,
+ "library directory cannot be the same" &
+ " as source directory { of project %%",
+ Lib_Dir.Location, Project);
+ OK := False;
+ exit Project_Loop;
+ end if;
+ end loop Dir_Loop;
+ end if;
- Pid := Pid.Next;
- end loop Project_Loop;
- end if;
+ Pid := Pid.Next;
+ end loop Project_Loop;
+ end if;
- if not OK then
- Project.Library_Dir := No_Path_Information;
+ if not OK then
+ Project.Library_Dir := No_Path_Information;
- elsif Current_Verbosity = High then
+ elsif Current_Verbosity = High then
- -- Display the Library directory in high verbosity
+ -- Display the Library directory in high verbosity
- Write_Attr
- ("Library directory",
- Get_Name_String (Project.Library_Dir.Display_Name));
- end if;
- end;
+ Write_Attr
+ ("Library directory",
+ Get_Name_String (Project.Library_Dir.Display_Name));
+ end if;
+ end;
+ end if;
end if;
end if;
@@ -3811,8 +3815,9 @@ package body Prj.Nmsc is
Lib_ALI_Dir.Location, Project);
end if;
- if Project.Library_ALI_Dir /= Project.Library_Dir then
-
+ if (not Project.Externally_Built) and then
+ Project.Library_ALI_Dir /= Project.Library_Dir
+ then
-- The library ALI directory cannot be the same as the
-- Object directory.