diff options
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/checks.ads | 6 | ||||
-rw-r--r-- | gcc/ada/einfo.ads | 2 | ||||
-rw-r--r-- | gcc/ada/prj-proc.adb | 22 | ||||
-rw-r--r-- | gcc/ada/prj-strt.adb | 13 | ||||
-rw-r--r-- | gcc/ada/sinfo.ads | 2 |
6 files changed, 46 insertions, 15 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 48222031a1f..2da7f522ea6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2014-07-30 Gary Dismukes <dismukes@adacore.com> + + * sinfo.ads, einfo.ads, checks.ads: Minor typo fix and reformatting. + +2014-07-30 Vincent Celier <celier@adacore.com> + + * prj-proc.adb (Imported_Or_Extended_Project_From): New Boolean + parameter No_Extending, defaulted to False. When No_Extending + is True, do not look for an extending project. + (Expression): For a variable reference that is not for the current + project, get its Id calling Imported_Or_Extended_Project_From + with No_Extending set to True. + * prj-strt.adb (Parse_Variable_Reference): If a referenced + variable is not found in the current project, check if it is + defined in one of the projects it extends. + 2014-07-30 Robert Dewar <dewar@adacore.com> * sem_util.adb (Predicate_Tests_On_Arguments): Omit tests for diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads index 07fdc5dc3c8..3f4f3872a14 100644 --- a/gcc/ada/checks.ads +++ b/gcc/ada/checks.ads @@ -666,12 +666,12 @@ package Checks is -- we generate the actual range check, then we make sure the flag is off, -- since the code we generate takes complete care of the check. -- - -- Historical note: We used to just pass ono the Do_Range_Check flag to the - -- back end to generate the check, but now in code generation mode we never + -- Historical note: We used to just pass on the Do_Range_Check flag to the + -- back end to generate the check, but now in code-generation mode we never -- have this flag set, since the front end takes care of the check. The -- normal processing flow now is that the analyzer typically turns on the -- Do_Range_Check flag, and if it is set, this routine is called, which - -- turns the flag off in code generation mode. + -- turns the flag off in code-generation mode. procedure Generate_Index_Checks (N : Node_Id); -- This procedure is called to generate index checks on the subscripts for diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index fb64097da80..c20e96454d1 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1910,7 +1910,7 @@ package Einfo is -- Has_Static_Predicate (Flag269) -- Defined in all types and subtypes. Set if the type (which must be a -- scalar type) has a predicate whose expression is predicate-static. --- This can result from use of any of a Predicate, Static_Predicate, or +-- This can result from the use of any Predicate, Static_Predicate, or -- Dynamic_Predicate aspect. We can distinguish these cases by testing -- Has_Static_Predicate_Aspect and Has_Dynamic_Predicate_Aspect. See -- description of the latter flag for further information on dynamic diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index 653dbe1c72d..17e1ec41638 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -118,8 +118,9 @@ package body Prj.Proc is -- of an expression and return it as a Variable_Value. function Imported_Or_Extended_Project_From - (Project : Project_Id; - With_Name : Name_Id) return Project_Id; + (Project : Project_Id; + With_Name : Name_Id; + No_Extending : Boolean := False) return Project_Id; -- Find an imported or extended project of Project whose name is With_Name function Package_From @@ -705,8 +706,9 @@ package body Prj.Proc is The_Name := Name_Of (Term_Project, From_Project_Node_Tree); The_Project := Imported_Or_Extended_Project_From - (Project => Project, - With_Name => The_Name); + (Project => Project, + With_Name => The_Name, + No_Extending => True); end if; if Present (Term_Package) then @@ -1261,8 +1263,9 @@ package body Prj.Proc is --------------------------------------- function Imported_Or_Extended_Project_From - (Project : Project_Id; - With_Name : Name_Id) return Project_Id + (Project : Project_Id; + With_Name : Name_Id; + No_Extending : Boolean := False) return Project_Id is List : Project_List; Result : Project_Id; @@ -1304,7 +1307,12 @@ package body Prj.Proc is Proj := Result.Extends; while Proj /= No_Project loop if Proj.Name = With_Name then - Temp_Result := Result; + if No_Extending then + Temp_Result := Proj; + else + Temp_Result := Result; + end if; + exit; end if; diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb index 271a913e762..1ae9647efee 100644 --- a/gcc/ada/prj-strt.adb +++ b/gcc/ada/prj-strt.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1162,7 +1162,7 @@ package body Prj.Strt is -- If we have not found the variable in the package, check if the -- variable has been declared in the project, or in any of its - -- ancestors. + -- ancestors, or in any of the project it extends. if No (Current_Variable) then declare @@ -1182,7 +1182,14 @@ package body Prj.Strt is exit when Present (Current_Variable); - Proj := Parent_Project_Of (Proj, In_Tree); + if No (Parent_Project_Of (Proj, In_Tree)) then + Proj := + Extended_Project_Of + (Project_Declaration_Of (Proj, In_Tree), In_Tree); + + else + Proj := Parent_Project_Of (Proj, In_Tree); + end if; Set_Project_Node_Of (Variable, In_Tree, To => Proj); diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 427919e7d3a..f51f9c5bd76 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -1625,7 +1625,7 @@ package Sinfo is -- when Raises_Constraint_Error is also set. In practice almost all cases -- where a static expression is required do not allow an expression which -- raises Constraint_Error, so almost always, callers should call the - -- Is_Ok_Static_Exprression routine instead of testing this flag. See + -- Is_Ok_Static_Expression routine instead of testing this flag. See -- spec of package Sem_Eval for full details on the use of this flag. -- Is_Subprogram_Descriptor (Flag16-Sem) |