[multiple changes]
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
This commit is contained in:
parent
79185f5fb0
commit
12e4e81ea5
6 changed files with 46 additions and 15 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue