aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2014-04-14 18:10:27 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2014-04-14 18:10:27 +0000
commit9dba4b5565efd56bcfadecc173ed66947492153e (patch)
tree69e44b94b1e113ea11da33d2c74ff5fbcc37315b /gcc/ada
parent006202e8c05177e883ff174d56834cafc43c8165 (diff)
downloadgcc-9dba4b5565efd56bcfadecc173ed66947492153e.zip
gcc-9dba4b5565efd56bcfadecc173ed66947492153e.tar.gz
gcc-9dba4b5565efd56bcfadecc173ed66947492153e.tar.bz2
tree.h (TYPE_IDENTIFIER): Declare.
2014-04-14 Paolo Carlini <paolo.carlini@oracle.com> * tree.h (TYPE_IDENTIFIER): Declare. * tree.c (subrange_type_for_debug_p): Use it. * godump.c (go_format_type): Likewise. * dwarf2out.c (is_cxx_auto, modified_type_die, gen_type_die_with_usage, gen_type_die_with_usage): Likewise. * dbxout.c (dbxout_type, dbxout_symbol): Likewise. /cp 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.h (TYPE_IDENTIFIER): Remove declaration. /objcp 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com> * objcp-decl.h (OBJC_TYPE_NAME, OBJC_SET_TYPE_NAME): Use TYPE_IDENTIFIER. /ada 2014-04-14 Paolo Carlini <paolo.carlini@oracle.com> * gcc-interface/decl.c (gnat_to_gnu_entity, components_to_record): Use TYPE_IDENTIFIER. * gcc-interface/utils.c (make_aligning_type, maybe_pad_type, finish_record_type, rest_of_record_type_compilation): Likewise. From-SVN: r209390
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/gcc-interface/decl.c22
-rw-r--r--gcc/ada/gcc-interface/utils.c23
3 files changed, 17 insertions, 35 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index acf1987..76ff91a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2014-04-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity, components_to_record):
+ Use TYPE_IDENTIFIER.
+ * gcc-interface/utils.c (make_aligning_type, maybe_pad_type,
+ finish_record_type, rest_of_record_type_compilation): Likewise.
+
2014-04-14 Eric Botcazou <ebotcazou@adacore.com>
* snames.ads-tmpl (Name_Ivdep): New pragma-related name.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index ae512b0..f3f3d6d 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -2671,10 +2671,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
for (index = ndim - 1; index >= 0; index--)
{
tree gnu_index = TYPE_INDEX_TYPE (gnu_index_types[index]);
- tree gnu_index_name = TYPE_NAME (gnu_index);
-
- if (TREE_CODE (gnu_index_name) == TYPE_DECL)
- gnu_index_name = DECL_NAME (gnu_index_name);
+ tree gnu_index_name = TYPE_IDENTIFIER (gnu_index);
/* Make sure to reference the types themselves, and not just
their names, as the debugger may fall back on them. */
@@ -3652,12 +3649,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (debug_info_p)
{
tree gnu_subtype_marker = make_node (RECORD_TYPE);
- tree gnu_unpad_base_name = TYPE_NAME (gnu_unpad_base_type);
+ tree gnu_unpad_base_name
+ = TYPE_IDENTIFIER (gnu_unpad_base_type);
tree gnu_size_unit = TYPE_SIZE_UNIT (gnu_type);
- if (TREE_CODE (gnu_unpad_base_name) == TYPE_DECL)
- gnu_unpad_base_name = DECL_NAME (gnu_unpad_base_name);
-
TYPE_NAME (gnu_subtype_marker)
= create_concat_name (gnat_entity, "XVS");
finish_record_type (gnu_subtype_marker,
@@ -4976,11 +4971,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
false, !gnu_decl, definition, false);
if (TYPE_IS_PADDING_P (gnu_type))
- {
- gnu_entity_name = TYPE_NAME (gnu_type);
- if (TREE_CODE (gnu_entity_name) == TYPE_DECL)
- gnu_entity_name = DECL_NAME (gnu_entity_name);
- }
+ gnu_entity_name = TYPE_IDENTIFIER (gnu_type);
/* Now set the RM size of the type. We cannot do it before padding
because we need to accept arbitrary RM sizes on integral types. */
@@ -7035,7 +7026,7 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
{
Node_Id gnat_discr = Name (variant_part), variant;
tree gnu_discr = gnat_to_gnu (gnat_discr);
- tree gnu_name = TYPE_NAME (gnu_record_type);
+ tree gnu_name = TYPE_IDENTIFIER (gnu_record_type);
tree gnu_var_name
= concat_name (get_identifier (Get_Name_String (Chars (gnat_discr))),
"XVN");
@@ -7047,9 +7038,6 @@ components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
unsigned int variants_align = 0;
unsigned int i;
- if (TREE_CODE (gnu_name) == TYPE_DECL)
- gnu_name = DECL_NAME (gnu_name);
-
gnu_union_name
= concat_name (gnu_name, IDENTIFIER_POINTER (gnu_var_name));
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index cfa0791..44877b6 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -706,10 +706,8 @@ make_aligning_type (tree type, unsigned int align, tree size,
tree vblock_addr_st = size_binop (PLUS_EXPR, record_addr_st, room_st);
tree voffset_st, pos, field;
- tree name = TYPE_NAME (type);
+ tree name = TYPE_IDENTIFIER (type);
- if (TREE_CODE (name) == TYPE_DECL)
- name = DECL_NAME (name);
name = concat_name (name, "ALIGN");
TYPE_NAME (record_type) = name;
@@ -1203,14 +1201,8 @@ maybe_pad_type (tree type, tree size, unsigned int align,
&& DECL_IGNORED_P (TYPE_NAME (type))))
{
tree marker = make_node (RECORD_TYPE);
- tree name = TYPE_NAME (record);
- tree orig_name = TYPE_NAME (type);
-
- if (TREE_CODE (name) == TYPE_DECL)
- name = DECL_NAME (name);
-
- if (TREE_CODE (orig_name) == TYPE_DECL)
- orig_name = DECL_NAME (orig_name);
+ tree name = TYPE_IDENTIFIER (record);
+ tree orig_name = TYPE_IDENTIFIER (type);
TYPE_NAME (marker) = concat_name (name, "XVS");
finish_record_type (marker,
@@ -1419,7 +1411,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
bool debug_info_p)
{
enum tree_code code = TREE_CODE (record_type);
- tree name = TYPE_NAME (record_type);
+ tree name = TYPE_IDENTIFIER (record_type);
tree ada_size = bitsize_zero_node;
tree size = bitsize_zero_node;
bool had_size = TYPE_SIZE (record_type) != 0;
@@ -1431,8 +1423,6 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
/* Always attach the TYPE_STUB_DECL for a record type. It is required to
generate debug info and have a parallel type. */
- if (name && TREE_CODE (name) == TYPE_DECL)
- name = DECL_NAME (name);
TYPE_STUB_DECL (record_type) = create_type_stub_decl (name, record_type);
/* Globally initialize the record first. If this is a rep'ed record,
@@ -1692,13 +1682,10 @@ rest_of_record_type_compilation (tree record_type)
tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
? UNION_TYPE : TREE_CODE (record_type));
- tree orig_name = TYPE_NAME (record_type), new_name;
+ tree orig_name = TYPE_IDENTIFIER (record_type), new_name;
tree last_pos = bitsize_zero_node;
tree old_field, prev_old_field = NULL_TREE;
- if (TREE_CODE (orig_name) == TYPE_DECL)
- orig_name = DECL_NAME (orig_name);
-
new_name
= concat_name (orig_name, TREE_CODE (record_type) == QUAL_UNION_TYPE
? "XVU" : "XVE");