and then not Is_Generic_Type (E);
end Known_Static_RM_Size;
- function Unknown_Alignment (E : Entity_Id) return B is
- begin
- return not Known_Alignment (E);
- end Unknown_Alignment;
-
- function Unknown_Component_Bit_Offset (E : Entity_Id) return B is
- begin
- return not Known_Component_Bit_Offset (E);
- end Unknown_Component_Bit_Offset;
-
- function Unknown_Component_Size (E : Entity_Id) return B is
- begin
- return not Known_Component_Size (E);
- end Unknown_Component_Size;
-
- function Unknown_Esize (E : Entity_Id) return B is
- begin
- return not Known_Esize (E);
- end Unknown_Esize;
-
- function Unknown_Normalized_First_Bit (E : Entity_Id) return B is
- begin
- return not Known_Normalized_First_Bit (E);
- end Unknown_Normalized_First_Bit;
-
- function Unknown_Normalized_Position (E : Entity_Id) return B is
- begin
- return not Known_Normalized_Position (E);
- end Unknown_Normalized_Position;
-
- function Unknown_Normalized_Position_Max (E : Entity_Id) return B is
- begin
- return not Known_Normalized_Position_Max (E);
- end Unknown_Normalized_Position_Max;
-
- function Unknown_RM_Size (E : Entity_Id) return B is
- begin
- return not Known_RM_Size (E);
- end Unknown_RM_Size;
-
--------------------
-- Address_Clause --
--------------------
-- Type Representation Attribute Predicates --
----------------------------------------------
- -- These predicates test the setting of the indicated attribute. If the
- -- value has been set, then Known is True, and Unknown is False. If no
- -- value is set, then Known is False and Unknown is True. 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
+ -- 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:
function Known_Static_Normalized_Position_Max (E : Entity_Id) return B;
function Known_Static_RM_Size (E : Entity_Id) return B;
- function Unknown_Alignment (E : Entity_Id) return B;
- function Unknown_Component_Bit_Offset (E : Entity_Id) return B;
- function Unknown_Component_Size (E : Entity_Id) return B;
- function Unknown_Esize (E : Entity_Id) return B;
- function Unknown_Normalized_First_Bit (E : Entity_Id) return B;
- function Unknown_Normalized_Position (E : Entity_Id) return B;
- function Unknown_Normalized_Position_Max (E : Entity_Id) return B;
- function Unknown_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_Static_Normalized_Position_Max);
pragma Inline (Known_Static_RM_Size);
- pragma Inline (Unknown_Alignment);
- pragma Inline (Unknown_Component_Bit_Offset);
- pragma Inline (Unknown_Component_Size);
- pragma Inline (Unknown_Esize);
- pragma Inline (Unknown_Normalized_First_Bit);
- pragma Inline (Unknown_Normalized_Position);
- pragma Inline (Unknown_Normalized_Position_Max);
- pragma Inline (Unknown_RM_Size);
-
---------------------------------------------------
-- Access to Subprograms in Subprograms_For_Type --
---------------------------------------------------
-- Do not reset RM_Size if already set, as happens in the case of
-- a modular type.
- if Unknown_Esize (PAT) then
+ if not Known_Esize (PAT) then
Set_Esize (PAT, PASize);
end if;
- if Unknown_RM_Size (PAT) then
+ if not Known_RM_Size (PAT) then
Set_RM_Size (PAT, PASize);
end if;
if Target_Strict_Alignment
and then Known_Alignment (Ptyp)
- and then (Unknown_Alignment (Styp)
+ and then (not Known_Alignment (Styp)
or else Alignment (Styp) > Alignment (Ptyp))
then
return True;
begin
if Present (Component_Clause (Field))
and then
- (Unknown_Alignment (Styp)
+ (not Known_Alignment (Styp)
or else
(Component_Bit_Offset (Field) mod
(System_Storage_Unit * Alignment (Styp))) /= 0)
#define Known_Static_RM_Size einfo__utils__known_static_rm_size
B Known_Static_RM_Size (Entity_Id E);
-#define Unknown_Alignment einfo__utils__unknown_alignment
-B Unknown_Alignment (Entity_Id E);
-
-#define Unknown_Component_Bit_Offset einfo__utils__unknown_component_bit_offset
-B Unknown_Component_Bit_Offset (Entity_Id E);
-
-#define Unknown_Component_Size einfo__utils__unknown_component_size
-B Unknown_Component_Size (Entity_Id E);
-
-#define Unknown_Esize einfo__utils__unknown_esize
-B Unknown_Esize (Entity_Id E);
-
-#define Unknown_Normalized_First_Bit einfo__utils__unknown_normalized_first_bit
-B Unknown_Normalized_First_Bit (Entity_Id E);
-
-#define Unknown_Normalized_Position einfo__utils__unknown_normalized_position
-B Unknown_Normalized_Position (Entity_Id E);
-
-#define Unknown_Normalized_Position_Max einfo__utils__unknown_normalized_position_max
-B Unknown_Normalized_Position_Max (Entity_Id E);
-
-#define Unknown_RM_Size einfo__utils__unknown_rm_size
-B Unknown_RM_Size (Entity_Id E);
-
#define Is_Discrete_Or_Fixed_Point_Type einfo__utils__is_discrete_or_fixed_point_type
B Is_Discrete_Or_Fixed_Point_Type (E Id);
-- Set size if not set already
- elsif Unknown_RM_Size (T) then
+ elsif not Known_RM_Size (T) then
Set_RM_Size (T, S);
end if;
end Set_Small_Size;
if not Is_Constrained (T)
and then
No (Discriminant_Default_Value (First_Discriminant (T)))
- and then Unknown_RM_Size (T)
+ and then not Known_RM_Size (T)
then
return False;
end if;
else
-- Acquire alignment from base type
- if Unknown_Alignment (Arr) then
+ if not Known_Alignment (Arr) then
Set_Alignment (Arr, Alignment (Base_Type (Arr)));
Adjust_Esize_Alignment (Arr);
end if;
-- If Esize of a subtype has not previously been set, set it now
- if Unknown_Esize (Typ) then
+ if not Known_Esize (Typ) then
Atype := Ancestor_Subtype (Typ);
if Present (Atype) then
-- Set Esize to calculated size if not set already
- if Unknown_Esize (Typ) then
+ if not Known_Esize (Typ) then
Init_Esize (Typ, Actual_Size);
end if;
/* The RM size must be specified for all discrete and fixed-point types. */
gcc_assert (!(Is_In_Discrete_Or_Fixed_Point_Kind (kind)
- && Unknown_RM_Size (gnat_entity)));
+ && !Known_RM_Size (gnat_entity)));
/* If we get here, it means we have not yet done anything with this entity.
If we are not defining it, it must be a type or an entity that is defined
/* If Component_Size is not already specified, annotate it with the
size of the component. */
- if (Unknown_Component_Size (gnat_entity))
+ if (!Known_Component_Size (gnat_entity))
Set_Component_Size (gnat_entity,
annotate_value (TYPE_SIZE (comp_type)));
set_rm_size (RM_Size (gnat_entity), gnu_type, gnat_entity);
/* Back-annotate the alignment of the type if not already set. */
- if (Unknown_Alignment (gnat_entity))
+ if (!Known_Alignment (gnat_entity))
{
unsigned int double_align, align;
bool is_capped_double, align_clause;
}
/* Likewise for the size, if any. */
- if (Unknown_Esize (gnat_entity) && TYPE_SIZE (gnu_type))
+ if (!Known_Esize (gnat_entity) && TYPE_SIZE (gnu_type))
{
tree gnu_size = TYPE_SIZE (gnu_type);
/* If there is neither size clause nor representation clause, the
sizes need to be adjusted. */
- if (Unknown_RM_Size (gnat_entity)
+ if (!Known_RM_Size (gnat_entity)
&& !VOID_TYPE_P (gnu_type)
&& (!TYPE_FIELDS (gnu_type)
|| integer_zerop (bit_position (TYPE_FIELDS (gnu_type)))))
Set_Esize (gnat_entity, annotate_value (gnu_size));
/* Tagged types are Strict_Alignment so RM_Size = Esize. */
- if (Unknown_RM_Size (gnat_entity))
+ if (!Known_RM_Size (gnat_entity))
Set_RM_Size (gnat_entity, Esize (gnat_entity));
}
}
/* Likewise for the RM size, if any. */
- if (Unknown_RM_Size (gnat_entity) && TYPE_SIZE (gnu_type))
+ if (!Known_RM_Size (gnat_entity) && TYPE_SIZE (gnu_type))
Set_RM_Size (gnat_entity, annotate_value (rm_size (gnu_type)));
/* If we are at global level, GCC applied variable_size to the size but
&& !TYPE_IS_DUMMY_P (TREE_TYPE (gnu_decl))
&& Present (gnat_annotate_type))
{
- if (Unknown_Alignment (gnat_entity))
+ if (!Known_Alignment (gnat_entity))
Set_Alignment (gnat_entity, Alignment (gnat_annotate_type));
- if (Unknown_Esize (gnat_entity))
+ if (!Known_Esize (gnat_entity))
Set_Esize (gnat_entity, Esize (gnat_annotate_type));
- if (Unknown_RM_Size (gnat_entity))
+ if (!Known_RM_Size (gnat_entity))
Set_RM_Size (gnat_entity, RM_Size (gnat_annotate_type));
}
gnu_type = TREE_TYPE (gnu_type);
}
- if (Unknown_Esize (gnat_entity))
+ if (!Known_Esize (gnat_entity))
{
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (gnu_type))
Set_Esize (gnat_entity, annotate_value (size));
}
- if (Unknown_Alignment (gnat_entity))
+ if (!Known_Alignment (gnat_entity))
Set_Alignment (gnat_entity,
UI_From_Int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
}
gnu_new = gnat_to_gnu_entity (full_view, NULL_TREE, true);
/* Propagate back-annotations from full view to partial view. */
- if (Unknown_Alignment (gnat_entity))
+ if (!Known_Alignment (gnat_entity))
Set_Alignment (gnat_entity, Alignment (full_view));
- if (Unknown_Esize (gnat_entity))
+ if (!Known_Esize (gnat_entity))
Set_Esize (gnat_entity, Esize (full_view));
- if (Unknown_RM_Size (gnat_entity))
+ if (!Known_RM_Size (gnat_entity))
Set_RM_Size (gnat_entity, RM_Size (full_view));
/* The above call may have defined this entity (the simplest example
begin
-- Nothing to do if size unknown
- if Unknown_Esize (E) then
+ if not Known_Esize (E) then
return;
end if;
-- Now we have the size set, it must be a multiple of the alignment
-- nothing more we can do here if the alignment is unknown here.
- if Unknown_Alignment (E) then
+ if not Known_Alignment (E) then
return;
end if;
-- it now to a copy of the Esize if the Esize is set.
else
- if Known_Esize (E) and then Unknown_RM_Size (E) then
+ if Known_Esize (E) and then not Known_RM_Size (E) then
Set_RM_Size (E, Esize (E));
end if;
end if;
PAT : constant Entity_Id := Packed_Array_Impl_Type (E);
begin
- if Unknown_Esize (E) then
+ if not Known_Esize (E) then
Set_Esize (E, Esize (PAT));
end if;
- if Unknown_RM_Size (E) then
+ if not Known_RM_Size (E) then
Set_RM_Size (E, RM_Size (PAT));
end if;
- if Unknown_Alignment (E) then
+ if not Known_Alignment (E) then
Set_Alignment (E, Alignment (PAT));
end if;
end;
-- gave up because, in this case, the object size is not a multiple
-- of the alignment and, therefore, cannot be the component size.
- if Ekind (E) = E_Array_Type and then Unknown_Component_Size (E) then
+ if Ekind (E) = E_Array_Type and then not Known_Component_Size (E) then
declare
CT : constant Entity_Id := Component_Type (E);
if Is_Array_Type (E)
and then not Is_Packed (E)
- and then Unknown_Alignment (E)
+ and then not Known_Alignment (E)
and then Known_Alignment (Component_Type (E))
and then Known_Static_Component_Size (E)
and then Known_Static_Esize (Component_Type (E))
-- explicitly by the user. In that case, also do not set
-- Esize.
- if Unknown_RM_Size (E) or else RM_Size (E) = Siz then
+ if not Known_RM_Size (E) or else RM_Size (E) = Siz then
Set_RM_Size (E, Siz);
- if Unknown_Esize (E) then
+ if not Known_Esize (E) then
Siz := ((Siz + (Abits - 1)) / Abits) * Abits;
Set_Esize (E, Siz);
end if;
-- arrays when passed to subprogram parameters (see special test
-- in Exp_Ch6.Expand_Actuals).
- if not Is_Packed (E) and then Unknown_Alignment (E) then
+ if not Is_Packed (E) and then not Known_Alignment (E) then
if Known_Static_Component_Size (E)
and then Component_Size (E) = 1
then
if Known_Static_Esize (E) then
Siz := Esize (E);
- elsif Unknown_Esize (E) and then Known_Static_RM_Size (E) then
+ elsif not Known_Esize (E) and then Known_Static_RM_Size (E) then
Siz := RM_Size (E);
else
return;
if Calign > Align
and then
- (Unknown_Esize (Comp)
+ (not Known_Esize (Comp)
or else (Known_Static_Esize (Comp)
and then
Esize (Comp) = Calign * SSU))
-- If alignment is currently not set, then we can safely set it to
-- this new calculated value.
- if Unknown_Alignment (E) then
+ if not Known_Alignment (E) then
Init_Alignment (E, A);
-- Cases where we have inherited an alignment
-- whose position is not specified have starting normalized
-- bit position of zero.
- if Unknown_Normalized_First_Bit (Comp)
+ if not Known_Normalized_First_Bit (Comp)
and then not Is_Packed (Ent)
then
Set_Normalized_First_Bit (Comp, Uint_0);
-- Complete annotation in case not done
- if Unknown_Normalized_First_Bit (Comp) then
+ if not Known_Normalized_First_Bit (Comp) then
Set_Normalized_Position (Comp, Npos);
Set_Normalized_First_Bit (Comp, Fbit);
end if;
-- No_Uint, not Uint_0. Really everyone should use No_Uint???
elsif List_Representation_Info < 3
- or else (Esize (Ent) /= Uint_0 and then Unknown_Esize (Ent))
+ or else (Esize (Ent) /= Uint_0 and then not Known_Esize (Ent))
then
Write_Unknown_Val;
-- length (it may for example be appropriate to round up the size
-- to some convenient boundary, based on alignment considerations, etc).
- if Unknown_RM_Size (Rectype)
+ if not Known_RM_Size (Rectype)
and then Hbit + 1 <= 32
and then not Strict_Alignment (Rectype)
then
Set_Etype (Derived_Type, Implicit_Base);
Set_Size_Info (Derived_Type, Parent_Type);
- if Unknown_RM_Size (Derived_Type) then
+ if not Known_RM_Size (Derived_Type) then
Set_RM_Size (Derived_Type, RM_Size (Parent_Type));
end if;
if Default = Known_Compatible
or else
(Etype (Obj) = Etype (Expr)
- and then (Unknown_Alignment (Obj)
+ and then (not Known_Alignment (Obj)
or else
Alignment (Obj) = Alignment (Etype (Obj))))
then
-- do it when there is an address clause since we can do more if the
-- alignment is known.
- if Unknown_Alignment (Obj) then
+ if not Known_Alignment (Obj) then
Set_Alignment (Obj, Alignment (Etype (Obj)));
end if;