OSDN Git Service

* dwarfout.c (byte_size_attribute): Add local var upper_bound
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Nov 1997 16:07:17 +0000 (16:07 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Nov 1997 16:07:17 +0000 (16:07 +0000)
        and add case to handle STRING_TYPE.
        * dwarfout.c (output_string_type_die):  Fix code to generate
        correct string length attribute for fixed length strings.
        Still needs support for varying length strings.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16498 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarfout.c

index 5a94880..150e720 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 14 09:09:20 1997  Fred Fish  (fnf@cygnus.com)
+
+       * dwarfout.c (byte_size_attribute):  Add local var upper_bound
+       and add case to handle STRING_TYPE.
+       * dwarfout.c (output_string_type_die):  Fix code to generate
+       correct string length attribute for fixed length strings.
+       Still needs support for varying length strings.
+
 Fri Nov 14 08:46:56 1997  Jeffrey A Law  (law@cygnus.com)
 
        * toplev.c (get_run_time): Do something sensible for cygwin32.
index 2e108dc..21f78b5 100644 (file)
@@ -2653,6 +2653,17 @@ byte_size_attribute (tree_node)
               / BITS_PER_UNIT;
        break;
 
+      /* This goes with the hack for case ARRAY_TYPE in output_type() since
+        the Chill front end represents strings using ARRAY_TYPE.  */
+      case ARRAY_TYPE:
+       {
+         /* The lower bound is zero, so the length is the upper bound + 1.  */
+         register tree upper_bound;
+         upper_bound = TYPE_MAX_VALUE (TYPE_DOMAIN (tree_node));
+         size = (unsigned) TREE_INT_CST_LOW (upper_bound) + 1;
+         break;
+       }
+
       default:
        abort ();
     }
@@ -3705,11 +3716,10 @@ output_string_type_die (arg)
 
   ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_string_type);
   sibling_attribute ();
+  equate_type_number_to_die_number (type);
   member_attribute (TYPE_CONTEXT (type));
-
-  /* Fudge the string length attribute for now.  */
-
-  string_length_attribute (TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
+  /* this is a fixed length string */
+  byte_size_attribute (type);
 }
 
 static void