Commit 1abad480 by Arnaud Charlet

[multiple changes]

2009-06-19  Jose Ruiz  <ruiz@adacore.com>

	* env.c (__gnat_environ): RTX does not support this functionality.

2009-06-19  Sergey Rybin  <rybin@adacore.com>

	* gnat_ugn.texi, vms_data.ads: Fix VMS qualifiers.

2009-06-19  Ed Schonberg  <schonberg@adacore.com>

	* sem.adb (Walk_Library_Items): Include bodies in the list of units to
	traverse, to account for front-end inlining and instantiations in a
	spec or in the main unit.

2009-06-19  Robert Dewar  <dewar@adacore.com>

	* checks.adb (Determine_Range): Do not attempt to get range of generic
	type.

From-SVN: r148693
parent c38e990f
2009-06-19 Jose Ruiz <ruiz@adacore.com>
* env.c (__gnat_environ): RTX does not support this functionality.
2009-06-19 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Walk_Library_Items): Include bodies in the list of units to
traverse, to account for front-end inlining and instantiations in a
spec or in the main unit.
2009-06-19 Robert Dewar <dewar@adacore.com>
* checks.adb (Determine_Range): Do not attempt to get range of generic
type.
2009-06-19 Sergey Rybin <rybin@adacore.com> 2009-06-19 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi, vms_data.ads: Add the documentation for the new * gnat_ugn.texi, vms_data.ads: Add the documentation for the new
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2009, 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- --
...@@ -3095,11 +3095,23 @@ package body Checks is ...@@ -3095,11 +3095,23 @@ package body Checks is
Lor := No_Uint; Lor := No_Uint;
Hir := No_Uint; Hir := No_Uint;
-- If the type is not discrete, or is undefined, then we can't do -- If type is not defined, we can't determine its range
-- anything about determining the range.
if No (Typ) or else not Is_Discrete_Type (Typ) if No (Typ)
or else Error_Posted (N)
-- We don't deal with anything except discrete types
or else not Is_Discrete_Type (Typ)
-- Ignore type for which an error has been posted, since range in
-- this case may well be a bogosity deriving from the error. Also
-- ignore if error posted on the reference node.
or else Error_Posted (N) or else Error_Posted (Typ)
-- Ignore generic type, since range is indeed bogus
or else Is_Generic_Type (Typ)
then then
OK := False; OK := False;
return; return;
......
...@@ -190,7 +190,7 @@ __gnat_setenv (char *name, char *value) ...@@ -190,7 +190,7 @@ __gnat_setenv (char *name, char *value)
char ** char **
__gnat_environ (void) __gnat_environ (void)
{ {
#if defined (VMS) #if defined (VMS) || defined (RTX)
/* Not implemented */ /* Not implemented */
return NULL; return NULL;
#elif defined (__APPLE__) #elif defined (__APPLE__)
......
...@@ -1541,9 +1541,15 @@ package body Sem is ...@@ -1541,9 +1541,15 @@ package body Sem is
N_Generic_Procedure_Renaming_Declaration => N_Generic_Procedure_Renaming_Declaration =>
null; -- Specs are OK null; -- Specs are OK
when N_Package_Body | N_Subprogram_Body => -- Package bodies are processed immediately after the
-- corresponding spec.
-- A body must be the main unit when N_Package_Body =>
null;
when N_Subprogram_Body =>
-- A subprogram body must be the main unit
pragma Assert (Acts_As_Spec (CU) pragma Assert (Acts_As_Spec (CU)
or else CU = Cunit (Main_Unit)); or else CU = Cunit (Main_Unit));
...@@ -1716,15 +1722,25 @@ package body Sem is ...@@ -1716,15 +1722,25 @@ package body Sem is
-- processing of the body of a unit named by pragma Extend_System, -- processing of the body of a unit named by pragma Extend_System,
-- because it has cyclic dependences in some cases. -- because it has cyclic dependences in some cases.
if not Nkind_In (Item, N_Package_Body, N_Subprogram_Body) then -- A body that is not the main unit is present because of inlining
-- and/or instantiations, and it is best to process a body as early
-- as possible after the spec (as if an Elaborate_Body were present).
-- Currently all such bodies are added to the units list. It might
-- be possible to restrict the list to those bodies that are used
-- in the main unit. Possible optimization ???
if Nkind (Item) = N_Package_Declaration then
declare declare
Body_Unit : constant Node_Id := Library_Unit (CU); Body_Unit : constant Node_Id := Library_Unit (CU);
begin begin
if Present (Body_Unit) if Present (Body_Unit)
and then Body_Unit /= Cunit (Main_Unit) and then Body_Unit /= Cunit (Main_Unit)
and then Unit_Num /= Get_Source_Unit (System_Aux_Id) and then Unit_Num /= Get_Source_Unit (System_Aux_Id)
then then
Do_Unit_And_Dependents (Body_Unit, Unit (Body_Unit)); Do_Unit_And_Dependents (Body_Unit, Unit (Body_Unit));
Do_Action (Body_Unit, Unit (Body_Unit));
Done (Get_Cunit_Unit_Number (Body_Unit)) := True;
end if; end if;
end; end;
end if; end if;
...@@ -1771,14 +1787,7 @@ package body Sem is ...@@ -1771,14 +1787,7 @@ package body Sem is
Entity := Specification (Entity); Entity := Specification (Entity);
end if; end if;
Entity := Defining_Unit_Name (Entity); Entity := Defining_Entity (Entity);
if Nkind (Entity) not in N_Entity then
-- Must be N_Defining_Program_Unit_Name
Entity := Defining_Identifier (Entity);
end if;
if Is_Generic_Instance (Entity) then if Is_Generic_Instance (Entity) then
declare declare
...@@ -1791,7 +1800,7 @@ package body Sem is ...@@ -1791,7 +1800,7 @@ package body Sem is
-- with_clauses that got attached to the body. -- with_clauses that got attached to the body.
Append_List Append_List
(Context_Items (CU), Context_Items (Spec_Unit)); (Context_Items (CU), Context_Items (Spec_Unit));
Do_Unit_And_Dependents Do_Unit_And_Dependents
(Spec_Unit, Unit (Spec_Unit)); (Spec_Unit, Unit (Spec_Unit));
end; end;
......
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