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>
* gnat_ugn.texi, vms_data.ads: Add the documentation for the new
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -3095,11 +3095,23 @@ package body Checks is
Lor := No_Uint;
Hir := No_Uint;
-- If the type is not discrete, or is undefined, then we can't do
-- anything about determining the range.
-- If type is not defined, we can't determine its range
if No (Typ) or else not Is_Discrete_Type (Typ)
or else Error_Posted (N)
if No (Typ)
-- 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
OK := False;
return;
......
......@@ -190,7 +190,7 @@ __gnat_setenv (char *name, char *value)
char **
__gnat_environ (void)
{
#if defined (VMS)
#if defined (VMS) || defined (RTX)
/* Not implemented */
return NULL;
#elif defined (__APPLE__)
......
......@@ -1541,9 +1541,15 @@ package body Sem is
N_Generic_Procedure_Renaming_Declaration =>
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)
or else CU = Cunit (Main_Unit));
......@@ -1716,15 +1722,25 @@ package body Sem is
-- processing of the body of a unit named by pragma Extend_System,
-- 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
Body_Unit : constant Node_Id := Library_Unit (CU);
begin
if Present (Body_Unit)
and then Body_Unit /= Cunit (Main_Unit)
and then Unit_Num /= Get_Source_Unit (System_Aux_Id)
then
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;
end if;
......@@ -1771,14 +1787,7 @@ package body Sem is
Entity := Specification (Entity);
end if;
Entity := Defining_Unit_Name (Entity);
if Nkind (Entity) not in N_Entity then
-- Must be N_Defining_Program_Unit_Name
Entity := Defining_Identifier (Entity);
end if;
Entity := Defining_Entity (Entity);
if Is_Generic_Instance (Entity) then
declare
......@@ -1791,7 +1800,7 @@ package body Sem is
-- with_clauses that got attached to the body.
Append_List
(Context_Items (CU), Context_Items (Spec_Unit));
(Context_Items (CU), Context_Items (Spec_Unit));
Do_Unit_And_Dependents
(Spec_Unit, Unit (Spec_Unit));
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