Commit 12e4e81e by Arnaud Charlet

[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
parent 79185f5f
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> 2014-07-30 Robert Dewar <dewar@adacore.com>
* sem_util.adb (Predicate_Tests_On_Arguments): Omit tests for * sem_util.adb (Predicate_Tests_On_Arguments): Omit tests for
......
...@@ -666,12 +666,12 @@ package Checks is ...@@ -666,12 +666,12 @@ package Checks is
-- we generate the actual range check, then we make sure the flag is off, -- 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. -- 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 -- 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 -- 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 -- 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 -- 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 -- 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); procedure Generate_Index_Checks (N : Node_Id);
-- This procedure is called to generate index checks on the subscripts for -- This procedure is called to generate index checks on the subscripts for
......
...@@ -1910,7 +1910,7 @@ package Einfo is ...@@ -1910,7 +1910,7 @@ package Einfo is
-- Has_Static_Predicate (Flag269) -- Has_Static_Predicate (Flag269)
-- Defined in all types and subtypes. Set if the type (which must be a -- Defined in all types and subtypes. Set if the type (which must be a
-- scalar type) has a predicate whose expression is predicate-static. -- 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 -- Dynamic_Predicate aspect. We can distinguish these cases by testing
-- Has_Static_Predicate_Aspect and Has_Dynamic_Predicate_Aspect. See -- Has_Static_Predicate_Aspect and Has_Dynamic_Predicate_Aspect. See
-- description of the latter flag for further information on dynamic -- description of the latter flag for further information on dynamic
......
...@@ -119,7 +119,8 @@ package body Prj.Proc is ...@@ -119,7 +119,8 @@ package body Prj.Proc is
function Imported_Or_Extended_Project_From function Imported_Or_Extended_Project_From
(Project : Project_Id; (Project : Project_Id;
With_Name : Name_Id) return 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 -- Find an imported or extended project of Project whose name is With_Name
function Package_From function Package_From
...@@ -706,7 +707,8 @@ package body Prj.Proc is ...@@ -706,7 +707,8 @@ package body Prj.Proc is
Name_Of (Term_Project, From_Project_Node_Tree); Name_Of (Term_Project, From_Project_Node_Tree);
The_Project := Imported_Or_Extended_Project_From The_Project := Imported_Or_Extended_Project_From
(Project => Project, (Project => Project,
With_Name => The_Name); With_Name => The_Name,
No_Extending => True);
end if; end if;
if Present (Term_Package) then if Present (Term_Package) then
...@@ -1262,7 +1264,8 @@ package body Prj.Proc is ...@@ -1262,7 +1264,8 @@ package body Prj.Proc is
function Imported_Or_Extended_Project_From function Imported_Or_Extended_Project_From
(Project : Project_Id; (Project : Project_Id;
With_Name : Name_Id) return Project_Id With_Name : Name_Id;
No_Extending : Boolean := False) return Project_Id
is is
List : Project_List; List : Project_List;
Result : Project_Id; Result : Project_Id;
...@@ -1304,7 +1307,12 @@ package body Prj.Proc is ...@@ -1304,7 +1307,12 @@ package body Prj.Proc is
Proj := Result.Extends; Proj := Result.Extends;
while Proj /= No_Project loop while Proj /= No_Project loop
if Proj.Name = With_Name then if Proj.Name = With_Name then
if No_Extending then
Temp_Result := Proj;
else
Temp_Result := Result; Temp_Result := Result;
end if;
exit; exit;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- 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 -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1162,7 +1162,7 @@ package body Prj.Strt is ...@@ -1162,7 +1162,7 @@ package body Prj.Strt is
-- If we have not found the variable in the package, check if the -- 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 -- 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 if No (Current_Variable) then
declare declare
...@@ -1182,7 +1182,14 @@ package body Prj.Strt is ...@@ -1182,7 +1182,14 @@ package body Prj.Strt is
exit when Present (Current_Variable); exit when Present (Current_Variable);
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); Proj := Parent_Project_Of (Proj, In_Tree);
end if;
Set_Project_Node_Of (Variable, In_Tree, To => Proj); Set_Project_Node_Of (Variable, In_Tree, To => Proj);
......
...@@ -1625,7 +1625,7 @@ package Sinfo is ...@@ -1625,7 +1625,7 @@ package Sinfo is
-- when Raises_Constraint_Error is also set. In practice almost all cases -- when Raises_Constraint_Error is also set. In practice almost all cases
-- where a static expression is required do not allow an expression which -- where a static expression is required do not allow an expression which
-- raises Constraint_Error, so almost always, callers should call the -- 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. -- spec of package Sem_Eval for full details on the use of this flag.
-- Is_Subprogram_Descriptor (Flag16-Sem) -- Is_Subprogram_Descriptor (Flag16-Sem)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment