function Known_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) /= Uint_0
- and then Component_Size (Implementation_Base_Type (E)) /= No_Uint;
+ 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
function Known_Static_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) > Uint_0;
+ return Component_Size (E) > Uint_0;
end Known_Static_Component_Size;
function Known_Static_Esize (E : Entity_Id) return B is
function Unknown_Component_Size (E : Entity_Id) return B is
begin
- return Component_Size (Implementation_Base_Type (E)) = Uint_0
- or else
- Component_Size (Implementation_Base_Type (E)) = No_Uint;
+ return not Known_Component_Size (E);
end Unknown_Component_Size;
function Unknown_Esize (E : Entity_Id) return B is
-- this field is always set. A negative value is used to represent
-- a value which is not known at compile time, and must be computed
-- at run-time (this happens if fields of a record have variable
--- lengths). See package Layout for details of these values.
+-- lengths). See package Repinfo for details of these values.
--
-- Note: Component_Bit_Offset is redundant with respect to the fields
-- Normalized_First_Bit and Normalized_Position, and could in principle
-- by the front end in package Layout, or by the backend. A negative
-- value is used to represent a value which is not known at compile
-- time, and must be computed at run-time (this happens if the type
--- of the component has a variable length size). See package Layout
--- for details of these values.
+-- of the component has a variable length size). See package Repinfo
+-- for details of these values. Component_Size can also be negative in
+-- an illegal program that says e.g. "for T'Component_Size use -8;".
-- Component_Type [implementation base type only]
-- Defined in array types and string types. References component type.
else
Size_Too_Small_Error (Asiz);
- Set_Esize (T, Asiz);
- Set_RM_Size (T, Asiz);
end if;
end;
if Siz < M then
Size_Too_Small_Error (M);
- Set_Esize (T, M);
- Set_RM_Size (T, M);
else
Biased := True;
end if;
-- set if the type is not currently biased, but biasing it is the only
-- way to meet the requirement. If the type is currently biased, then
-- this biased size is used in the initial check, and Biased is False.
- -- If the size is too small, and an error message is given, then both
- -- Esize and RM_Size are reset to the allowed minimum value in T.
+ -- For a Component_Size clause, T is the component type.
function Has_Compatible_Representation
(Target_Type, Operand_Type : Entity_Id) return Boolean;