static void rest_of_type_decl_compilation_no_defer (tree);
\f
/* Given GNAT_ENTITY, a GNAT defining identifier node, which denotes some Ada
- entity, this routine returns the equivalent GCC tree for that entity
- (an ..._DECL node) and associates the ..._DECL node with the input GNAT
- defining identifier.
+ entity, return the equivalent GCC tree for that entity (a ..._DECL node)
+ and associate the ..._DECL node with the input GNAT defining identifier.
If GNAT_ENTITY is a variable or a constant declaration, GNU_EXPR gives its
- initial value (in GCC tree form). This is optional for variables.
- For renamed entities, GNU_EXPR gives the object being renamed.
+ initial value (in GCC tree form). This is optional for a variable. For
+ a renamed entity, GNU_EXPR gives the object being renamed.
DEFINITION is nonzero if this call is intended for a definition. This is
- used for separate compilation where it necessary to know whether an
- external declaration or a definition should be created if the GCC equivalent
+ used for separate compilation where it is necessary to know whether an
+ external declaration or a definition must be created if the GCC equivalent
was not created previously. The value of 1 is normally used for a nonzero
DEFINITION, but a value of 2 is used in special circumstances, defined in
the code. */
gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
Entity_Id gnat_equiv_type = Gigi_Equivalent_Type (gnat_entity);
- tree gnu_entity_id;
- tree gnu_type = NULL_TREE;
- /* Contains the gnu XXXX_DECL tree node which is equivalent to the input
- GNAT tree. This node will be associated with the GNAT node by calling
- the save_gnu_tree routine at the end of the `switch' statement. */
+ Entity_Id gnat_temp;
+ Entity_Kind kind = Ekind (gnat_entity);
+ /* Contains the GCC DECL node which is equivalent to the input GNAT node.
+ This node will be associated with the GNAT node by calling at the end
+ of the `switch' statement. */
tree gnu_decl = NULL_TREE;
- /* true if we have already saved gnu_decl as a gnat association. */
+ /* Contains the GCC type to be used for the GCC node. */
+ tree gnu_type = NULL_TREE;
+ /* Contains the GCC size tree to be used for the GCC node. */
+ tree gnu_size = NULL_TREE;
+ /* Contains the GCC name to be used for the GCC node. */
+ tree gnu_entity_id;
+ /* True if we have already saved gnu_decl as a GNAT association. */
bool saved = false;
- /* Nonzero if we incremented defer_incomplete_level. */
+ /* True if we incremented defer_incomplete_level. */
bool this_deferred = false;
- /* Nonzero if we incremented force_global. */
+ /* True if we incremented force_global. */
bool this_global = false;
- /* Nonzero if we should check to see if elaborated during processing. */
+ /* True if we should check to see if elaborated during processing. */
bool maybe_present = false;
- /* Nonzero if we made GNU_DECL and its type here. */
+ /* True if we made GNU_DECL and its type here. */
bool this_made_decl = false;
- struct attrib *attr_list = NULL;
+ /* True if debug info is requested for this entity. */
bool debug_info_p = (Needs_Debug_Info (gnat_entity)
|| debug_info_level == DINFO_LEVEL_VERBOSE);
- Entity_Kind kind = Ekind (gnat_entity);
- Entity_Id gnat_temp;
+ /* True if this entity is to be considered as imported. */
+ bool imported_p = (Is_Imported (gnat_entity)
+ && No (Address_Clause (gnat_entity)));
unsigned int esize
= ((Known_Esize (gnat_entity)
&& UI_Is_In_Int_Range (Esize (gnat_entity)))
: IN (kind, Access_Kind) ? POINTER_SIZE * 2
: LONG_LONG_TYPE_SIZE)
: LONG_LONG_TYPE_SIZE);
- tree gnu_size = 0;
- bool imported_p
- = (Is_Imported (gnat_entity) && No (Address_Clause (gnat_entity)));
unsigned int align = 0;
+ struct attrib *attr_list = NULL;
/* Since a use of an Itype is a definition, process it as such if it
is not in a with'ed unit. */
-
- if (!definition && Is_Itype (gnat_entity)
+ if (!definition
+ && Is_Itype (gnat_entity)
&& !present_gnu_tree (gnat_entity)
&& In_Extended_Main_Code_Unit (gnat_entity))
{
- /* Ensure that we are in a subprogram mentioned in the Scope
- chain of this entity, our current scope is global,
- or that we encountered a task or entry (where we can't currently
- accurately check scoping). */
+ /* Ensure that we are in a subprogram mentioned in the Scope chain of
+ this entity, our current scope is global, or we encountered a task
+ or entry (where we can't currently accurately check scoping). */
if (!current_function_decl
|| DECL_ELABORATION_PROC_P (current_function_decl))
{
}
for (gnat_temp = Scope (gnat_entity);
- Present (gnat_temp); gnat_temp = Scope (gnat_temp))
+ Present (gnat_temp);
+ gnat_temp = Scope (gnat_temp))
{
if (Is_Type (gnat_temp))
gnat_temp = Underlying_Type (gnat_temp);
}
}
- /* This abort means the entity "gnat_entity" has an incorrect scope,
- i.e. that its scope does not correspond to the subprogram in which
- it is declared */
+ /* This abort means the entity has an incorrect scope, i.e. that its
+ scope does not correspond to the subprogram it is declared in. */
gcc_unreachable ();
}
- /* If this is entity 0, something went badly wrong. */
+ /* If the entiy is not present, something went badly wrong. */
gcc_assert (Present (gnat_entity));
/* If we've already processed this entity, return what we got last time.
If we are defining the node, we should not have already processed it.
- In that case, we will abort below when we try to save a new GCC tree for
- this object. We also need to handle the case of getting a dummy type
- when a Full_View exists. */
-
+ In that case, we will abort below when we try to save a new GCC tree
+ for this object. We also need to handle the case of getting a dummy
+ type when a Full_View exists. */
if (present_gnu_tree (gnat_entity)
&& (!definition || (Is_Type (gnat_entity) && imported_p)))
{
&& IN (kind, Incomplete_Or_Private_Kind)
&& Present (Full_View (gnat_entity)))
{
- gnu_decl = gnat_to_gnu_entity (Full_View (gnat_entity),
- NULL_TREE, 0);
-
+ gnu_decl
+ = gnat_to_gnu_entity (Full_View (gnat_entity), NULL_TREE, 0);
save_gnu_tree (gnat_entity, NULL_TREE, false);
save_gnu_tree (gnat_entity, gnu_decl, false);
}
Esize must be specified unless it was specified by the programmer. */
gcc_assert (!Unknown_Esize (gnat_entity)
|| Has_Size_Clause (gnat_entity)
- || (!IN (kind, Numeric_Kind) && !IN (kind, Enumeration_Kind)
+ || (!IN (kind, Numeric_Kind)
+ && !IN (kind, Enumeration_Kind)
&& (!IN (kind, Access_Kind)
|| kind == E_Access_Protected_Subprogram_Type
|| kind == E_Anonymous_Access_Protected_Subprogram_Type
|| kind == E_Access_Subtype)));
- /* Likewise, RM_Size must be specified for all discrete and fixed-point
- types. */
+ /* RM_Size must be specified for all discrete and fixed-point types. */
gcc_assert (!IN (kind, Discrete_Or_Fixed_Point_Kind)
|| !Unknown_RM_Size (gnat_entity));
|| IN (kind, Type_Kind));
/* For cases when we are not defining (i.e., we are referencing from
- another compilation unit) Public entities, show we are at global level
+ another compilation unit) public entities, show we are at global level
for the purpose of computing scopes. Don't do this for components or
discriminants since the relevant test is whether or not the record is
being defined. But do this for Imported functions or procedures in
the regular processing take place, which leaves us with a regular
exception data object for VMS exceptions too. The condition code
mapping is taken care of by the front end and the bitmasking by the
- runtime library. */
+ runtime library. */
goto object;
case E_Discriminant:
stored discriminants, return the entity for the corresponding
stored discriminant. Also use Original_Record_Component
if the record has a private extension. */
-
if (Present (Original_Record_Component (gnat_entity))
&& Original_Record_Component (gnat_entity) != gnat_entity)
{
then it is an untagged record. If the Corresponding_Discriminant
is not empty then this must be a renamed discriminant and its
Original_Record_Component must point to the corresponding explicit
- stored discriminant (i.e., we should have taken the previous
+ stored discriminant (i.e. we should have taken the previous
branch). */
-
else if (Present (Corresponding_Discriminant (gnat_entity))
&& Is_Tagged_Type (gnat_record))
{
/* A tagged record has no explicit stored discriminants. */
-
gcc_assert (First_Discriminant (gnat_record)
== First_Stored_Discriminant (gnat_record));
gnu_decl
it is an untagged record. If the Corresponding_Discriminant
is not empty then this must be a renamed discriminant and its
Original_Record_Component must point to the corresponding explicit
- stored discriminant (i.e., we should have taken the first
+ stored discriminant (i.e. we should have taken the first
branch). */
-
else if (Present (Corresponding_Discriminant (gnat_entity))
&& (First_Discriminant (gnat_record)
!= First_Stored_Discriminant (gnat_record)))
either gnat_desig_full or gnat_desig_equiv. */
Entity_Id gnat_desig_rep;
- /* Nonzero if this is a pointer to an unconstrained array. */
+ /* True if this is a pointer to an unconstrained array. */
bool is_unconstrained_array;
/* We want to know if we'll be seeing the freeze node for any
? In_Extended_Main_Code_Unit (gnat_desig_full)
: In_Extended_Main_Code_Unit (gnat_desig_type));
- /* Nonzero if we make a dummy type here. */
+ /* True if we make a dummy type here. */
bool got_fat_p = false;
- /* Nonzero if the dummy is a fat pointer. */
+ /* True if the dummy is a fat pointer. */
bool made_dummy = false;
tree gnu_desig_type = NULL_TREE;
enum machine_mode p_mode = mode_for_size (esize, MODE_INT, 0);
type definition (either a bound or a discriminant value) for GNAT_ENTITY,
return the GCC tree to use for that expression. GNU_NAME is the
qualification to use if an external name is appropriate and DEFINITION is
- nonzero if this is a definition of GNAT_ENTITY. If NEED_VALUE is nonzero,
- we need a result. Otherwise, we are just elaborating this for
- side-effects. If NEED_DEBUG is nonzero we need the symbol for debugging
- purposes even if it isn't needed for code generation. */
+ true if this is a definition of GNAT_ENTITY. If NEED_VALUE is true, we
+ need a result. Otherwise, we are just elaborating this for side-effects.
+ If NEED_DEBUG is true we need the symbol for debugging purposes even if it
+ isn't needed for code generation. */
static tree
elaborate_expression (Node_Id gnat_expr, Entity_Id gnat_entity,
\f
/* Given a type TYPE, return a new type whose size is appropriate for SIZE.
If TYPE is the best type, return it. Otherwise, make a new type. We
- only support new integral and pointer types. FOR_BIASED is nonzero if
+ only support new integral and pointer types. FOR_BIASED is true if
we are making a biased type. */
static tree