never be declared otherwise. This is necessary to ensure
that its subtrees are properly marked. */
if (gnu_type != orig_type && !DECL_P (TYPE_NAME (gnu_type)))
- create_type_decl (TYPE_NAME (gnu_type), gnu_type, NULL, true,
+ create_type_decl (TYPE_NAME (gnu_type), gnu_type, true,
debug_info_p, gnat_entity);
}
}
never be declared otherwise. This is necessary to ensure
that its subtrees are properly marked. */
if (gnu_type != orig_type && !DECL_P (TYPE_NAME (gnu_type)))
- create_type_decl (TYPE_NAME (gnu_type), gnu_type, NULL, true,
+ create_type_decl (TYPE_NAME (gnu_type), gnu_type, true,
debug_info_p, gnat_entity);
}
case E_Enumeration_Type:
/* A special case: for the types Character and Wide_Character in
Standard, we do not list all the literals. So if the literals
- are not specified, make this an unsigned type. */
+ are not specified, make this an unsigned integer type. */
if (No (First_Literal (gnat_entity)))
{
gnu_type = make_unsigned_type (esize);
This is needed by the DWARF-2 back-end to distinguish between
unsigned integer types and character types. */
TYPE_STRING_FLAG (gnu_type) = 1;
- break;
}
+ else
+ {
+ /* We have a list of enumeral constants in First_Literal. We make a
+ CONST_DECL for each one and build into GNU_LITERAL_LIST the list
+ to be placed into TYPE_FIELDS. Each node is itself a TREE_LIST
+ whose TREE_VALUE is the literal name and whose TREE_PURPOSE is the
+ value of the literal. But when we have a regular boolean type, we
+ simplify this a little by using a BOOLEAN_TYPE. */
+ const bool is_boolean = Is_Boolean_Type (gnat_entity)
+ && !Has_Non_Standard_Rep (gnat_entity);
+ const bool is_unsigned = Is_Unsigned_Type (gnat_entity);
+ tree gnu_list = NULL_TREE;
+ Entity_Id gnat_literal;
+
+ gnu_type = make_node (is_boolean ? BOOLEAN_TYPE : ENUMERAL_TYPE);
+ TYPE_PRECISION (gnu_type) = esize;
+ TYPE_UNSIGNED (gnu_type) = is_unsigned;
+ set_min_and_max_values_for_integral_type (gnu_type, esize,
+ is_unsigned);
+ process_attributes (&gnu_type, &attr_list, true, gnat_entity);
+ layout_type (gnu_type);
+
+ for (gnat_literal = First_Literal (gnat_entity);
+ Present (gnat_literal);
+ gnat_literal = Next_Literal (gnat_literal))
+ {
+ tree gnu_value
+ = UI_To_gnu (Enumeration_Rep (gnat_literal), gnu_type);
+ tree gnu_literal
+ = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
+ gnu_type, gnu_value, true, false, false,
+ false, NULL, gnat_literal);
+ /* Do not generate debug info for individual enumerators. */
+ DECL_IGNORED_P (gnu_literal) = 1;
+ save_gnu_tree (gnat_literal, gnu_literal, false);
+ gnu_list
+ = tree_cons (DECL_NAME (gnu_literal), gnu_value, gnu_list);
+ }
- {
- /* We have a list of enumeral constants in First_Literal. We make a
- CONST_DECL for each one and build into GNU_LITERAL_LIST the list to
- be placed into TYPE_FIELDS. Each node in the list is a TREE_LIST
- whose TREE_VALUE is the literal name and whose TREE_PURPOSE is the
- value of the literal. But when we have a regular boolean type, we
- simplify this a little by using a BOOLEAN_TYPE. */
- bool is_boolean = Is_Boolean_Type (gnat_entity)
- && !Has_Non_Standard_Rep (gnat_entity);
- tree gnu_literal_list = NULL_TREE;
- Entity_Id gnat_literal;
-
- if (Is_Unsigned_Type (gnat_entity))
- gnu_type = make_unsigned_type (esize);
- else
- gnu_type = make_signed_type (esize);
-
- TREE_SET_CODE (gnu_type, is_boolean ? BOOLEAN_TYPE : ENUMERAL_TYPE);
-
- for (gnat_literal = First_Literal (gnat_entity);
- Present (gnat_literal);
- gnat_literal = Next_Literal (gnat_literal))
- {
- tree gnu_value
- = UI_To_gnu (Enumeration_Rep (gnat_literal), gnu_type);
- tree gnu_literal
- = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
- gnu_type, gnu_value, true, false, false,
- false, NULL, gnat_literal);
- /* Do not generate debug info for individual enumerators. */
- DECL_IGNORED_P (gnu_literal) = 1;
- save_gnu_tree (gnat_literal, gnu_literal, false);
- gnu_literal_list = tree_cons (DECL_NAME (gnu_literal),
- gnu_value, gnu_literal_list);
- }
-
- if (!is_boolean)
- TYPE_VALUES (gnu_type) = nreverse (gnu_literal_list);
+ if (!is_boolean)
+ TYPE_VALUES (gnu_type) = nreverse (gnu_list);
- /* Note that the bounds are updated at the end of this function
- to avoid an infinite recursion since they refer to the type. */
- }
- goto discrete_type;
+ /* Note that the bounds are updated at the end of this function
+ to avoid an infinite recursion since they refer to the type. */
+ goto discrete_type;
+ }
+ break;
case E_Signed_Integer_Type:
case E_Ordinary_Fixed_Point_Type:
definition, true,
Needs_Debug_Info (gnat_entity))));
+ TYPE_BIASED_REPRESENTATION_P (gnu_type)
+ = Has_Biased_Representation (gnat_entity);
+
+ /* Inherit our alias set from what we're a subtype of. Subtypes
+ are not different types and a pointer can designate any instance
+ within a subtype hierarchy. */
+ relate_alias_sets (gnu_type, TREE_TYPE (gnu_type), ALIAS_SET_COPY);
+
/* One of the above calls might have caused us to be elaborated,
so don't blow up if so. */
if (present_gnu_tree (gnat_entity))
break;
}
- TYPE_BIASED_REPRESENTATION_P (gnu_type)
- = Has_Biased_Representation (gnat_entity);
-
/* Attach the TYPE_STUB_DECL in case we have a parallel type. */
TYPE_STUB_DECL (gnu_type)
= create_type_stub_decl (gnu_entity_name, gnu_type);
- /* Inherit our alias set from what we're a subtype of. Subtypes
- are not different types and a pointer can designate any instance
- within a subtype hierarchy. */
- relate_alias_sets (gnu_type, TREE_TYPE (gnu_type), ALIAS_SET_COPY);
-
/* For a packed array, make the original array type a parallel type. */
if (debug_info_p
&& Is_Packed_Array_Type (gnat_entity)
TYPE_PACKED_ARRAY_TYPE_P (gnu_type) = 1;
/* Create a stripped-down declaration, mainly for debugging. */
- create_type_decl (gnu_entity_name, gnu_type, NULL, true,
- debug_info_p, gnat_entity);
+ create_type_decl (gnu_entity_name, gnu_type, true, debug_info_p,
+ gnat_entity);
/* Now save it and build the enclosing record type. */
gnu_field_type = gnu_type;
UI_To_gnu (RM_Size (gnat_entity), bitsizetype));
/* Create a stripped-down declaration, mainly for debugging. */
- create_type_decl (gnu_entity_name, gnu_type, NULL, true,
- debug_info_p, gnat_entity);
+ create_type_decl (gnu_entity_name, gnu_type, true, debug_info_p,
+ gnat_entity);
/* Now save it and build the enclosing record type. */
gnu_field_type = gnu_type;
break;
}
- {
- if (!definition
- && Present (Ancestor_Subtype (gnat_entity))
- && !In_Extended_Main_Code_Unit (Ancestor_Subtype (gnat_entity))
- && (!Compile_Time_Known_Value (Type_Low_Bound (gnat_entity))
- || !Compile_Time_Known_Value (Type_High_Bound (gnat_entity))))
- gnat_to_gnu_entity (Ancestor_Subtype (gnat_entity),
- gnu_expr, 0);
-
- gnu_type = make_node (REAL_TYPE);
- TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity));
- TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize);
- TYPE_GCC_MIN_VALUE (gnu_type)
- = TYPE_GCC_MIN_VALUE (TREE_TYPE (gnu_type));
- TYPE_GCC_MAX_VALUE (gnu_type)
- = TYPE_GCC_MAX_VALUE (TREE_TYPE (gnu_type));
- layout_type (gnu_type);
-
- SET_TYPE_RM_MIN_VALUE
- (gnu_type,
- convert (TREE_TYPE (gnu_type),
- elaborate_expression (Type_Low_Bound (gnat_entity),
- gnat_entity, get_identifier ("L"),
- definition, true,
- Needs_Debug_Info (gnat_entity))));
-
- SET_TYPE_RM_MAX_VALUE
- (gnu_type,
- convert (TREE_TYPE (gnu_type),
- elaborate_expression (Type_High_Bound (gnat_entity),
- gnat_entity, get_identifier ("U"),
- definition, true,
- Needs_Debug_Info (gnat_entity))));
-
- /* One of the above calls might have caused us to be elaborated,
- so don't blow up if so. */
- if (present_gnu_tree (gnat_entity))
- {
- maybe_present = true;
- break;
- }
+ /* See the E_Signed_Integer_Subtype case for the rationale. */
+ if (!definition
+ && Present (Ancestor_Subtype (gnat_entity))
+ && !In_Extended_Main_Code_Unit (Ancestor_Subtype (gnat_entity))
+ && (!Compile_Time_Known_Value (Type_Low_Bound (gnat_entity))
+ || !Compile_Time_Known_Value (Type_High_Bound (gnat_entity))))
+ gnat_to_gnu_entity (Ancestor_Subtype (gnat_entity), gnu_expr, 0);
- /* Inherit our alias set from what we're a subtype of, as for
- integer subtypes. */
- relate_alias_sets (gnu_type, TREE_TYPE (gnu_type), ALIAS_SET_COPY);
- }
- break;
+ gnu_type = make_node (REAL_TYPE);
+ TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity));
+ TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize);
+ TYPE_GCC_MIN_VALUE (gnu_type)
+ = TYPE_GCC_MIN_VALUE (TREE_TYPE (gnu_type));
+ TYPE_GCC_MAX_VALUE (gnu_type)
+ = TYPE_GCC_MAX_VALUE (TREE_TYPE (gnu_type));
+ layout_type (gnu_type);
+
+ SET_TYPE_RM_MIN_VALUE
+ (gnu_type,
+ convert (TREE_TYPE (gnu_type),
+ elaborate_expression (Type_Low_Bound (gnat_entity),
+ gnat_entity, get_identifier ("L"),
+ definition, true,
+ Needs_Debug_Info (gnat_entity))));
+
+ SET_TYPE_RM_MAX_VALUE
+ (gnu_type,
+ convert (TREE_TYPE (gnu_type),
+ elaborate_expression (Type_High_Bound (gnat_entity),
+ gnat_entity, get_identifier ("U"),
+ definition, true,
+ Needs_Debug_Info (gnat_entity))));
+
+ /* Inherit our alias set from what we're a subtype of, as for
+ integer subtypes. */
+ relate_alias_sets (gnu_type, TREE_TYPE (gnu_type), ALIAS_SET_COPY);
+
+ /* One of the above calls might have caused us to be elaborated,
+ so don't blow up if so. */
+ maybe_present = true;
+ break;
/* Array and String Types and Subtypes
TYPE_SIZE_UNIT (tem));
}
- create_type_decl (create_concat_name (gnat_entity, "XUA"),
- tem, NULL, !Comes_From_Source (gnat_entity),
- debug_info_p, gnat_entity);
+ create_type_decl (create_concat_name (gnat_entity, "XUA"), tem,
+ !Comes_From_Source (gnat_entity), debug_info_p,
+ gnat_entity);
/* Give the fat pointer type a name. If this is a packed type, tell
the debugger how to interpret the underlying bits. */
gnat_name = Packed_Array_Type (gnat_entity);
else
gnat_name = gnat_entity;
- create_type_decl (create_concat_name (gnat_name, "XUP"),
- gnu_fat_type, NULL, !Comes_From_Source (gnat_entity),
- debug_info_p, gnat_entity);
+ create_type_decl (create_concat_name (gnat_name, "XUP"), gnu_fat_type,
+ !Comes_From_Source (gnat_entity), debug_info_p,
+ gnat_entity);
/* Create the type to be designated by thin pointers: a record type for
the array and its template. We used to shift the fields to have the
/* First finish the type we had been making so that we output
debugging information for it. */
+ process_attributes (&gnu_type, &attr_list, false, gnat_entity);
if (Treat_As_Volatile (gnat_entity))
gnu_type
= build_qualified_type (gnu_type,
TYPE_QUALS (gnu_type)
| TYPE_QUAL_VOLATILE);
-
/* Make it artificial only if the base type was artificial too.
That's sort of "morally" true and will make it possible for
the debugger to look it up by name in DWARF, which is needed
in order to decode the packed array type. */
gnu_decl
- = create_type_decl (gnu_entity_name, gnu_type, attr_list,
+ = create_type_decl (gnu_entity_name, gnu_type,
!Comes_From_Source (Etype (gnat_entity))
&& !Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity);
TYPE_PACKED (gnu_type) = (packed != 0) || has_rep;
if (Reverse_Storage_Order (gnat_entity))
sorry ("non-default Scalar_Storage_Order");
+ process_attributes (&gnu_type, &attr_list, true, gnat_entity);
if (!definition)
{
gnu_type = make_node (RECORD_TYPE);
TYPE_NAME (gnu_type) = gnu_entity_name;
TYPE_PACKED (gnu_type) = TYPE_PACKED (gnu_base_type);
+ process_attributes (&gnu_type, &attr_list, true, gnat_entity);
/* Set the size, alignment and alias set of the new type to
match that of the old one, doing required substitutions. */
gnu_type
= build_pointer_type
(make_dummy_type (Directly_Designated_Type (gnat_entity)));
- gnu_decl = create_type_decl (gnu_entity_name, gnu_type, attr_list,
+ gnu_decl = create_type_decl (gnu_entity_name, gnu_type,
!Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity);
this_made_decl = true;
else
gnu_old_desig_type = TREE_TYPE (gnu_type);
- gnu_decl = create_type_decl (gnu_entity_name, gnu_type, attr_list,
+ process_attributes (&gnu_type, &attr_list, false, gnat_entity);
+ gnu_decl = create_type_decl (gnu_entity_name, gnu_type,
!Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity);
this_made_decl = true;
if (gnu_return_type != orig_type
&& !DECL_P (TYPE_NAME (gnu_return_type)))
create_type_decl (TYPE_NAME (gnu_return_type),
- gnu_return_type, NULL, true,
- debug_info_p, gnat_entity);
+ gnu_return_type, true, debug_info_p,
+ gnat_entity);
return_by_invisi_ref_p = true;
}
}
else if (kind == E_Subprogram_Type)
- gnu_decl
- = create_type_decl (gnu_entity_name, gnu_type, attr_list,
- artificial_flag, debug_info_p, gnat_entity);
+ {
+ process_attributes (&gnu_type, &attr_list, false, gnat_entity);
+ gnu_decl
+ = create_type_decl (gnu_entity_name, gnu_type, artificial_flag,
+ debug_info_p, gnat_entity);
+ }
else
{
if (has_stub)
handling alignment and possible padding. */
if (is_type && (!gnu_decl || this_made_decl))
{
+ /* Process the attributes, if not already done. Note that the type is
+ already defined so we cannot pass True for IN_PLACE here. */
+ process_attributes (&gnu_type, &attr_list, false, gnat_entity);
+
/* Tell the middle-end that objects of tagged types are guaranteed to
be properly aligned. This is necessary because conversions to the
class-wide type are translated into conversions to the root type,
TYPE_UNIVERSAL_ALIASING_P (TYPE_MAIN_VARIANT (gnu_type)) = 1;
if (!gnu_decl)
- gnu_decl = create_type_decl (gnu_entity_name, gnu_type, attr_list,
+ gnu_decl = create_type_decl (gnu_entity_name, gnu_type,
!Comes_From_Source (gnat_entity),
debug_info_p, gnat_entity);
else
declared otherwise. This is necessary to ensure that its subtrees
are properly marked. */
if (gnu_type != orig_type && !DECL_P (TYPE_NAME (gnu_type)))
- create_type_decl (TYPE_NAME (gnu_type), gnu_type, NULL, true,
- debug_info_p, gnat_array);
+ create_type_decl (TYPE_NAME (gnu_type), gnu_type, true, debug_info_p,
+ gnat_array);
}
if (Has_Volatile_Components (gnat_array))
are properly marked. */
if (gnu_field_type != orig_field_type
&& !DECL_P (TYPE_NAME (gnu_field_type)))
- create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, NULL,
- true, debug_info_p, gnat_field);
+ create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, true,
+ debug_info_p, gnat_field);
}
/* Otherwise (or if there was an error), don't specify a position. */
the fields associated with these empty variants. */
rest_of_record_type_compilation (gnu_variant_type);
create_type_decl (TYPE_NAME (gnu_variant_type), gnu_variant_type,
- NULL, true, debug_info, gnat_component_list);
+ true, debug_info, gnat_component_list);
gnu_field
= create_field_decl (gnu_inner_name, gnu_variant_type,
return;
}
- create_type_decl (TYPE_NAME (gnu_union_type), gnu_union_type,
- NULL, true, debug_info, gnat_component_list);
+ create_type_decl (TYPE_NAME (gnu_union_type), gnu_union_type, true,
+ debug_info, gnat_component_list);
/* Deal with packedness like in gnat_to_gnu_field. */
if (union_field_needs_strict_alignment)
info thanks to the XVS type. */
finish_record_type (new_variant, nreverse (field_list), 2, false);
compute_record_mode (new_variant);
- create_type_decl (TYPE_NAME (new_variant), new_variant, NULL,
- true, false, Empty);
+ create_type_decl (TYPE_NAME (new_variant), new_variant, true, false,
+ Empty);
new_field
= create_field_decl_from (old_field, new_variant, new_union_type,
because VARIANT_LIST has been traversed in reverse order. */
finish_record_type (new_union_type, union_field_list, 2, false);
compute_record_mode (new_union_type);
- create_type_decl (TYPE_NAME (new_union_type), new_union_type, NULL,
- true, false, Empty);
+ create_type_decl (TYPE_NAME (new_union_type), new_union_type, true, false,
+ Empty);
new_variant_part
= create_field_decl_from (old_variant_part, new_union_type, record_type,
static tree float_type_for_precision (int, enum machine_mode);
static tree convert_to_fat_pointer (tree, tree);
static bool potential_alignment_gap (tree, tree, tree);
-static void process_attributes (tree, struct attrib *);
\f
/* Initialize data structures of the utils.c module. */
/* Declare it now since it will never be declared otherwise. This is
necessary to ensure that its subtrees are properly marked. */
- create_type_decl (name, record_type, NULL, true, false, gnat_node);
+ create_type_decl (name, record_type, true, false, gnat_node);
return record_type;
}
/* If requested, complete the original type and give it a name. */
if (is_user_type)
create_type_decl (get_entity_name (gnat_entity), type,
- NULL, !Comes_From_Source (gnat_entity),
+ !Comes_From_Source (gnat_entity),
!(TYPE_NAME (type)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_IGNORED_P (TYPE_NAME (type))),
/* Then set the index type. */
SET_TYPE_INDEX_TYPE (type, index);
- create_type_decl (NULL_TREE, type, NULL, true, false, gnat_node);
+ create_type_decl (NULL_TREE, type, true, false, gnat_node);
return type;
}
is used for the position of the decl. */
tree
-create_type_decl (tree type_name, tree type, struct attrib *attr_list,
- bool artificial_p, bool debug_info_p, Node_Id gnat_node)
+create_type_decl (tree type_name, tree type, bool artificial_p,
+ bool debug_info_p, Node_Id gnat_node)
{
enum tree_code code = TREE_CODE (type);
bool named = TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL;
DECL_NAME (type_decl) = type_name;
}
else
- type_decl = build_decl (input_location,
- TYPE_DECL, type_name, type);
+ type_decl = build_decl (input_location, TYPE_DECL, type_name, type);
DECL_ARTIFICIAL (type_decl) = artificial_p;
TYPE_ARTIFICIAL (type) = artificial_p;
/* Add this decl to the current binding level. */
gnat_pushdecl (type_decl, gnat_node);
- process_attributes (type_decl, attr_list);
-
/* If we're naming the type, equate the TYPE_STUB_DECL to the name.
This causes the name to be also viewed as a "tag" by the debug
back-end, with the advantage that no DW_TAG_typedef is emitted
!= null_pointer_node)
DECL_IGNORED_P (var_decl) = 1;
- /* Add this decl to the current binding level. */
- gnat_pushdecl (var_decl, gnat_node);
-
if (TREE_SIDE_EFFECTS (var_decl))
TREE_ADDRESSABLE (var_decl) = 1;
+ /* ??? Some attributes cannot be applied to CONST_DECLs. */
+ if (TREE_CODE (var_decl) == VAR_DECL)
+ process_attributes (&var_decl, &attr_list, true, gnat_node);
+
+ /* Add this decl to the current binding level. */
+ gnat_pushdecl (var_decl, gnat_node);
+
if (TREE_CODE (var_decl) == VAR_DECL)
{
if (asm_name)
SET_DECL_ASSEMBLER_NAME (var_decl, asm_name);
- process_attributes (var_decl, attr_list);
+
if (global_bindings_p ())
rest_of_decl_compilation (var_decl, true, 0);
}
return param_decl;
}
\f
-/* Given a DECL and ATTR_LIST, process the listed attributes. */
+/* Process the attributes in ATTR_LIST for NODE, which is either a DECL or
+ a TYPE. If IN_PLACE is true, the tree pointed to by NODE should not be
+ changed. GNAT_NODE is used for the position of error messages. */
-static void
-process_attributes (tree decl, struct attrib *attr_list)
+void
+process_attributes (tree *node, struct attrib **attr_list, bool in_place,
+ Node_Id gnat_node)
{
- for (; attr_list; attr_list = attr_list->next)
- switch (attr_list->type)
+ struct attrib *attr;
+
+ for (attr = *attr_list; attr; attr = attr->next)
+ switch (attr->type)
{
case ATTR_MACHINE_ATTRIBUTE:
- input_location = DECL_SOURCE_LOCATION (decl);
- decl_attributes (&decl, tree_cons (attr_list->name, attr_list->args,
- NULL_TREE),
- ATTR_FLAG_TYPE_IN_PLACE);
+ Sloc_to_locus (Sloc (gnat_node), &input_location);
+ decl_attributes (node, tree_cons (attr->name, attr->args, NULL_TREE),
+ in_place ? ATTR_FLAG_TYPE_IN_PLACE : 0);
break;
case ATTR_LINK_ALIAS:
- if (! DECL_EXTERNAL (decl))
+ if (!DECL_EXTERNAL (*node))
{
- TREE_STATIC (decl) = 1;
- assemble_alias (decl, attr_list->name);
+ TREE_STATIC (*node) = 1;
+ assemble_alias (*node, attr->name);
}
break;
case ATTR_WEAK_EXTERNAL:
if (SUPPORTS_WEAK)
- declare_weak (decl);
+ declare_weak (*node);
else
post_error ("?weak declarations not supported on this target",
- attr_list->error_point);
+ attr->error_point);
break;
case ATTR_LINK_SECTION:
if (targetm_common.have_named_sections)
{
- DECL_SECTION_NAME (decl)
- = build_string (IDENTIFIER_LENGTH (attr_list->name),
- IDENTIFIER_POINTER (attr_list->name));
- DECL_COMMON (decl) = 0;
+ DECL_SECTION_NAME (*node)
+ = build_string (IDENTIFIER_LENGTH (attr->name),
+ IDENTIFIER_POINTER (attr->name));
+ DECL_COMMON (*node) = 0;
}
else
post_error ("?section attributes are not supported for this target",
- attr_list->error_point);
+ attr->error_point);
break;
case ATTR_LINK_CONSTRUCTOR:
- DECL_STATIC_CONSTRUCTOR (decl) = 1;
- TREE_USED (decl) = 1;
+ DECL_STATIC_CONSTRUCTOR (*node) = 1;
+ TREE_USED (*node) = 1;
break;
case ATTR_LINK_DESTRUCTOR:
- DECL_STATIC_DESTRUCTOR (decl) = 1;
- TREE_USED (decl) = 1;
+ DECL_STATIC_DESTRUCTOR (*node) = 1;
+ TREE_USED (*node) = 1;
break;
case ATTR_THREAD_LOCAL_STORAGE:
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
- DECL_COMMON (decl) = 0;
+ DECL_TLS_MODEL (*node) = decl_default_tls_model (*node);
+ DECL_COMMON (*node) = 0;
break;
}
+
+ *attr_list = NULL;
}
\f
/* Record DECL as a global renaming pointer. */
DECL_NAME (subprog_decl) = main_identifier_node;
}
+ process_attributes (&subprog_decl, &attr_list, true, gnat_node);
+
/* Add this decl to the current binding level. */
gnat_pushdecl (subprog_decl, gnat_node);
- process_attributes (subprog_decl, attr_list);
-
/* Output the assembler code and/or RTL for the declaration. */
rest_of_decl_compilation (subprog_decl, global_bindings_p (), 0);
/* Declare it now since it will never be declared otherwise. This is
necessary to ensure that its subtrees are properly marked. */
- create_type_decl (name, type, NULL, true, debug_info_p, Empty);
+ create_type_decl (name, type, true, debug_info_p, Empty);
return type;
}
/* Vector representative type and size. */
tree rep_type = *node;
tree rep_size = TYPE_SIZE_UNIT (rep_type);
- tree rep_name;
/* Vector size in bytes and number of units. */
unsigned HOST_WIDE_INT vec_bytes, vec_units;
*no_add_attrs = true;
- /* Get the representative array type, possibly nested within a
- padding record e.g. for alignment purposes. */
-
- if (TYPE_IS_PADDING_P (rep_type))
- rep_type = TREE_TYPE (TYPE_FIELDS (rep_type));
-
if (TREE_CODE (rep_type) != ARRAY_TYPE)
{
error ("attribute %qs applies to array types only",
/* Build the vector type and replace. */
*node = build_vector_type (elem_type, vec_units);
- rep_name = TYPE_NAME (rep_type);
- if (TREE_CODE (rep_name) == TYPE_DECL)
- rep_name = DECL_NAME (rep_name);
- TYPE_NAME (*node) = rep_name;
TYPE_REPRESENTATIVE_ARRAY (*node) = rep_type;
return NULL_TREE;