diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-07-09 15:29:10 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-07-09 15:29:10 +0200 |
commit | 065dd77587faa7359d6a56dcae25e2c22843f2a3 (patch) | |
tree | 12f5c511631498a44c7378c51fd95a4cc5479307 /gcc/ada | |
parent | ba224bf3d81f8c0d2d9c72e6614cd7b2266722b8 (diff) | |
download | gcc-065dd77587faa7359d6a56dcae25e2c22843f2a3.zip gcc-065dd77587faa7359d6a56dcae25e2c22843f2a3.tar.gz gcc-065dd77587faa7359d6a56dcae25e2c22843f2a3.tar.bz2 |
[multiple changes]
2012-07-09 Pascal Obry <obry@adacore.com>
* prj.adb (For_Every_Project_Imported_Context): Make sure we
callback with the project having sources.
Minor reformatting.
2012-07-09 Eric Botcazou <ebotcazou@adacore.com>
* make.adb: Fix typo.
From-SVN: r189385
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/ada/make.adb | 2 | ||||
-rw-r--r-- | gcc/ada/prj.adb | 60 |
3 files changed, 63 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 59432bf..38b6235 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2012-07-09 Pascal Obry <obry@adacore.com> + + * prj.adb (For_Every_Project_Imported_Context): Make sure we + callback with the project having sources. + Minor reformatting. + +2012-07-09 Eric Botcazou <ebotcazou@adacore.com> + + * make.adb: Fix typo. + 2012-07-09 Vincent Pucci <pucci@adacore.com> * sem_ch9.adb (Check_Node): Allow attributes diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 5c35a4e..91d64b5 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -4811,7 +4811,7 @@ package body Make is -- have been regenerated. if Main_Project /= No_Project - and then not Codepeer_Mode + and then not CodePeer_Mode and then MLib.Tgt.Support_For_Libraries /= Prj.None and then (Do_Bind_Step or Unique_Compile_All_Projects diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 9a5e260..d70315b 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -584,8 +584,55 @@ package body Prj is In_Aggregate_Lib : Boolean; From_Encapsulated_Lib : Boolean) is + + function Has_Sources (P : Project_Id) return Boolean; + -- Returns True if P has sources + + function Get_From_Tree (P : Project_Id) return Project_Id; + -- Get project P from Tree. If P has no sources get another + -- instance of this project with sources. If P has sources, + -- returns it. + + ----------------- + -- Has_Sources -- + ----------------- + + function Has_Sources (P : Project_Id) return Boolean is + Lang : Language_Ptr; + begin + Lang := P.Languages; + while Lang /= No_Language_Index loop + if Lang.First_Source /= No_Source then + return True; + end if; + Lang := Lang.Next; + end loop; + + return False; + end Has_Sources; + + ------------------- + -- Get_From_Tree -- + ------------------- + + function Get_From_Tree (P : Project_Id) return Project_Id is + List : Project_List := Tree.Projects; + begin + if not Has_Sources (P) then + while List /= null loop + if List.Project.Name = P.Name + and then Has_Sources (List.Project) + then + return List.Project; + end if; + List := List.Next; + end loop; + end if; + + return P; + end Get_From_Tree; + List : Project_List; - T : Project_Tree_Ref; begin if not Seen_Name.Contains (Project.Name) then @@ -597,7 +644,7 @@ package body Prj is if not Imported_First then Action - (Project, + (Get_From_Tree (Project), Tree, Project_Context'(In_Aggregate_Lib, From_Encapsulated_Lib), With_State); @@ -640,23 +687,20 @@ package body Prj is -- of the aggregate library. if Project.Qualifier = Aggregate_Library then - T := Tree; Recursive_Check - (Agg.Project, T, + (Agg.Project, Tree, True, From_Encapsulated_Lib or else Project.Standalone_Library = Encapsulated); else - T := Agg.Tree; - -- Use a new context as we want to returns the same -- project in different project tree for aggregated -- projects. Recursive_Check_Context - (Agg.Project, T, False, False); + (Agg.Project, Agg.Tree, False, False); end if; Agg := Agg.Next; @@ -666,7 +710,7 @@ package body Prj is if Imported_First then Action - (Project, + (Get_From_Tree (Project), Tree, Project_Context'(In_Aggregate_Lib, From_Encapsulated_Lib), With_State); |