Commit 454a86dc by Robert Dewar Committed by Arnaud Charlet

stand.ads: Deal with reordering of package standard declarations

2008-03-26  Robert Dewar  <dewar@adacore.com>

	* stand.ads: Deal with reordering of package standard declarations

	* cstand.adb: Put package Standard declarations in proper order

From-SVN: r133554
parent 1c3340e6
...@@ -379,13 +379,26 @@ package body CStand is ...@@ -379,13 +379,26 @@ package body CStand is
Set_Is_Pure (Standard_Standard); Set_Is_Pure (Standard_Standard);
Set_Is_Compilation_Unit (Standard_Standard); Set_Is_Compilation_Unit (Standard_Standard);
-- Create type declaration nodes for standard types -- Create type/subtype declaration nodes for standard types
for S in S_Types loop for S in S_Types loop
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Entity (S)); -- Subtype declaration case
if S = S_Natural or else S = S_Positive then
Decl := New_Node (N_Subtype_Declaration, Stloc);
Set_Subtype_Indication (Decl,
New_Occurrence_Of (Standard_Integer, Stloc));
-- Full type declaration case
else
Decl := New_Node (N_Full_Type_Declaration, Stloc);
end if;
Set_Is_Frozen (Standard_Entity (S)); Set_Is_Frozen (Standard_Entity (S));
Set_Is_Public (Standard_Entity (S)); Set_Is_Public (Standard_Entity (S));
Set_Defining_Identifier (Decl, Standard_Entity (S));
Append (Decl, Decl_S); Append (Decl, Decl_S);
end loop; end loop;
...@@ -768,13 +781,7 @@ package body CStand is ...@@ -768,13 +781,7 @@ package body CStand is
Set_Entity (E_Id, Standard_Positive); Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive); Set_Etype (E_Id, Standard_Positive);
-- Create subtype declaration for Natural -- Setup entity for Naturalend Create_Standard;
Decl := New_Node (N_Subtype_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Natural);
Set_Subtype_Indication (Decl,
New_Occurrence_Of (Standard_Integer, Stloc));
Append (Decl, Decl_S);
Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype); Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
Set_Etype (Standard_Natural, Base_Type (Standard_Integer)); Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
...@@ -788,16 +795,8 @@ package body CStand is ...@@ -788,16 +795,8 @@ package body CStand is
Lb => Uint_0, Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer)))); Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Natural); Set_Is_Constrained (Standard_Natural);
Set_Is_Frozen (Standard_Natural);
Set_Is_Public (Standard_Natural);
-- Create subtype declaration for Positive
Decl := New_Node (N_Subtype_Declaration, Stloc); -- Setup entity for Positive
Set_Defining_Identifier (Decl, Standard_Positive);
Set_Subtype_Indication (Decl,
New_Occurrence_Of (Standard_Integer, Stloc));
Append (Decl, Decl_S);
Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype); Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
Set_Etype (Standard_Positive, Base_Type (Standard_Integer)); Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
...@@ -812,8 +811,6 @@ package body CStand is ...@@ -812,8 +811,6 @@ package body CStand is
Lb => Uint_1, Lb => Uint_1,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer)))); Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Positive); Set_Is_Constrained (Standard_Positive);
Set_Is_Frozen (Standard_Positive);
Set_Is_Public (Standard_Positive);
-- Create declaration for package ASCII -- Create declaration for package ASCII
......
...@@ -54,16 +54,11 @@ package Stand is ...@@ -54,16 +54,11 @@ package Stand is
S_Standard, S_Standard,
S_ASCII, S_ASCII,
-- Types defined in package Standard -- Types and subtypes defined in package Standard (in the order in which
-- they appear in the RM, so that the declarations are in the right
-- order for the purposes of ASIS traversals
S_Boolean, S_Boolean,
S_Character,
S_Wide_Character,
S_Wide_Wide_Character,
S_String,
S_Wide_String,
S_Wide_Wide_String,
S_Duration,
S_Short_Short_Integer, S_Short_Short_Integer,
S_Short_Integer, S_Short_Integer,
...@@ -71,21 +66,29 @@ package Stand is ...@@ -71,21 +66,29 @@ package Stand is
S_Long_Integer, S_Long_Integer,
S_Long_Long_Integer, S_Long_Long_Integer,
S_Natural,
S_Positive,
S_Short_Float, S_Short_Float,
S_Float, S_Float,
S_Long_Float, S_Long_Float,
S_Long_Long_Float, S_Long_Long_Float,
S_Character,
S_Wide_Character,
S_Wide_Wide_Character,
S_String,
S_Wide_String,
S_Wide_Wide_String,
S_Duration,
-- Enumeration literals for type Boolean -- Enumeration literals for type Boolean
S_False, S_False,
S_True, S_True,
-- Subtypes declared in package Standard
S_Natural,
S_Positive,
-- Exceptions declared in package Standard -- Exceptions declared in package Standard
S_Constraint_Error, S_Constraint_Error,
...@@ -218,7 +221,7 @@ package Stand is ...@@ -218,7 +221,7 @@ package Stand is
S_DEL); -- 16#7F# S_DEL); -- 16#7F#
subtype S_Types is subtype S_Types is
Standard_Entity_Type range S_Boolean .. S_Long_Long_Float; Standard_Entity_Type range S_Boolean .. S_Duration;
subtype S_Exceptions is subtype S_Exceptions is
Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error; Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error;
......
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