diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-05-13 09:09:20 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-05-13 09:09:20 +0000 |
commit | 33ac96f04d2916d07bf8922c63de9d6eb1eda74b (patch) | |
tree | ecb49d8b82484b145605d4b1ed7036a52f5bb284 /gdb | |
parent | bf3eeda76c05e26f2fde170e4650a3edf220e135 (diff) | |
download | gdb-33ac96f04d2916d07bf8922c63de9d6eb1eda74b.zip gdb-33ac96f04d2916d07bf8922c63de9d6eb1eda74b.tar.gz gdb-33ac96f04d2916d07bf8922c63de9d6eb1eda74b.tar.bz2 |
gdb/
Code cleanup.
* dwarf2read.c (die_type, die_descriptive_type): Remove variable type.
Remove check of NULL returned by tag_type_to_type.
(die_containing_type): Remove variable type. Remove type_die variable
initialization. Remove check of NULL returned by tag_type_to_type.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 42 |
2 files changed, 17 insertions, 33 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8b6b822..8bec7c1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2010-05-13 Jan Kratochvil <jan.kratochvil@redhat.com> + + Code cleanup. + * dwarf2read.c (die_type, die_descriptive_type): Remove variable type. + Remove check of NULL returned by tag_type_to_type. + (die_containing_type): Remove variable type. Remove type_die variable + initialization. Remove check of NULL returned by tag_type_to_type. + 2010-05-11 Pierre Muller <muller@ics.u-strasbg.fr> PR exp/11530. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0d4f61a..594a01a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8877,7 +8877,6 @@ dwarf2_const_value_data (struct attribute *attr, static struct type * die_type (struct die_info *die, struct dwarf2_cu *cu) { - struct type *type; struct attribute *type_attr; struct die_info *type_die; @@ -8890,14 +8889,7 @@ die_type (struct die_info *die, struct dwarf2_cu *cu) type_die = follow_die_ref_or_sig (die, type_attr, &cu); - type = tag_type_to_type (type_die, cu); - if (!type) - { - dump_die_for_error (type_die); - error (_("Dwarf Error: Problem turning type die at offset into gdb type [in module %s]"), - cu->objfile->name); - } - return type; + return tag_type_to_type (type_die, cu); } /* True iff CU's producer generates GNAT Ada auxiliary information @@ -8926,7 +8918,6 @@ need_gnat_info (struct dwarf2_cu *cu) static struct type * die_descriptive_type (struct die_info *die, struct dwarf2_cu *cu) { - struct type *type; struct attribute *type_attr; struct die_info *type_die; @@ -8935,14 +8926,7 @@ die_descriptive_type (struct die_info *die, struct dwarf2_cu *cu) return NULL; type_die = follow_die_ref (die, type_attr, &cu); - type = tag_type_to_type (type_die, cu); - if (!type) - { - dump_die_for_error (type_die); - error (_("Dwarf Error: Problem turning type die at offset into gdb type [in module %s]"), - cu->objfile->name); - } - return type; + return tag_type_to_type (type_die, cu); } /* If DIE has a descriptive_type attribute, then set the TYPE's @@ -8967,24 +8951,16 @@ set_descriptive_type (struct type *type, struct die_info *die, static struct type * die_containing_type (struct die_info *die, struct dwarf2_cu *cu) { - struct type *type = NULL; struct attribute *type_attr; - struct die_info *type_die = NULL; + struct die_info *type_die; type_attr = dwarf2_attr (die, DW_AT_containing_type, cu); - if (type_attr) - { - type_die = follow_die_ref_or_sig (die, type_attr, &cu); - type = tag_type_to_type (type_die, cu); - } - if (!type) - { - if (type_die) - dump_die_for_error (type_die); - error (_("Dwarf Error: Problem turning containing type into gdb type [in module %s]"), - cu->objfile->name); - } - return type; + if (!type_attr) + error (_("Dwarf Error: Problem turning containing type into gdb type " + "[in module %s]"), cu->objfile->name); + + type_die = follow_die_ref_or_sig (die, type_attr, &cu); + return tag_type_to_type (type_die, cu); } static struct type * |