]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (is_ada_subrange_type): No longer check the TYPE_NAME.
authorJ. Brobecker <brobecker@gnat.com>
Wed, 14 Jan 2004 02:52:40 +0000 (02:52 +0000)
committerJoel Brobecker <brobecke@gcc.gnu.org>
Wed, 14 Jan 2004 02:52:40 +0000 (02:52 +0000)
        * dwarf2out.c (is_ada_subrange_type): No longer check the TYPE_NAME.
        (subrange_type_die): Add handle for nameless subrange types.

From-SVN: r75838

gcc/ChangeLog
gcc/dwarf2out.c

index c76440243fff4540cfd289a8b133379f3c447d95..3b07544a85c13480704f058e14c74172b519c66b 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-14  J. Brobecker  <brobecker@gnat.com>
+
+       * dwarf2out.c (is_ada_subrange_type): No longer check the TYPE_NAME.
+       (subrange_type_die): Add handle for nameless subrange types.
+
 2004-01-13  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300-protos.h: Replace do_movsi with
index 54ed7bbc40cee3fed161fd6276d4320f703c2385..5f75d296450c590bd3569020dac03d87657af236 100644 (file)
@@ -7820,7 +7820,6 @@ is_ada_subrange_type (tree type)
 
   if (is_ada ()
       && TREE_CODE (type) == INTEGER_TYPE
-      && TYPE_NAME (type) != NULL_TREE
       && subtype != NULL_TREE)
     {
       if (TREE_CODE (subtype) == INTEGER_TYPE && TREE_UNSIGNED (subtype))
@@ -7849,11 +7848,15 @@ subrange_type_die (tree type, dw_die_ref context_die)
   else
     subtype_die = base_type_die (TREE_TYPE (type));
 
-  if (TREE_CODE (name) == TYPE_DECL)
-    name = DECL_NAME (name);
-
   subrange_die = new_die (DW_TAG_subrange_type, context_die, type);
-  add_name_attribute (subrange_die, IDENTIFIER_POINTER (name));
+
+  if (name != NULL)
+    {
+      if (TREE_CODE (name) == TYPE_DECL)
+        name = DECL_NAME (name);
+      add_name_attribute (subrange_die, IDENTIFIER_POINTER (name));
+    }
+
   if (TYPE_MIN_VALUE (type) != NULL)
     add_bound_info (subrange_die, DW_AT_lower_bound,
                     TYPE_MIN_VALUE (type));