Commit e50e1c5e by Arnaud Charlet

[multiple changes]

2009-04-10  Bob Duff  <duff@adacore.com>

	* rtsfind.adb (RTE): Put implicit with_clauses on whatever unit needs
	them first, rather than on the extended main unit.

2009-04-10  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Check_Discriminant_Conformance): If discriminant
	specification of full view carries a null exclusion indicator, create
	an itype for it, to check for conformance with partial view.

From-SVN: r145916
parent cb736868
2009-04-10 Bob Duff <duff@adacore.com> 2009-04-10 Bob Duff <duff@adacore.com>
* rtsfind.adb (RTE): Put implicit with_clauses on whatever unit needs
them first, rather than on the extended main unit.
2009-04-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Discriminant_Conformance): If discriminant
specification of full view carries a null exclusion indicator, create
an itype for it, to check for conformance with partial view.
2009-04-10 Bob Duff <duff@adacore.com>
* rtsfind.ads: Minor code change: make RE_Unit_Table constant. * rtsfind.ads: Minor code change: make RE_Unit_Table constant.
* rtsfind.adb: Minor comment changes, and remove useless code. * rtsfind.adb: Minor comment changes, and remove useless code.
...@@ -112,18 +112,16 @@ package body Rtsfind is ...@@ -112,18 +112,16 @@ package body Rtsfind is
-- When a unit is implicitly loaded as a result of a call to RTE, it is -- When a unit is implicitly loaded as a result of a call to RTE, it is
-- necessary to create an implicit WITH to ensure that the object is -- necessary to create an implicit WITH to ensure that the object is
-- correctly loaded by the binder. Such WITH statements are only required -- correctly loaded by the binder. We originally added such WITH clauses
-- when the request is from the extended main unit (if a client needs a -- only if the extended main unit required them, and added them only to the
-- WITH, that will be taken care of when the client is compiled). -- extended main unit. They are currently added to whatever unit first
-- needs them, which is not necessarily the main unit. This works because
-- We always attach the WITH to the main unit. This is not perfectly -- if the main unit requires some runtime unit also required by some other
-- accurate in terms of elaboration requirements, but it is close enough, -- unit, the other unit's implicit WITH will force a correct elaboration
-- since the units that are accessed using rtsfind do not have delicate -- order. This method is necessary for SofCheck Inspector.
-- elaboration requirements.
-- The flag Withed in the unit table record is initially set to False. It -- The flag Withed in the unit table record is initially set to False. It
-- is set True if a WITH has been generated for the main unit for the -- is set True if a WITH has been generated for the corresponding unit.
-- corresponding unit.
----------------------- -----------------------
-- Local Subprograms -- -- Local Subprograms --
...@@ -1065,18 +1063,13 @@ package body Rtsfind is ...@@ -1065,18 +1063,13 @@ package body Rtsfind is
end if; end if;
end if; end if;
-- See if we have to generate a WITH for this entity. We generate -- See if we have to generate a WITH for this entity. We generate a WITH
-- a WITH if the current unit is part of the extended main code -- if we have not already added the with. The WITH is added to the
-- unit, and if we have not already added the with. The WITH is -- appropriate unit (the current one). We do not need to generate a WITH
-- added to the appropriate unit (the current one). We do not need -- for a call issued from RTE_Available.
-- to generate a WITH for a call issued from RTE_Available.
<<Found>> <<Found>>
if (not U.Withed) if (not U.Withed) and then not RTE_Available_Call then
and then
In_Extended_Main_Code_Unit (Cunit_Entity (Current_Sem_Unit))
and then not RTE_Available_Call
then
U.Withed := True; U.Withed := True;
declare declare
......
...@@ -1381,7 +1381,7 @@ package body Sem_Ch6 is ...@@ -1381,7 +1381,7 @@ package body Sem_Ch6 is
-- the case where there is no separate spec. -- the case where there is no separate spec.
procedure Check_Anonymous_Return; procedure Check_Anonymous_Return;
-- (Ada 2005): if a function returns an access type that denotes a task, -- Ada 2005: if a function returns an access type that denotes a task,
-- or a type that contains tasks, we must create a master entity for -- or a type that contains tasks, we must create a master entity for
-- the anonymous type, which typically will be used in an allocator -- the anonymous type, which typically will be used in an allocator
-- in the body of the function. -- in the body of the function.
...@@ -4048,6 +4048,20 @@ package body Sem_Ch6 is ...@@ -4048,6 +4048,20 @@ package body Sem_Ch6 is
else else
Analyze (Discriminant_Type (New_Discr)); Analyze (Discriminant_Type (New_Discr));
New_Discr_Type := Etype (Discriminant_Type (New_Discr)); New_Discr_Type := Etype (Discriminant_Type (New_Discr));
-- Ada 2005: if the discriminant definition carries a null
-- exclusion, create an itype to check properly for consistency
-- with partial declaration.
if Is_Access_Type (New_Discr_Type)
and then Null_Exclusion_Present (New_Discr)
then
New_Discr_Type :=
Create_Null_Excluding_Itype
(T => New_Discr_Type,
Related_Nod => New_Discr,
Scope_Id => Current_Scope);
end if;
end if; end if;
if not Conforming_Types if not Conforming_Types
......
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