+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
-- 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
-- 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
-- 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
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
---------------------------------------
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;
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;
-- --
-- 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- --
-- 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
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);
-- 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)