Mutate_Ekind (E, E_Floating_Point_Type);
Set_Etype (E, E);
- Init_Digits_Value (E, Digs);
+ Set_Digits_Value (E, UI_From_Int (Digs));
Set_Float_Rep (E, Rep);
Init_Size (E, Siz);
Set_Elem_Alignment (E, Align);
Set_Has_Pragma_Pack (String_Type, True);
end Pack_String_Type;
+ Char_Size : constant Unat := UI_From_Int (Standard_Character_Size);
+
-- Start of processing for Create_Standard
begin
Mutate_Ekind (Standard_Boolean, E_Enumeration_Type);
Set_First_Literal (Standard_Boolean, Standard_False);
Set_Etype (Standard_Boolean, Standard_Boolean);
- Init_Esize (Standard_Boolean, Standard_Character_Size);
- Init_RM_Size (Standard_Boolean, 1);
+ Set_Esize (Standard_Boolean, Char_Size);
+ Set_RM_Size (Standard_Boolean, Uint_1);
Set_Elem_Alignment (Standard_Boolean);
Set_Is_Unsigned_Type (Standard_Boolean);
Mutate_Ekind (Standard_Character, E_Enumeration_Type);
Set_Etype (Standard_Character, Standard_Character);
- Init_Esize (Standard_Character, Standard_Character_Size);
- Init_RM_Size (Standard_Character, 8);
+ Set_Esize (Standard_Character, Char_Size);
+ Set_RM_Size (Standard_Character, Uint_8);
Set_Elem_Alignment (Standard_Character);
Set_Has_Pragma_Ordered (Standard_Character);
Set_Etype (Standard_String, Standard_String);
Set_Component_Type (Standard_String, Standard_Character);
Set_Component_Size (Standard_String, Uint_8);
- Init_Size_Align (Standard_String);
+ Reinit_Size_Align (Standard_String);
Set_Alignment (Standard_String, Uint_1);
Pack_String_Type (Standard_String);
Set_Etype (Standard_Wide_String, Standard_Wide_String);
Set_Component_Type (Standard_Wide_String, Standard_Wide_Character);
Set_Component_Size (Standard_Wide_String, Uint_16);
- Init_Size_Align (Standard_Wide_String);
+ Reinit_Size_Align (Standard_Wide_String);
Pack_String_Type (Standard_Wide_String);
-- Set index type of Wide_String
Set_Component_Type (Standard_Wide_Wide_String,
Standard_Wide_Wide_Character);
Set_Component_Size (Standard_Wide_Wide_String, Uint_32);
- Init_Size_Align (Standard_Wide_Wide_String);
+ Reinit_Size_Align (Standard_Wide_Wide_String);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_String);
Pack_String_Type (Standard_Wide_Wide_String);
-- Setup entity for Natural
- Mutate_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
- Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
- Init_Esize (Standard_Natural, Standard_Integer_Size);
- Init_RM_Size (Standard_Natural, Standard_Integer_Size - 1);
+ Mutate_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
+ Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
+ Set_Esize (Standard_Natural, UI_From_Int (Standard_Integer_Size));
+ Set_RM_Size (Standard_Natural, UI_From_Int (Standard_Integer_Size - 1));
Set_Elem_Alignment (Standard_Natural);
Set_Size_Known_At_Compile_Time
(Standard_Natural);
-- Setup entity for Positive
- Mutate_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
- Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
- Init_Esize (Standard_Positive, Standard_Integer_Size);
- Init_RM_Size (Standard_Positive, Standard_Integer_Size - 1);
+ Mutate_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
+ Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
+ Set_Esize (Standard_Positive, UI_From_Int (Standard_Integer_Size));
+ Set_RM_Size
+ (Standard_Positive, UI_From_Int (Standard_Integer_Size - 1));
Set_Elem_Alignment (Standard_Positive);
Set_Size_Known_At_Compile_Time (Standard_Positive);
Init_Size (Standard_A_String, System_Address_Size * 2);
end if;
- Init_Alignment (Standard_A_String);
+ pragma Assert (not Known_Alignment (Standard_A_String));
Set_Directly_Designated_Type
(Standard_A_String, Standard_String);
Mutate_Ekind (Standard_Debug_Renaming_Type, E_Signed_Integer_Subtype);
Set_Scope (Standard_Debug_Renaming_Type, Standard_Standard);
Set_Etype (Standard_Debug_Renaming_Type, Base_Type (Standard_Integer));
- Init_Esize (Standard_Debug_Renaming_Type, 0);
- Init_RM_Size (Standard_Debug_Renaming_Type, 0);
+ pragma Assert
+ (Field_Is_Initial_Zero (Standard_Debug_Renaming_Type, F_Esize));
+ pragma Assert
+ (Field_Is_Initial_Zero (Standard_Debug_Renaming_Type, F_RM_Size));
Set_Size_Known_At_Compile_Time (Standard_Debug_Renaming_Type);
- Set_Integer_Bounds (Standard_Debug_Renaming_Type,
- Typ => Base_Type (Standard_Debug_Renaming_Type),
+ Set_Integer_Bounds (Standard_Debug_Renaming_Type,
+ Typ => Base_Type (Standard_Debug_Renaming_Type),
Lb => Uint_1,
Hb => Uint_0);
- Set_Is_Constrained (Standard_Debug_Renaming_Type);
+ Set_Is_Constrained (Standard_Debug_Renaming_Type);
Set_Has_Size_Clause (Standard_Debug_Renaming_Type);
-- Note on type names. The type names for the following special types
Mutate_Ekind (Any_Id, E_Variable);
Set_Scope (Any_Id, Standard_Standard);
Set_Etype (Any_Id, Any_Type);
- Init_Esize (Any_Id);
- Init_Alignment (Any_Id);
+ pragma Assert (not Known_Esize (Any_Id));
+ pragma Assert (not Known_Alignment (Any_Id));
Any_Access := New_Standard_Entity ("an access type");
Mutate_Ekind (Any_Access, E_Access_Type);
Set_Etype (Any_Character, Any_Character);
Set_Is_Unsigned_Type (Any_Character);
Set_Is_Character_Type (Any_Character);
- Init_Esize (Any_Character, Standard_Character_Size);
- Init_RM_Size (Any_Character, 8);
+ Set_Esize (Any_Character, Char_Size);
+ Set_RM_Size (Any_Character, Uint_8);
Set_Elem_Alignment (Any_Character);
Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character));
Set_Scope (Any_Array, Standard_Standard);
Set_Etype (Any_Array, Any_Array);
Set_Component_Type (Any_Array, Any_Character);
- Init_Size_Align (Any_Array);
+ Reinit_Size_Align (Any_Array);
Make_Dummy_Index (Any_Array);
Any_Boolean := New_Standard_Entity ("a boolean type");
Mutate_Ekind (Any_Boolean, E_Enumeration_Type);
Set_Scope (Any_Boolean, Standard_Standard);
Set_Etype (Any_Boolean, Standard_Boolean);
- Init_Esize (Any_Boolean, Standard_Character_Size);
- Init_RM_Size (Any_Boolean, 1);
+ Set_Esize (Any_Boolean, Char_Size);
+ Set_RM_Size (Any_Boolean, Uint_1);
Set_Elem_Alignment (Any_Boolean);
Set_Is_Unsigned_Type (Any_Boolean);
Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean));
Set_Etype (Any_Composite, Any_Composite);
Set_Component_Size (Any_Composite, Uint_0);
Set_Component_Type (Any_Composite, Standard_Integer);
- Init_Size_Align (Any_Composite);
+ Reinit_Size_Align (Any_Composite);
Any_Discrete := New_Standard_Entity ("a discrete type");
Mutate_Ekind (Any_Discrete, E_Signed_Integer_Type);
Set_Scope (Any_String, Standard_Standard);
Set_Etype (Any_String, Any_String);
Set_Component_Type (Any_String, Any_Character);
- Init_Size_Align (Any_String);
+ Reinit_Size_Align (Any_String);
Make_Dummy_Index (Any_String);
Raise_Type := New_Standard_Entity ("raise type");
Set_Scope (Standard_Exception_Type, Standard_Standard);
Set_Stored_Constraint
(Standard_Exception_Type, No_Elist);
- Init_Size_Align (Standard_Exception_Type);
+ Reinit_Size_Align (Standard_Exception_Type);
Set_Size_Known_At_Compile_Time
(Standard_Exception_Type, True);
Mutate_Ekind (Id, E_Component);
Set_Etype (Id, Typ);
Set_Scope (Id, Rec);
- Init_Component_Location (Id);
+ Reinit_Component_Location (Id);
Set_Original_Record_Component (Id, Id);
Set_Is_Aliased (Id);
Set_Is_Independent (Id);
return Ekind (Id) in Type_Kind;
end Is_Type;
- -----------------------------------
- -- Field Initialization Routines --
- -----------------------------------
+ ------------------------------------------
+ -- Type Representation Attribute Fields --
+ ------------------------------------------
- procedure Init_Alignment (Id : E) is
+ function Known_Alignment (E : Entity_Id) return B is
+ Result : constant B := not Field_Is_Initial_Zero (E, F_Alignment);
+ begin
+ return Result;
+ end Known_Alignment;
+
+ procedure Reinit_Alignment (Id : E) is
begin
Reinit_Field_To_Zero (Id, F_Alignment);
- end Init_Alignment;
+ end Reinit_Alignment;
- procedure Init_Alignment (Id : E; V : Int) is
+ procedure Copy_Alignment (To, From : E) is
begin
- Set_Alignment (Id, UI_From_Int (V));
- end Init_Alignment;
+ if Known_Alignment (From) then
+ Set_Alignment (To, Alignment (From));
+ else
+ Reinit_Alignment (To);
+ end if;
+ end Copy_Alignment;
- procedure Init_Component_Bit_Offset (Id : E) is
+ function Known_Component_Bit_Offset (E : Entity_Id) return B is
begin
- Set_Component_Bit_Offset (Id, No_Uint);
- end Init_Component_Bit_Offset;
+ return Component_Bit_Offset (E) /= No_Uint;
+ end Known_Component_Bit_Offset;
- procedure Init_Component_Bit_Offset (Id : E; V : Int) is
+ function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
begin
- Set_Component_Bit_Offset (Id, UI_From_Int (V));
- end Init_Component_Bit_Offset;
+ return Component_Bit_Offset (E) /= No_Uint
+ and then Component_Bit_Offset (E) >= Uint_0;
+ end Known_Static_Component_Bit_Offset;
- procedure Init_Component_Size (Id : E) is
+ function Known_Component_Size (E : Entity_Id) return B is
begin
- Set_Component_Size (Id, Uint_0);
- end Init_Component_Size;
+ return Component_Size (E) /= Uint_0
+ and then Component_Size (E) /= No_Uint;
+ end Known_Component_Size;
- procedure Init_Component_Size (Id : E; V : Int) is
+ function Known_Static_Component_Size (E : Entity_Id) return B is
begin
- Set_Component_Size (Id, UI_From_Int (V));
- end Init_Component_Size;
+ return Component_Size (E) > Uint_0;
+ end Known_Static_Component_Size;
- procedure Init_Digits_Value (Id : E) is
+ function Known_Esize (E : Entity_Id) return B is
begin
- Set_Digits_Value (Id, Uint_0);
- end Init_Digits_Value;
+ return Esize (E) /= Uint_0
+ and then Esize (E) /= No_Uint;
+ end Known_Esize;
- procedure Init_Digits_Value (Id : E; V : Int) is
+ function Known_Static_Esize (E : Entity_Id) return B is
begin
- Set_Digits_Value (Id, UI_From_Int (V));
- end Init_Digits_Value;
+ return Esize (E) > Uint_0
+ and then not Is_Generic_Type (E);
+ end Known_Static_Esize;
- procedure Init_Esize (Id : E) is
+ procedure Reinit_Esize (Id : E) is
begin
Set_Esize (Id, Uint_0);
- end Init_Esize;
+ end Reinit_Esize;
- procedure Init_Esize (Id : E; V : Int) is
+ procedure Copy_Esize (To, From : E) is
begin
- Set_Esize (Id, UI_From_Int (V));
- end Init_Esize;
+ raise Program_Error with "Copy_Esize not yet implemented";
+ end Copy_Esize;
- procedure Init_Normalized_First_Bit (Id : E) is
+ function Known_Normalized_First_Bit (E : Entity_Id) return B is
begin
- Set_Normalized_First_Bit (Id, No_Uint);
- end Init_Normalized_First_Bit;
+ return Normalized_First_Bit (E) /= No_Uint;
+ end Known_Normalized_First_Bit;
- procedure Init_Normalized_First_Bit (Id : E; V : Int) is
+ function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
begin
- Set_Normalized_First_Bit (Id, UI_From_Int (V));
- end Init_Normalized_First_Bit;
+ return Normalized_First_Bit (E) /= No_Uint
+ and then Normalized_First_Bit (E) >= Uint_0;
+ end Known_Static_Normalized_First_Bit;
- procedure Init_Normalized_Position (Id : E) is
+ function Known_Normalized_Position (E : Entity_Id) return B is
begin
- Set_Normalized_Position (Id, No_Uint);
- end Init_Normalized_Position;
+ return Normalized_Position (E) /= No_Uint;
+ end Known_Normalized_Position;
- procedure Init_Normalized_Position (Id : E; V : Int) is
+ function Known_Static_Normalized_Position (E : Entity_Id) return B is
begin
- Set_Normalized_Position (Id, UI_From_Int (V));
- end Init_Normalized_Position;
+ return Normalized_Position (E) /= No_Uint
+ and then Normalized_Position (E) >= Uint_0;
+ end Known_Static_Normalized_Position;
- procedure Init_Normalized_Position_Max (Id : E) is
+ function Known_RM_Size (E : Entity_Id) return B is
begin
- Set_Normalized_Position_Max (Id, No_Uint);
- end Init_Normalized_Position_Max;
+ return RM_Size (E) /= No_Uint
+ and then (RM_Size (E) /= Uint_0
+ or else Is_Discrete_Type (E)
+ or else Is_Fixed_Point_Type (E));
+ end Known_RM_Size;
- procedure Init_Normalized_Position_Max (Id : E; V : Int) is
+ function Known_Static_RM_Size (E : Entity_Id) return B is
begin
- Set_Normalized_Position_Max (Id, UI_From_Int (V));
- end Init_Normalized_Position_Max;
+ return (RM_Size (E) > Uint_0
+ or else Is_Discrete_Type (E)
+ or else Is_Fixed_Point_Type (E))
+ and then not Is_Generic_Type (E);
+ end Known_Static_RM_Size;
- procedure Init_RM_Size (Id : E) is
+ procedure Reinit_RM_Size (Id : E) is
begin
Set_RM_Size (Id, Uint_0);
- end Init_RM_Size;
+ end Reinit_RM_Size;
- procedure Init_RM_Size (Id : E; V : Int) is
+ procedure Copy_RM_Size (To, From : E) is
begin
- Set_RM_Size (Id, UI_From_Int (V));
- end Init_RM_Size;
+ raise Program_Error with "Copy_RM_Size not yet implemented";
+ end Copy_RM_Size;
- procedure Copy_Alignment (To, From : E) is
- begin
- if Known_Alignment (From) then
- Set_Alignment (To, Alignment (From));
- else
- Init_Alignment (To);
- end if;
- end Copy_Alignment;
-
- -----------------------------
- -- Init_Component_Location --
- -----------------------------
+ -------------------------------
+ -- Reinit_Component_Location --
+ -------------------------------
- procedure Init_Component_Location (Id : E) is
+ procedure Reinit_Component_Location (Id : E) is
begin
- Set_Normalized_First_Bit (Id, No_Uint);
- Set_Normalized_Position_Max (Id, No_Uint);
+ Set_Normalized_First_Bit (Id, No_Uint);
Set_Component_Bit_Offset (Id, No_Uint);
- Set_Esize (Id, Uint_0);
+ Reinit_Esize (Id);
Set_Normalized_Position (Id, No_Uint);
- end Init_Component_Location;
+ end Reinit_Component_Location;
- ----------------------------
- -- Init_Object_Size_Align --
- ----------------------------
+ ------------------------------
+ -- Reinit_Object_Size_Align --
+ ------------------------------
- procedure Init_Object_Size_Align (Id : E) is
+ procedure Reinit_Object_Size_Align (Id : E) is
begin
- Init_Esize (Id);
- Init_Alignment (Id);
- end Init_Object_Size_Align;
+ Reinit_Esize (Id);
+ Reinit_Alignment (Id);
+ end Reinit_Object_Size_Align;
---------------
-- Init_Size --
Set_RM_Size (Id, UI_From_Int (V));
end Init_Size;
- ---------------------
- -- Init_Size_Align --
- ---------------------
+ -----------------------
+ -- Reinit_Size_Align --
+ -----------------------
- procedure Init_Size_Align (Id : E) is
+ procedure Reinit_Size_Align (Id : E) is
begin
pragma Assert (Ekind (Id) in Type_Kind | E_Void);
- Init_Esize (Id);
- Init_RM_Size (Id);
- Init_Alignment (Id);
- end Init_Size_Align;
-
- ----------------------------------------------
- -- Type Representation Attribute Predicates --
- ----------------------------------------------
-
- function Known_Alignment (E : Entity_Id) return B is
- Result : constant B := not Field_Is_Initial_Zero (E, F_Alignment);
- begin
- return Result;
- end Known_Alignment;
-
- function Known_Component_Bit_Offset (E : Entity_Id) return B is
- begin
- return Component_Bit_Offset (E) /= No_Uint;
- end Known_Component_Bit_Offset;
-
- function Known_Component_Size (E : Entity_Id) return B is
- begin
- return Component_Size (E) /= Uint_0
- and then Component_Size (E) /= No_Uint;
- end Known_Component_Size;
-
- function Known_Esize (E : Entity_Id) return B is
- begin
- return Esize (E) /= Uint_0
- and then Esize (E) /= No_Uint;
- end Known_Esize;
-
- function Known_Normalized_First_Bit (E : Entity_Id) return B is
- begin
- return Normalized_First_Bit (E) /= No_Uint;
- end Known_Normalized_First_Bit;
-
- function Known_Normalized_Position (E : Entity_Id) return B is
- begin
- return Normalized_Position (E) /= No_Uint;
- end Known_Normalized_Position;
-
- function Known_Normalized_Position_Max (E : Entity_Id) return B is
- begin
- return Normalized_Position_Max (E) /= No_Uint;
- end Known_Normalized_Position_Max;
-
- function Known_RM_Size (E : Entity_Id) return B is
- begin
- return RM_Size (E) /= No_Uint
- and then (RM_Size (E) /= Uint_0
- or else Is_Discrete_Type (E)
- or else Is_Fixed_Point_Type (E));
- end Known_RM_Size;
-
- function Known_Static_Component_Bit_Offset (E : Entity_Id) return B is
- begin
- return Component_Bit_Offset (E) /= No_Uint
- and then Component_Bit_Offset (E) >= Uint_0;
- end Known_Static_Component_Bit_Offset;
-
- function Known_Static_Component_Size (E : Entity_Id) return B is
- begin
- return Component_Size (E) > Uint_0;
- end Known_Static_Component_Size;
-
- function Known_Static_Esize (E : Entity_Id) return B is
- begin
- return Esize (E) > Uint_0
- and then not Is_Generic_Type (E);
- end Known_Static_Esize;
-
- function Known_Static_Normalized_First_Bit (E : Entity_Id) return B is
- begin
- return Normalized_First_Bit (E) /= No_Uint
- and then Normalized_First_Bit (E) >= Uint_0;
- end Known_Static_Normalized_First_Bit;
-
- function Known_Static_Normalized_Position (E : Entity_Id) return B is
- begin
- return Normalized_Position (E) /= No_Uint
- and then Normalized_Position (E) >= Uint_0;
- end Known_Static_Normalized_Position;
-
- function Known_Static_Normalized_Position_Max (E : Entity_Id) return B is
- begin
- return Normalized_Position_Max (E) /= No_Uint
- and then Normalized_Position_Max (E) >= Uint_0;
- end Known_Static_Normalized_Position_Max;
-
- function Known_Static_RM_Size (E : Entity_Id) return B is
- begin
- return (RM_Size (E) > Uint_0
- or else Is_Discrete_Type (E)
- or else Is_Fixed_Point_Type (E))
- and then not Is_Generic_Type (E);
- end Known_Static_RM_Size;
+ Reinit_Esize (Id);
+ Reinit_RM_Size (Id);
+ Reinit_Alignment (Id);
+ end Reinit_Size_Align;
--------------------
-- Address_Clause --
pragma Inline (Type_High_Bound);
pragma Inline (Type_Low_Bound);
- ----------------------------------------------
- -- Type Representation Attribute Predicates --
- ----------------------------------------------
-
- -- These predicates test the setting of the indicated attribute. The
- -- Known predicate is True if and only if the value has been set. The
- -- Known_Static predicate is True only if the value is set (Known) and is
- -- set to a compile time known value. Note that in the case of Alignment
- -- and Normalized_First_Bit, dynamic values are not possible, so we do not
- -- need a separate Known_Static calls in these cases. The not set (unknown)
- -- values are as follows:
-
- -- Alignment Uint_0 or No_Uint
- -- Component_Size Uint_0 or No_Uint
- -- Component_Bit_Offset No_Uint
- -- Digits_Value Uint_0 or No_Uint
- -- Esize Uint_0 or No_Uint
- -- Normalized_First_Bit No_Uint
- -- Normalized_Position No_Uint
- -- Normalized_Position_Max No_Uint
- -- RM_Size Uint_0 or No_Uint
-
- -- It would be cleaner to use No_Uint in all these cases, but historically
- -- we chose to use Uint_0 at first, and the change over will take time ???
- -- This is particularly true for the RM_Size field, where a value of zero
- -- is legitimate. We deal with this by a considering that the value is
- -- always known static for discrete types (and no other types can have
- -- an RM_Size value of zero).
-
+ ------------------------------------------
+ -- Type Representation Attribute Fields --
+ ------------------------------------------
+
+ -- Each of the following fields can be in a "known" or "unknown" state:
+
+ -- Alignment
+ -- Component_Size
+ -- Component_Bit_Offset
+ -- Digits_Value
+ -- Esize
+ -- Normalized_First_Bit
+ -- Normalized_Position
+ -- RM_Size
+ --
+ -- NOTE: "known" here does not mean "known at compile time". It means that
+ -- the compiler has computed the value of the field (either by default, or
+ -- by noting some representation clauses), and the field has not been
+ -- reinitialized.
+ --
+ -- We document the Esize functions here; the others are analogous:
+ --
+ -- Known_Esize: True if Set_Esize has been called without a subsequent
+ -- Reinit_Esize.
+ --
+ -- Known_Static_Esize: True if Known_Esize and the Esize is known at
+ -- compile time. (We're not using "static" in the Ada RM sense here. We
+ -- are using it to mean "known at compile time.)
+ --
+ -- Reinit_Esize: Set the Esize field to its initial unknown state.
+ --
+ -- Copy_Esize: Copies the Esize from From to To; Known_Esize (From) may
+ -- be False, in which case Known_Esize (To) becomes False.
+ --
+ -- Esize: This is the normal automatially-generated getter for Esize,
+ -- declared elsewhere. It is an error to call this if Set_Esize has not
+ -- yet been called, or if Reinit_Esize has been called subsequently.
+ --
+ -- Set_Esize: This is the normal automatially-generated setter for
+ -- Esize. After a call to this, Known_Esize is True. It is an error
+ -- to call this with a No_Uint value.
+ --
+ -- Normally, we call Set_Esize first, and then query Esize (and similarly
+ -- for other fields). However in some cases, we need to check Known_Esize
+ -- before calling Esize, because the code is written in such a way that we
+ -- don't know whether Set_Esize has already been called.
+ --
+ -- We intend to use the initial zero value to represent "unknown". Note
+ -- that this value is different from No_Uint, and different from Uint_0.
+ -- However, this is work in progress; we are still using No_Uint or Uint_0
+ -- to represent "unknown" in some cases. Using Uint_0 leads to several
+ -- bugs, because zero is a legitimate value (T'Size can be zero bits) --
+ -- Uint_0 shouldn't mean two different things.
+ --
-- In two cases, Known_Static_Esize and Known_Static_RM_Size, there is one
-- more consideration, which is that we always return False for generic
- -- types. Within a template, the size can look known, because of the fake
- -- size values we put in template types, but they are not really known and
- -- anyone testing if they are known within the template should get False as
- -- a result to prevent incorrect assumptions.
-
- function Known_Alignment (E : Entity_Id) return B;
- function Known_Component_Bit_Offset (E : Entity_Id) return B;
- function Known_Component_Size (E : Entity_Id) return B;
- function Known_Esize (E : Entity_Id) return B;
- function Known_Normalized_First_Bit (E : Entity_Id) return B;
- function Known_Normalized_Position (E : Entity_Id) return B;
- function Known_Normalized_Position_Max (E : Entity_Id) return B;
- function Known_RM_Size (E : Entity_Id) return B;
-
- function Known_Static_Component_Bit_Offset (E : Entity_Id) return B;
- function Known_Static_Component_Size (E : Entity_Id) return B;
- function Known_Static_Esize (E : Entity_Id) return B;
- function Known_Static_Normalized_First_Bit (E : Entity_Id) return B;
- function Known_Static_Normalized_Position (E : Entity_Id) return B;
- function Known_Static_Normalized_Position_Max (E : Entity_Id) return B;
- function Known_Static_RM_Size (E : Entity_Id) return B;
-
- pragma Inline (Known_Alignment);
- pragma Inline (Known_Component_Bit_Offset);
- pragma Inline (Known_Component_Size);
- pragma Inline (Known_Esize);
- pragma Inline (Known_Normalized_First_Bit);
- pragma Inline (Known_Normalized_Position);
- pragma Inline (Known_Normalized_Position_Max);
- pragma Inline (Known_RM_Size);
-
- pragma Inline (Known_Static_Component_Bit_Offset);
- pragma Inline (Known_Static_Component_Size);
- pragma Inline (Known_Static_Esize);
- pragma Inline (Known_Static_Normalized_First_Bit);
- pragma Inline (Known_Static_Normalized_Position);
- pragma Inline (Known_Static_Normalized_Position_Max);
- pragma Inline (Known_Static_RM_Size);
+ -- types. Within a template, the size can look Known_Static, because of the
+ -- fake size values we put in template types, but they are not really
+ -- Known_Static and anyone testing if they are Known_Static within the
+ -- template should get False as a result to prevent incorrect assumptions.
+
+ function Known_Alignment (E : Entity_Id) return B with Inline;
+ procedure Reinit_Alignment (Id : E) with Inline;
+ procedure Copy_Alignment (To, From : E);
+
+ function Known_Component_Bit_Offset (E : Entity_Id) return B with Inline;
+ function Known_Static_Component_Bit_Offset (E : Entity_Id) return B
+ with Inline;
+
+ function Known_Component_Size (E : Entity_Id) return B with Inline;
+ function Known_Static_Component_Size (E : Entity_Id) return B with Inline;
+
+ function Known_Esize (E : Entity_Id) return B with Inline;
+ function Known_Static_Esize (E : Entity_Id) return B with Inline;
+ procedure Reinit_Esize (Id : E) with Inline;
+ procedure Copy_Esize (To, From : E);
+
+ function Known_Normalized_First_Bit (E : Entity_Id) return B with Inline;
+ function Known_Static_Normalized_First_Bit (E : Entity_Id) return B
+ with Inline;
+
+ function Known_Normalized_Position (E : Entity_Id) return B with Inline;
+ function Known_Static_Normalized_Position (E : Entity_Id) return B
+ with Inline;
+
+ function Known_RM_Size (E : Entity_Id) return B with Inline;
+ function Known_Static_RM_Size (E : Entity_Id) return B with Inline;
+ procedure Reinit_RM_Size (Id : E) with Inline;
+ procedure Copy_RM_Size (To, From : E);
+
+ ---------------------------------------------------------
+ -- Procedures for setting multiple of the above fields --
+ ---------------------------------------------------------
+
+ procedure Reinit_Component_Location (Id : E);
+ -- Initializes all fields describing the location of a component
+ -- (Normalized_Position, Component_Bit_Offset, Normalized_First_Bit,
+ -- Esize) to all be Unknown.
+
+ procedure Init_Size (Id : E; V : Int);
+ -- Initialize both the Esize and RM_Size fields of E to V
+
+ procedure Reinit_Size_Align (Id : E);
+ -- This procedure initializes both size fields and the alignment
+ -- field to all be Unknown.
+
+ procedure Reinit_Object_Size_Align (Id : E);
+ -- Same as Reinit_Size_Align except RM_Size field (which is only for types)
+ -- is unaffected.
---------------------------------------------------
-- Access to Subprograms in Subprograms_For_Type --
procedure Set_Predicate_Function (Id : E; V : E);
procedure Set_Predicate_Function_M (Id : E; V : E);
- -----------------------------------
- -- Field Initialization Routines --
- -----------------------------------
-
- -- These routines are overloadings of some of the above Set procedures
- -- where the argument is normally a Uint. The overloadings take an Int
- -- parameter instead, and appropriately convert it. There are also
- -- versions that implicitly initialize to the appropriate "not set"
- -- value. The not set (unknown) values are as follows:
-
- -- Alignment Uint_0
- -- Component_Size Uint_0
- -- Component_Bit_Offset No_Uint
- -- Digits_Value Uint_0
- -- Esize Uint_0
- -- Normalized_First_Bit No_Uint
- -- Normalized_Position No_Uint
- -- Normalized_Position_Max No_Uint
- -- RM_Size Uint_0
-
- -- It would be cleaner to use No_Uint in all these cases, but historically
- -- we chose to use Uint_0 at first, and the change over will take time ???
- -- This is particularly true for the RM_Size field, where a value of zero
- -- is legitimate and causes some special tests around the code.
-
- -- Contrary to the corresponding Set procedures above, these routines
- -- do NOT check the entity kind of their argument, instead they set the
- -- underlying Uint fields directly (this allows them to be used for
- -- entities whose Ekind has not been set yet).
-
- procedure Init_Alignment (Id : E; V : Int);
- procedure Init_Component_Bit_Offset (Id : E; V : Int);
- procedure Init_Component_Size (Id : E; V : Int);
- procedure Init_Digits_Value (Id : E; V : Int);
- procedure Init_Esize (Id : E; V : Int);
- procedure Init_Normalized_First_Bit (Id : E; V : Int);
- procedure Init_Normalized_Position (Id : E; V : Int);
- procedure Init_Normalized_Position_Max (Id : E; V : Int);
- procedure Init_RM_Size (Id : E; V : Int);
-
- procedure Init_Alignment (Id : E);
- procedure Init_Component_Bit_Offset (Id : E);
- procedure Init_Component_Size (Id : E);
- procedure Init_Digits_Value (Id : E);
- procedure Init_Esize (Id : E);
- procedure Init_Normalized_First_Bit (Id : E);
- procedure Init_Normalized_Position (Id : E);
- procedure Init_Normalized_Position_Max (Id : E);
- procedure Init_RM_Size (Id : E);
-
- -- The following Copy_xxx procedures copy the value of xxx from From to
- -- To. If xxx is set to its initial invalid (zero-bits) value, then it is
- -- reset to invalid in To. We only have Copy_Alignment so far, but more are
- -- planned.
-
- procedure Copy_Alignment (To, From : E);
-
- pragma Inline (Init_Alignment);
- pragma Inline (Init_Component_Bit_Offset);
- pragma Inline (Init_Component_Size);
- pragma Inline (Init_Digits_Value);
- pragma Inline (Init_Esize);
- pragma Inline (Init_Normalized_First_Bit);
- pragma Inline (Init_Normalized_Position);
- pragma Inline (Init_Normalized_Position_Max);
- pragma Inline (Init_RM_Size);
-
- procedure Init_Component_Location (Id : E);
- -- Initializes all fields describing the location of a component
- -- (Normalized_Position, Component_Bit_Offset, Normalized_First_Bit,
- -- Normalized_Position_Max, Esize) to all be Unknown.
-
- procedure Init_Size (Id : E; V : Int);
- -- Initialize both the Esize and RM_Size fields of E to V
-
- procedure Init_Size_Align (Id : E);
- -- This procedure initializes both size fields and the alignment
- -- field to all be Unknown.
-
- procedure Init_Object_Size_Align (Id : E);
- -- Same as Init_Size_Align except RM_Size field (which is only for types)
- -- is unaffected.
-
---------------
-- Iterators --
---------------
-- units from the start of the record to the lowest addressed storage
-- unit containing part or all of the field.
--- Normalized_Position_Max
--- Defined in components and discriminants. For almost all cases, this
--- is the same as Normalized_Position. The one exception is for the case
--- of a discriminated record containing one or more arrays whose length
--- depends on discriminants. In this case, the Normalized_Position_Max
--- field represents the maximum possible value of Normalized_Position
--- assuming min/max values for discriminant subscripts in all fields.
--- This is used by Layout in front end layout mode to properly compute
--- the maximum size of such records (needed for allocation purposes when
--- there are default discriminants, and also for the 'Size value).
-
-- Number_Dimensions (synthesized)
-- Applies to array types and subtypes. Returns the number of dimensions
-- of the array type or subtype as a value of type Pos.
-- Linker_Section_Pragma $$$
-- Normalized_First_Bit
-- Current_Value (always Empty)
- -- Normalized_Position_Max
-- Component_Bit_Offset
-- Esize
-- Component_Clause
-- E_Discriminant
-- Normalized_First_Bit
-- Current_Value (always Empty)
- -- Normalized_Position_Max
-- Component_Bit_Offset
-- Esize
-- Component_Clause
-- Set remaining fields of packed array type
- Init_Alignment (PAT);
+ Reinit_Alignment (PAT);
Set_Parent (PAT, Empty);
Set_Associated_Node_For_Itype (PAT, Typ);
Set_Original_Array_Type (PAT, Typ);
#define Known_RM_Size einfo__utils__known_rm_size
B Known_RM_Size (Entity_Id E);
-#define Known_Static_Component_Bit_Offset einfo__utils__known_static_component_bit_offset
-B Known_Static_Component_Bit_Offset (Entity_Id E);
-
-#define Known_Static_Component_Size einfo__utils__known_static_component_size
-B Known_Static_Component_Size (Entity_Id E);
-
-#define Known_Static_Esize einfo__utils__known_static_esize
-B Known_Static_Esize (Entity_Id E);
-
-#define Known_Static_Normalized_First_Bit einfo__utils__known_static_normalized_first_bit
-B Known_Static_Normalized_First_Bit (Entity_Id E);
-
-#define Known_Static_Normalized_Position einfo__utils__known_static_normalized_position
-B Known_Static_Normalized_Position (Entity_Id E);
-
-#define Known_Static_Normalized_Position_Max einfo__utils__known_static_normalized_position_max
-B Known_Static_Normalized_Position_Max (Entity_Id E);
-
-#define Known_Static_RM_Size einfo__utils__known_static_rm_size
-B Known_Static_RM_Size (Entity_Id E);
-
#define Copy_Alignment einfo__utils__copy_alignment
B Copy_Alignment(Entity_Id To, Entity_Id From);
and then not Target_Short_Enums
then
- Init_Esize (Typ, Standard_Integer_Size);
+ Set_Esize (Typ, UI_From_Int (Standard_Integer_Size));
Set_Alignment (Typ, Alignment (Standard_Integer));
-- Normal Ada case or size clause present or not Long_C_Enums on target
Actual_Size := 128;
end if;
- Init_Esize (Typ, Actual_Size);
+ Set_Esize (Typ, UI_From_Int (Actual_Size));
Adjust_Esize_For_Alignment (Typ);
end if;
-- Set Esize to calculated size if not set already
if not Known_Esize (Typ) then
- Init_Esize (Typ, Actual_Size);
+ Set_Esize (Typ, UI_From_Int (Actual_Size));
end if;
-- Set RM_Size if not already set. If already set, check value
Nonzero_Is_True,
Normalized_First_Bit,
Normalized_Position,
- Normalized_Position_Max,
OK_To_Rename,
Optimize_Alignment_Space,
Optimize_Alignment_Time,
Sm (Interface_Name, Node_Id),
Sm (Normalized_First_Bit, Uint),
Sm (Normalized_Position, Uint),
- Sm (Normalized_Position_Max, Uint),
Sm (Original_Record_Component, Node_Id)));
Cc (E_Component, Record_Field_Kind,
end if;
-- Make sure Esize (Typ) was properly initialized, it should be since
- -- New_Internal_Entity/New_External_Entity call Init_Size_Align.
+ -- New_Internal_Entity/New_External_Entity call Reinit_Size_Align.
pragma Assert (Esize (Typ) = Uint_0);
exit when Esize (E) mod Abits = 0;
end loop;
- Init_Alignment (E, Abits / SSU);
+ Set_Alignment (E, UI_From_Int (Abits / SSU));
return;
end if;
-- like or need the size to be set.
if Ekind (E) = E_String_Literal_Subtype then
- Set_Esize (E, Uint_0);
- Set_RM_Size (E, Uint_0);
+ Reinit_Esize (E);
+ Reinit_RM_Size (E);
return;
end if;
-- If size is big enough, set it and exit
if S >= RM_Size (E) then
- Init_Esize (E, S);
+ Set_Esize (E, UI_From_Int (S));
exit;
-- If the RM_Size is greater than System_Max_Integer_Size
if Is_Scalar_Type (E) then
if Size <= SSU then
- Init_Esize (E, SSU);
+ Set_Esize (E, UI_From_Int (SSU));
elsif Size <= 16 then
- Init_Esize (E, 16);
+ Set_Esize (E, Uint_16);
elsif Size <= 32 then
- Init_Esize (E, 32);
+ Set_Esize (E, Uint_32);
else
- Set_Esize (E, (Size + 63) / 64 * 64);
+ Set_Esize (E, (Size + 63) / 64 * 64);
end if;
-- Finally, make sure that alignment is consistent with
-- nothing to do with code.
if Is_Generic_Type (Root_Type (FST)) then
- Set_RM_Size (Def_Id, Uint_0);
+ Reinit_RM_Size (Def_Id);
-- If the subtype statically matches the first subtype, then it is
-- required to have exactly the same layout. This is required by
-- this new calculated value.
if not Known_Alignment (E) then
- Init_Alignment (E, A);
+ Set_Alignment (E, UI_From_Int (A));
-- Cases where we have inherited an alignment
-- sure that no constructed types have weird alignments.
elsif not Comes_From_Source (E) then
- Init_Alignment (E, A);
+ Set_Alignment (E, UI_From_Int (A));
-- If this inherited alignment is the same as the one we computed,
-- then obviously everything is fine, and we do not need to reset it.
-- ACATS problem which seems to have disappeared anyway, and
-- in any case, this peculiarity was never documented.
- Init_Alignment (E, A);
+ Set_Alignment (E, UI_From_Int (A));
-- If no Size (or Object_Size) was specified, then we have
-- inherited the object size, so we should also inherit the
Set_Is_First_Subtype (Ent);
Set_Scope (Ent, Scop);
Set_Stored_Constraint (Ent, No_Elist);
- Init_Size_Align (Ent);
+ Reinit_Size_Align (Ent);
if From_Limited_With (Ent) then
Set_Private_Dependents (Ent, New_Elmt_List);
Set_Is_Tagged_Type (CW_Typ);
Set_Materialize_Entity (CW_Typ, Materialize);
Set_Scope (CW_Typ, Scop);
- Init_Size_Align (CW_Typ);
+ Reinit_Size_Align (CW_Typ);
end if;
end Decorate_Type;
Mutate_Ekind (T, E_Enumeration_Subtype);
Set_Etype (T, Base);
Init_Size (T, 8);
- Init_Alignment (T);
+ Reinit_Alignment (T);
Set_Is_Generic_Type (T);
Set_Is_Constrained (T);
Mutate_Ekind (Base, E_Enumeration_Type);
Set_Etype (Base, Base);
Init_Size (Base, 8);
- Init_Alignment (Base);
+ Reinit_Alignment (Base);
Set_Is_Generic_Type (Base);
Set_Scalar_Range (Base, Scalar_Range (T));
Set_Parent (Base, Parent (Def));
and then not Has_Alignment_Clause (Typ)
and then Size mod (Alignment (Typ) * SSU) /= 0
then
- Init_Alignment (Typ);
+ Reinit_Alignment (Typ);
end if;
end Alignment_Check_For_Size_Change;
Analyze (Decl, Suppress => All_Checks);
Set_Has_Delayed_Freeze (New_Ctyp, False);
- Init_Esize (New_Ctyp);
+ Reinit_Esize (New_Ctyp);
Set_RM_Size (New_Ctyp, Csize);
- Init_Alignment (New_Ctyp);
+ Reinit_Alignment (New_Ctyp);
Set_Is_Itype (New_Ctyp, True);
Set_Associated_Node_For_Itype (New_Ctyp, U_Ent);
if Is_First_Subtype (U_Ent) then
if Is_Elementary_Type (U_Ent) then
if Size <= System_Storage_Unit then
- Init_Esize (U_Ent, System_Storage_Unit);
+ Set_Esize
+ (U_Ent, UI_From_Int (System_Storage_Unit));
elsif Size <= 16 then
- Init_Esize (U_Ent, 16);
+ Set_Esize (U_Ent, Uint_16);
elsif Size <= 32 then
- Init_Esize (U_Ent, 32);
+ Set_Esize (U_Ent, Uint_32);
else
- Set_Esize (U_Ent, (Size + 63) / 64 * 64);
+ Set_Esize (U_Ent, (Size + 63) / 64 * 64);
end if;
Alignment_Check_For_Size_Change
Set_Normalized_First_Bit (Comp, Fbit mod SSU);
Set_Normalized_Position (Comp, Fbit / SSU);
- Set_Normalized_Position_Max
- (Comp, Normalized_Position (Comp));
-
if Warn_On_Overridden_Size
and then Has_Size_Clause (Etype (Comp))
and then RM_Size (Etype (Comp)) /= Esize (Comp)
Set_Normalized_First_Bit (Ocomp, Fbit mod SSU);
Set_Normalized_Position (Ocomp, Fbit / SSU);
- Set_Normalized_Position_Max
- (Ocomp, Normalized_Position (Ocomp));
-
-- Note: we don't use Set_Biased here, because we
-- already gave a warning above if needed, and we
-- would get a duplicate for the same name here.
Set_Component_Bit_Offset (Fent, Uint_0);
Set_Normalized_Position (Fent, Uint_0);
Set_Normalized_First_Bit (Fent, Uint_0);
- Set_Normalized_Position_Max (Fent, Uint_0);
- Init_Esize (Fent, System_Address_Size);
+ Set_Esize (Fent, UI_From_Int (System_Address_Size));
Set_Component_Clause (Fent,
Make_Component_Clause (Loc,
procedure Set_Enum_Esize (T : Entity_Id) is
Lo : Uint;
Hi : Uint;
- Sz : Nat;
+ Sz : Unat;
begin
- Init_Alignment (T);
+ Reinit_Alignment (T);
-- Find the minimum standard size (8,16,32,64,128) that fits
Hi := Enumeration_Rep (Entity (Type_High_Bound (T)));
if Lo < 0 then
- if Lo >= -Uint_2**07 and then Hi < Uint_2**07 then
- Sz := Standard_Character_Size; -- May be > 8 on some targets
+ if Lo >= -Uint_2**7 and then Hi < Uint_2**7 then
+ Sz := UI_From_Int (Standard_Character_Size);
+ -- Might be > 8 on some targets
elsif Lo >= -Uint_2**15 and then Hi < Uint_2**15 then
- Sz := 16;
+ Sz := Uint_16;
elsif Lo >= -Uint_2**31 and then Hi < Uint_2**31 then
- Sz := 32;
+ Sz := Uint_32;
elsif Lo >= -Uint_2**63 and then Hi < Uint_2**63 then
- Sz := 64;
+ Sz := Uint_64;
else pragma Assert (Lo >= -Uint_2**127 and then Hi < Uint_2**127);
- Sz := 128;
+ Sz := Uint_128;
end if;
else
- if Hi < Uint_2**08 then
- Sz := Standard_Character_Size; -- May be > 8 on some targets
+ if Hi < Uint_2**8 then
+ Sz := UI_From_Int (Standard_Character_Size);
elsif Hi < Uint_2**16 then
- Sz := 16;
+ Sz := Uint_16;
elsif Hi < Uint_2**32 then
- Sz := 32;
+ Sz := Uint_32;
elsif Hi < Uint_2**64 then
- Sz := 64;
+ Sz := Uint_64;
else pragma Assert (Hi < Uint_2**128);
- Sz := 128;
+ Sz := Uint_128;
end if;
end if;
and then not Target_Short_Enums
then
- Init_Esize (T, Standard_Integer_Size);
+ Set_Esize (T, UI_From_Int (Standard_Integer_Size));
else
- Init_Esize (T, Sz);
+ Set_Esize (T, Sz);
end if;
end Set_Enum_Esize;
Set_Can_Use_Internal_Rep (T_Name,
not Always_Compatible_Rep_On_Target);
Set_Etype (T_Name, T_Name);
- Init_Size_Align (T_Name);
+ Reinit_Size_Align (T_Name);
Set_Directly_Designated_Type (T_Name, Desig_Type);
-- If the access_to_subprogram is not declared at the library level,
-- and the pointer size is already set. Else, initialize.
if not From_Limited_With (T) then
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
end if;
-- Note that Has_Task is always false, since the access type itself
Set_Is_Aliased (Tag);
Set_Is_Independent (Tag);
Set_Related_Type (Tag, Iface);
- Init_Component_Location (Tag);
+ Reinit_Component_Location (Tag);
pragma Assert (Is_Frozen (Iface));
Set_Is_Aliased (Offset);
Set_Is_Independent (Offset);
Set_Related_Type (Offset, Iface);
- Init_Component_Location (Offset);
+ Reinit_Component_Location (Offset);
Insert_After (Last_Tag, Decl);
Last_Tag := Decl;
end if;
Mutate_Ekind (T, E_Incomplete_Type);
Set_Etype (T, T);
Set_Is_First_Subtype (T);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
-- Set the SPARK mode from the current context
-- Initialize alignment and size and capture alignment setting
- Init_Alignment (Id);
- Init_Esize (Id);
+ Reinit_Alignment (Id);
+ Reinit_Esize (Id);
Set_Optimize_Alignment_Flags (Id);
-- Deal with aliased case
Set_Is_Pure (T, Is_Pure (Current_Scope));
Set_Scope (T, Current_Scope);
Mutate_Ekind (T, E_Record_Type_With_Private);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Default_SSO (T);
Set_No_Reordering (T, No_Component_Reordering);
begin
Generate_Definition (Id);
Set_Is_Pure (Id, Is_Pure (Current_Scope));
- Init_Size_Align (Id);
+ Reinit_Size_Align (Id);
-- The following guard condition on Enter_Name is to handle cases where
-- the defining identifier has already been entered into the scope but
-- The constrained array type is a subtype of the unconstrained one
Mutate_Ekind (T, E_Array_Subtype);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Etype (T, Implicit_Base);
Set_Scope (T, Current_Scope);
Set_Is_Constrained (T);
end if;
Mutate_Ekind (T, E_Array_Type);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Etype (T, T);
Set_Scope (T, Current_Scope);
Set_Component_Size (T, Uint_0);
if Is_Tagged then
Set_Is_Tagged_Type (Derived_Type);
- Init_Size_Align (Derived_Type);
+ Reinit_Size_Align (Derived_Type);
end if;
-- STEP 0a: figure out what kind of derived type declaration we have
end if;
Set_Etype (Def_Id, T);
- Init_Size_Align (Def_Id);
+ Reinit_Size_Align (Def_Id);
Set_Has_Discriminants (Def_Id, Has_Discrs);
Set_Is_Constrained (Def_Id, Constrained);
-- Set remaining characterstics of anonymous access type
- Init_Alignment (Acc_Type);
+ Reinit_Alignment (Acc_Type);
Set_Directly_Designated_Type (Acc_Type, Derived_Type);
Set_Etype (New_Id, Acc_Type);
Siz := Siz * 2;
end loop;
- Init_Esize (T, Siz);
+ Set_Esize (T, UI_From_Int (Siz));
else
- Init_Esize (T, System_Max_Binary_Modulus_Power);
+ Set_Esize (T, UI_From_Int (System_Max_Binary_Modulus_Power));
end if;
if not Non_Binary_Modulus (T) and then Esize (T) = RM_Size (T) then
Set_Etype (T, T);
Mutate_Ekind (T, E_Modular_Integer_Type);
- Init_Alignment (T);
+ Reinit_Alignment (T);
Set_Is_Constrained (T);
if not Is_OK_Static_Expression (Mod_Expr) then
Error_Msg_F ("modulus exceeds limit (2 '*'*^)", Mod_Expr);
Set_Modular_Size (System_Max_Binary_Modulus_Power);
- Init_Alignment (T);
+ Reinit_Alignment (T);
end Modular_Type_Declaration;
Mutate_Ekind (T, E_Ordinary_Fixed_Point_Subtype);
Set_Etype (T, Implicit_Base);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Inherit_Rep_Item_Chain (T, Implicit_Base);
Set_Small_Value (T, Small_Val);
Set_Delta_Value (T, Delta_Val);
end if;
Mutate_Ekind (Id, E_Discriminant);
- Init_Component_Location (Id);
- Init_Esize (Id);
+ Reinit_Component_Location (Id);
+ Reinit_Esize (Id);
Set_Discriminant_Number (Id, Discr_Number);
-- Make sure this is always set, even in illegal programs
Mutate_Ekind (T, E_Record_Type);
Set_Etype (T, T);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Interfaces (T, No_Elist);
Set_Stored_Constraint (T, No_Elist);
Set_Default_SSO (T);
Set_Etype (Tag_Comp, RTE (RE_Tag));
Set_DT_Entry_Count (Tag_Comp, No_Uint);
Set_Original_Record_Component (Tag_Comp, Tag_Comp);
- Init_Component_Location (Tag_Comp);
+ Reinit_Component_Location (Tag_Comp);
-- Ada 2005 (AI-251): Addition of the Tag corresponding to all the
-- implemented interfaces.
and then not Is_Itype (Component)
then
Mutate_Ekind (Component, E_Component);
- Init_Component_Location (Component);
+ Reinit_Component_Location (Component);
end if;
Propagate_Concurrent_Flags (T, Etype (Component));
begin
Generate_Definition (Id);
Set_Is_Pure (Id, PF);
- Init_Size_Align (Id);
+ Reinit_Size_Align (Id);
if not Is_Package_Or_Generic_Package (Current_Scope)
or else In_Private_Part (Current_Scope)
Set_Etype (Id, Id);
Set_Has_Delayed_Freeze (Id);
Set_Is_First_Subtype (Id);
- Init_Size_Align (Id);
+ Reinit_Size_Align (Id);
Set_Is_Constrained (Id,
No (Discriminant_Specifications (N))
Mutate_Ekind (Id, E_Variable);
end if;
- Init_Object_Size_Align (Id);
+ Reinit_Object_Size_Align (Id);
-- If N comes from source then check that the original node is an
-- object reference since there may have been several rewritting and
Mutate_Ekind (T, E_Protected_Type);
Set_Is_First_Subtype (T);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Etype (T, T);
Set_Has_Delayed_Freeze (T);
Set_Stored_Constraint (T, No_Elist);
while Present (E) loop
if Ekind (E) = E_Void then
Mutate_Ekind (E, E_Component);
- Init_Component_Location (E);
+ Reinit_Component_Location (E);
end if;
Next_Entity (E);
Mutate_Ekind (T, E_Task_Type);
Set_Is_First_Subtype (T, True);
Set_Has_Task (T, True);
- Init_Size_Align (T);
+ Reinit_Size_Align (T);
Set_Etype (T, T);
Set_Has_Delayed_Freeze (T, True);
Set_Stored_Constraint (T, No_Elist);
end if;
if not Has_Alignment_Clause (Ent) then
- Init_Alignment (Ent);
+ Reinit_Alignment (Ent);
end if;
end Set_Atomic_VFA;
Set_Public_Status (N);
if Kind in Type_Kind then
- Init_Size_Align (N);
+ Reinit_Size_Align (N);
end if;
return N;
Append_Entity (N, Scope_Id);
if Kind in Type_Kind then
- Init_Size_Align (N);
+ Reinit_Size_Align (N);
end if;
return N;
-- This package contains constants describing target properties
-with Types; use Types;
+with Types; use Types;
with Set_Targ;
package Ttypes is
subtype Valid_Uint is Uint with Predicate => Valid_Uint /= No_Uint;
subtype Unat is Valid_Uint with Predicate => Unat >= Uint_0;
- subtype Upos is Valid_Uint with Predicate => Upos >= Uint_0;
+ subtype Upos is Valid_Uint with Predicate => Upos >= Uint_1;
subtype Nonzero_Uint is Valid_Uint with Predicate => Nonzero_Uint /= Uint_0;
type UI_Vector is array (Pos range <>) of Int;