]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 30 Jul 2014 10:02:20 +0000 (12:02 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 30 Jul 2014 10:02:20 +0000 (12:02 +0200)
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.

From-SVN: r213237

gcc/ada/ChangeLog
gcc/ada/checks.ads
gcc/ada/einfo.ads
gcc/ada/prj-proc.adb
gcc/ada/prj-strt.adb
gcc/ada/sinfo.ads

index 48222031a1fb38180bd117d9976f8fcf3e7cd25f..2da7f522ea66d14745f77238de6c23bcca973c39 100644 (file)
@@ -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
index 07fdc5dc3c854c636a0159fb25eae5572b5c625f..3f4f3872a1446c7b92a166588ae530dddf72a579 100644 (file)
@@ -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
index fb64097da80296d5faa6e88bf3bc00c1d79be1bb..c20e96454d1f324316888f88a0d61c6b11ff1ec0 100644 (file)
@@ -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
index 653dbe1c72d941108730af7b72bbeeecd6ee3edf..17e1ec41638beafb9a0f534579cae39beae39d9b 100644 (file)
@@ -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;
 
index 271a913e762063f3df79df9164d7d5e494ada658..1ae9647efeeb312c367a8ce72a1e7ad66efd106d 100644 (file)
@@ -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);
 
index 427919e7d3a99ed5c0bde134b3f4b85c51e480b6..f51f9c5bd76aed402c020d3c2957f2ecfc8ddfb8 100644 (file)
@@ -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)