Commit baad9830 by Thomas Quinot Committed by Arnaud Charlet

exp_dist.adb (Build_From_Any_Call, [...]): For a used-defined subtype, always go…

exp_dist.adb (Build_From_Any_Call, [...]): For a used-defined subtype, always go to the first subtype of the base type.

2012-12-05  Thomas Quinot  <quinot@adacore.com>

	* exp_dist.adb (Build_From_Any_Call, Build_To_Any_Call,
	Build_TypeCode_Call): For a used-defined subtype, always go to
	the first subtype of the base type.

From-SVN: r194206
parent 0f4be535
2012-12-05 Thomas Quinot <quinot@adacore.com> 2012-12-05 Thomas Quinot <quinot@adacore.com>
* exp_dist.adb (Build_From_Any_Call, Build_To_Any_Call,
Build_TypeCode_Call): For a used-defined subtype, always go to
the first subtype of the base type.
2012-12-05 Thomas Quinot <quinot@adacore.com>
* exp_dist.adb: Minor reformatting. * exp_dist.adb: Minor reformatting.
2012-12-05 Tristan Gingold <gingold@adacore.com> 2012-12-05 Tristan Gingold <gingold@adacore.com>
......
...@@ -839,7 +839,7 @@ package body Exp_Dist is ...@@ -839,7 +839,7 @@ package body Exp_Dist is
Fnam : out Entity_Id); Fnam : out Entity_Id);
-- Build TypeCode attribute function for Typ. Loc is the reference -- Build TypeCode attribute function for Typ. Loc is the reference
-- location for generated nodes, Typ is the type for which the -- location for generated nodes, Typ is the type for which the
-- conversion function is generated. On return, Decl and Fnam contain -- typecode function is generated. On return, Decl and Fnam contain
-- the declaration and entity for the newly-created function. -- the declaration and entity for the newly-created function.
procedure Build_Name_And_Repository_Id procedure Build_Name_And_Repository_Id
...@@ -8453,6 +8453,14 @@ package body Exp_Dist is ...@@ -8453,6 +8453,14 @@ package body Exp_Dist is
if Sloc (U_Type) <= Standard_Location then if Sloc (U_Type) <= Standard_Location then
U_Type := Base_Type (U_Type); U_Type := Base_Type (U_Type);
-- For a user subtype, go to first subtype
elsif Comes_From_Source (U_Type)
and then Nkind (Declaration_Node (U_Type))
= N_Subtype_Declaration
then
U_Type := First_Subtype (U_Type);
end if; end if;
-- Check first for Boolean and Character. These are enumeration -- Check first for Boolean and Character. These are enumeration
...@@ -9261,6 +9269,14 @@ package body Exp_Dist is ...@@ -9261,6 +9269,14 @@ package body Exp_Dist is
if Sloc (U_Type) <= Standard_Location then if Sloc (U_Type) <= Standard_Location then
U_Type := Base_Type (U_Type); U_Type := Base_Type (U_Type);
-- For a user subtype, go to first subtype
elsif Comes_From_Source (U_Type)
and then Nkind (Declaration_Node (U_Type))
= N_Subtype_Declaration
then
U_Type := First_Subtype (U_Type);
end if; end if;
if Present (Fnam) then if Present (Fnam) then
...@@ -10045,6 +10061,14 @@ package body Exp_Dist is ...@@ -10045,6 +10061,14 @@ package body Exp_Dist is
if Sloc (U_Type) <= Standard_Location then if Sloc (U_Type) <= Standard_Location then
U_Type := Base_Type (U_Type); U_Type := Base_Type (U_Type);
-- For a user subtype, go to first subtype
elsif Comes_From_Source (U_Type)
and then Nkind (Declaration_Node (U_Type))
= N_Subtype_Declaration
then
U_Type := First_Subtype (U_Type);
end if; end if;
if No (Fnam) then if No (Fnam) then
...@@ -10257,9 +10281,7 @@ package body Exp_Dist is ...@@ -10257,9 +10281,7 @@ package body Exp_Dist is
-- Return_Alias_TypeCode -- -- Return_Alias_TypeCode --
--------------------------- ---------------------------
procedure Return_Alias_TypeCode procedure Return_Alias_TypeCode (Base_TypeCode : Node_Id) is
(Base_TypeCode : Node_Id)
is
begin begin
Add_TypeCode_Parameter (Base_TypeCode, Parameters); Add_TypeCode_Parameter (Base_TypeCode, Parameters);
Return_Constructed_TypeCode (RTE (RE_TC_Alias)); Return_Constructed_TypeCode (RTE (RE_TC_Alias));
......
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