aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-03-26 08:37:12 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2008-03-26 08:37:12 +0100
commit454a86dc55687014bed85561a3c91b794646c2d5 (patch)
tree33c138451a603360f07397808e6edd12459cc6c7 /gcc
parent1c3340e65db79867d7aaf37ff4d1876bc01f604c (diff)
downloadgcc-454a86dc55687014bed85561a3c91b794646c2d5.zip
gcc-454a86dc55687014bed85561a3c91b794646c2d5.tar.gz
gcc-454a86dc55687014bed85561a3c91b794646c2d5.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/cstand.adb39
-rw-r--r--gcc/ada/stand.ads31
2 files changed, 35 insertions, 35 deletions
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 5d16e53..7a036cd 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -379,13 +379,26 @@ package body CStand is
Set_Is_Pure (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
- 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_Public (Standard_Entity (S));
+ Set_Defining_Identifier (Decl, Standard_Entity (S));
Append (Decl, Decl_S);
end loop;
@@ -768,13 +781,7 @@ package body CStand is
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
- -- Create subtype declaration for Natural
-
- 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);
+ -- Setup entity for Naturalend Create_Standard;
Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
@@ -788,16 +795,8 @@ package body CStand is
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
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);
- Set_Defining_Identifier (Decl, Standard_Positive);
- Set_Subtype_Indication (Decl,
- New_Occurrence_Of (Standard_Integer, Stloc));
- Append (Decl, Decl_S);
+ -- Setup entity for Positive
Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
@@ -812,8 +811,6 @@ package body CStand is
Lb => Uint_1,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Positive);
- Set_Is_Frozen (Standard_Positive);
- Set_Is_Public (Standard_Positive);
-- Create declaration for package ASCII
diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads
index 32b769f..964ff19 100644
--- a/gcc/ada/stand.ads
+++ b/gcc/ada/stand.ads
@@ -54,16 +54,11 @@ package Stand is
S_Standard,
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_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_Integer,
@@ -71,21 +66,29 @@ package Stand is
S_Long_Integer,
S_Long_Long_Integer,
+ S_Natural,
+ S_Positive,
+
S_Short_Float,
S_Float,
S_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
S_False,
S_True,
- -- Subtypes declared in package Standard
-
- S_Natural,
- S_Positive,
-
-- Exceptions declared in package Standard
S_Constraint_Error,
@@ -218,7 +221,7 @@ package Stand is
S_DEL); -- 16#7F#
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
Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error;