summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrobecke <brobecke@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-17 08:06:33 +0000
committerbrobecke <brobecke@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-17 08:06:33 +0000
commit4aad261ff9ad67dd9eead7ebb9eefcb7afb0c095 (patch)
treea466dc63fcde15a43df105809a1a2185718a96a6
parent43a675b530f2bf541b253966d0d9633c6cf6738d (diff)
downloadgcc-4aad261ff9ad67dd9eead7ebb9eefcb7afb0c095.tar.gz
* dwarf2out.c (subrange_type_die): Define new variable "subtype"
to hold the subtype tree instead of recomputing it several times. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79577 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bdba02a436b..99ebb821c39 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-17 Joel Brobecker <brobecker@gnat.com>
+
+ * dwarf2out.c (subrange_type_die): Define new variable "subtype"
+ to hold the subtype tree instead of recomputing it several times.
+
2004-03-17 Kazu Hirata <kazu@cs.umass.edu>
* config/mn10300/mn10300.c (notice_update_cc): Don't handle
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2fcc150b931..cb28ffc815a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -8021,14 +8021,15 @@ subrange_type_die (tree type, dw_die_ref context_die)
dw_die_ref subrange_die;
tree name = TYPE_NAME (type);
const HOST_WIDE_INT size_in_bytes = int_size_in_bytes (type);
+ tree subtype = TREE_TYPE (type);
if (context_die == NULL)
context_die = comp_unit_die;
- if (TREE_CODE (TREE_TYPE (type)) == ENUMERAL_TYPE)
- subtype_die = gen_enumeration_type_die (TREE_TYPE (type), context_die);
+ if (TREE_CODE (subtype) == ENUMERAL_TYPE)
+ subtype_die = gen_enumeration_type_die (subtype, context_die);
else
- subtype_die = base_type_die (TREE_TYPE (type));
+ subtype_die = base_type_die (subtype);
subrange_die = new_die (DW_TAG_subrange_type, context_die, type);
@@ -8039,7 +8040,7 @@ subrange_type_die (tree type, dw_die_ref context_die)
add_name_attribute (subrange_die, IDENTIFIER_POINTER (name));
}
- if (int_size_in_bytes (TREE_TYPE (type)) != size_in_bytes)
+ if (int_size_in_bytes (subtype) != size_in_bytes)
{
/* The size of the subrange type and its base type do not match,
so we need to generate a size attribute for the subrange type. */