From ee81cbe97718536484b0b623ff875d4a3fabbce0 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 14 Jun 2010 14:46:56 +0200 Subject: [multiple changes] 2010-06-14 Pascal Obry * s-finimp.adb: Fix typo. * raise.h: Remove duplicate blank line. 2010-06-14 Vincent Celier * prj-nmsc.adb (Add_Sources): Always set the object file and the switches file names, as the configuration of the language may change in an extending project. (Process_Naming_Scheme): For sources of projects that are extended, set the configuration of the language from the highest extending project where the language is declared. 2010-06-14 Gary Dismukes * sem_res.adb (Resolve_Call): For infinite recursion check, test whether the called subprogram is inherited from a containing subprogram. (Same_Or_Aliased_Subprograms): New function From-SVN: r160733 --- gcc/ada/prj-nmsc.adb | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'gcc/ada/prj-nmsc.adb') diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index ca6a732..7dc8ad3 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -736,6 +736,9 @@ package body Prj.Nmsc is Id.Dep_Name := Dependency_Name (File_Name, Lang_Id.Config.Dependency_Kind); Id.Naming_Exception := Naming_Exception; + Id.Object := Object_Name + (File_Name, Config.Object_File_Suffix); + Id.Switches := Switches_Name (File_Name); -- Add the source id to the Unit_Sources_HT hash table, if the unit name -- is not null. @@ -767,11 +770,6 @@ package body Prj.Nmsc is Override_Kind (Id, Kind); end if; - if Is_Compilable (Id) and then Config.Object_Generated then - Id.Object := Object_Name (File_Name, Config.Object_File_Suffix); - Id.Switches := Switches_Name (File_Name); - end if; - if Path /= No_Path_Information then Id.Path := Path; Source_Paths_Htable.Set (Data.Tree.Source_Paths_HT, Path.Name, Id); @@ -7488,6 +7486,45 @@ package body Prj.Nmsc is Initialize (Data, Tree => Tree, Flags => Flags); Check_All_Projects (Root_Project, Data, Imported_First => True); Free (Data); + + -- Adjust language configs for projects that are extended + + declare + List : Project_List; + Proj : Project_Id; + Exte : Project_Id; + Lang : Language_Ptr; + Elng : Language_Ptr; + + begin + List := Tree.Projects; + while List /= null loop + Proj := List.Project; + Exte := Proj; + while Exte.Extended_By /= No_Project loop + Exte := Exte.Extended_By; + end loop; + + if Exte /= Proj then + Lang := Proj.Languages; + + if Lang /= No_Language_Index then + loop + Elng := Get_Language_From_Name + (Exte, Get_Name_String (Lang.Name)); + exit when Elng /= No_Language_Index; + Exte := Exte.Extends; + end loop; + + if Elng /= Lang then + Lang.Config := Elng.Config; + end if; + end if; + end if; + + List := List.Next; + end loop; + end; end Process_Naming_Scheme; end Prj.Nmsc; -- cgit v1.1