Commit 89a4fa68 by Arnaud Charlet Committed by Pierre-Marie de Rodat

einfo.ads, einfo.adb (Activation_Record_Component, [...]): Allow E_Discriminant.

2018-01-11  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* einfo.ads, einfo.adb (Activation_Record_Component,
	Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
	Allow E_Discriminant.

From-SVN: r256481
parent 29c02e65
2018-01-11 Arnaud Charlet <charlet@adacore.com>
* einfo.ads, einfo.adb (Activation_Record_Component,
Set_Activation_Record_Component, Set_Is_Uplevel_Referenced_Entity):
Allow E_Discriminant.
2018-01-10 Eric Botcazou <ebotcazou@adacore.com> 2018-01-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check * gcc-interface/decl.c (gnat_to_gnu_component_type): Apply the check
......
...@@ -742,6 +742,7 @@ package body Einfo is ...@@ -742,6 +742,7 @@ package body Einfo is
function Activation_Record_Component (Id : E) return E is function Activation_Record_Component (Id : E) return E is
begin begin
pragma Assert (Ekind_In (Id, E_Constant, pragma Assert (Ekind_In (Id, E_Constant,
E_Discriminant,
E_In_Parameter, E_In_Parameter,
E_In_Out_Parameter, E_In_Out_Parameter,
E_Loop_Parameter, E_Loop_Parameter,
...@@ -3932,6 +3933,7 @@ package body Einfo is ...@@ -3932,6 +3933,7 @@ package body Einfo is
procedure Set_Activation_Record_Component (Id : E; V : E) is procedure Set_Activation_Record_Component (Id : E; V : E) is
begin begin
pragma Assert (Ekind_In (Id, E_Constant, pragma Assert (Ekind_In (Id, E_Constant,
E_Discriminant,
E_In_Parameter, E_In_Parameter,
E_In_Out_Parameter, E_In_Out_Parameter,
E_Loop_Parameter, E_Loop_Parameter,
...@@ -5925,7 +5927,7 @@ package body Einfo is ...@@ -5925,7 +5927,7 @@ package body Einfo is
procedure Set_Is_Uplevel_Referenced_Entity (Id : E; V : B := True) is procedure Set_Is_Uplevel_Referenced_Entity (Id : E; V : B := True) is
begin begin
pragma Assert pragma Assert
(Ekind_In (Id, E_Constant, E_Variable) (Ekind_In (Id, E_Constant, E_Variable, E_Discriminant)
or else Is_Formal (Id) or else Is_Formal (Id)
or else Is_Type (Id)); or else Is_Type (Id));
Set_Flag283 (Id, V); Set_Flag283 (Id, V);
......
...@@ -364,11 +364,12 @@ package Einfo is ...@@ -364,11 +364,12 @@ package Einfo is
-- the IP routine to avoid performing this elaboration twice. -- the IP routine to avoid performing this elaboration twice.
-- Activation_Record_Component (Node31) -- Activation_Record_Component (Node31)
-- Defined in E_Variable, E_Constant, E_Loop_Parameter, E_In_Parameter, -- Defined in E_Variable, E_Constant, E_Discriminant, E_Loop_Parameter,
-- E_Out_Parameter, E_In_Out_Parameter nodes. Used only if we are in -- E_In_Parameter, E_Out_Parameter, E_In_Out_Parameter nodes. Used only
-- Opt.Unnest_Subprogram_Mode, in which case for the case of an uplevel -- if we are in Opt.Unnest_Subprogram_Mode, in which case for the case of
-- referenced entity, this field contains the entity for the component -- an uplevel referenced entity, this field contains the entity for the
-- in the generated ARECnT activation record (Exp_Unst for details). -- component in the generated ARECnT activation record (Exp_Unst for
-- details).
-- Actual_Subtype (Node17) -- Actual_Subtype (Node17)
-- Defined in variables, constants, and formal parameters. This is the -- Defined in variables, constants, and formal parameters. This is the
...@@ -3317,11 +3318,12 @@ package Einfo is ...@@ -3317,11 +3318,12 @@ package Einfo is
-- Defined in all entities. Used when unnesting subprograms to indicate -- Defined in all entities. Used when unnesting subprograms to indicate
-- that an entity is locally defined within a subprogram P, and there is -- that an entity is locally defined within a subprogram P, and there is
-- a reference to the entity within a subprogram nested within P (at any -- a reference to the entity within a subprogram nested within P (at any
-- depth). Set for uplevel referenced objects (variables, constants and -- depth). Set for uplevel referenced objects (variables, constants,
-- loop parameters), and also for upreferenced dynamic types, including -- discriminants and loop parameters), and also for upreferenced dynamic
-- the cases where the reference is implicit (e.g. the type of an array -- types, including the cases where the reference is implicit (e.g. the
-- used for computing the location of an element in an array. This is -- type of an array used for computing the location of an element in an
-- used internally in Exp_Unst, see this package for further details. -- array. This is used internally in Exp_Unst, see this package for
-- further details.
-- Is_Valued_Procedure (Flag127) -- Is_Valued_Procedure (Flag127)
-- Defined in procedure entities. Set if an Import_Valued_Procedure -- Defined in procedure entities. Set if an Import_Valued_Procedure
......
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