aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-08 13:40:54 -0700
committerTom Tromey <tom@tromey.com>2020-02-08 13:43:24 -0700
commitb3b3227982613ac926b58b84e16867624ae0ed04 (patch)
tree6562b7fb11721b9ca4c8d5337d25d83f53789eaf /gdb
parent1d33d811c708941532410850db8279ba30995252 (diff)
downloadgdb-b3b3227982613ac926b58b84e16867624ae0ed04.zip
gdb-b3b3227982613ac926b58b84e16867624ae0ed04.tar.gz
gdb-b3b3227982613ac926b58b84e16867624ae0ed04.tar.bz2
Minor simplification in abbrev_table::read
abbrev_table::read increments cur_abbrev->num_attrs in the inner loop, but there's no need to do this, as the information is already stored in the temporary vector. 2020-02-08 Tom Tromey <tom@tromey.com> * dwarf2/abbrev.c (abbrev_table::read): Simplify. Change-Id: I765f12850ffa1c6066e884bb22c94468d1abdba4
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/dwarf2/abbrev.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ab20877..2dc3a7c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2020-02-08 Tom Tromey <tom@tromey.com>
+ * dwarf2/abbrev.c (abbrev_table::read): Simplify.
+
+2020-02-08 Tom Tromey <tom@tromey.com>
+
* dwarf2/abbrev.c (abbrev_table): Move constructor from header.
Rewrite.
(abbrev_table::add_abbrev, abbrev_table::lookup_abbrev): Rewrite.
diff --git a/gdb/dwarf2/abbrev.c b/gdb/dwarf2/abbrev.c
index f843e32..59ff138 100644
--- a/gdb/dwarf2/abbrev.c
+++ b/gdb/dwarf2/abbrev.c
@@ -162,9 +162,9 @@ abbrev_table::read (struct objfile *objfile,
cur_attr.name = (enum dwarf_attribute) abbrev_name;
cur_attr.form = (enum dwarf_form) abbrev_form;
cur_attr.implicit_const = implicit_const;
- ++cur_abbrev->num_attrs;
}
+ cur_abbrev->num_attrs = cur_attrs.size ();
cur_abbrev->attrs =
XOBNEWVEC (&abbrev_table->m_abbrev_obstack, struct attr_abbrev,
cur_abbrev->num_attrs);