aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Fish <fnf@cygnus.com>1997-11-14 16:07:17 +0000
committerJeff Law <law@gcc.gnu.org>1997-11-14 09:07:17 -0700
commit874a8709bf8077e0347180eba67c73b0661ba9fd (patch)
treebbc41a98979228224e584a75fbd7fada517fcbd8
parentea4661960903a6da02d0b95a5c314eaa0d45b71d (diff)
downloadgcc-874a8709bf8077e0347180eba67c73b0661ba9fd.zip
gcc-874a8709bf8077e0347180eba67c73b0661ba9fd.tar.gz
gcc-874a8709bf8077e0347180eba67c73b0661ba9fd.tar.bz2
dwarfout.c (byte_size_attribute): Add local var upper_bound and add case to handle STRING_TYPE.
* 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. From-SVN: r16498
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dwarfout.c18
2 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5a94880..150e720 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 2e108dc..21f78b5 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -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