diff options
author | Tom Tromey <tom@tromey.com> | 2020-09-29 18:49:08 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-09-29 20:29:06 -0600 |
commit | 3b64bf15bc96d83e49521048bfe3eacf25d3649d (patch) | |
tree | c42e458b20d687fcc1f9ae83c6da7df624266a79 /gdb/dwarf2/read.c | |
parent | 2c830f547588220588f2a0a876b86e3f9062f9e1 (diff) | |
download | binutils-3b64bf15bc96d83e49521048bfe3eacf25d3649d.zip binutils-3b64bf15bc96d83e49521048bfe3eacf25d3649d.tar.gz binutils-3b64bf15bc96d83e49521048bfe3eacf25d3649d.tar.bz2 |
Remove some uses of DW_STRING_IS_CANONICAL
This removes the rvalue uses of DW_STRING_IS_CANONICAL, replacing them
with an accessor method.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (anonymous_struct_prefix, dwarf2_name)
(dump_die_shallow): Use canonical_string_p.
* dwarf2/attribute.h (struct attribute) <canonical_string_p>: New
method.
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r-- | gdb/dwarf2/read.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 70d2091..f090cb3 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -22312,7 +22312,7 @@ anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu) return NULL; /* dwarf2_name had to be already called. */ - gdb_assert (DW_STRING_IS_CANONICAL (attr)); + gdb_assert (attr->canonical_string_p ()); /* Strip the base name, keep any leading namespaces/classes. */ base = strrchr (attr_name, ':'); @@ -22638,7 +22638,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) /* Avoid demangling attr_name the second time on a second call for the same DIE. */ - if (!DW_STRING_IS_CANONICAL (attr)) + if (!attr->canonical_string_p ()) { gdb::unique_xmalloc_ptr<char> demangled (gdb_demangle (attr_name, DMGL_TYPES)); @@ -22664,7 +22664,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) break; } - if (!DW_STRING_IS_CANONICAL (attr)) + if (!attr->canonical_string_p ()) { DW_STRING (attr) = dwarf2_canonicalize_name (attr_name, cu, objfile); @@ -22786,7 +22786,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) fprintf_unfiltered (f, "string: \"%s\" (%s canonicalized)", DW_STRING (&die->attrs[i]) ? DW_STRING (&die->attrs[i]) : "", - DW_STRING_IS_CANONICAL (&die->attrs[i]) ? "is" : "not"); + die->attrs[i].canonical_string_p () ? "is" : "not"); break; case DW_FORM_flag: if (DW_UNSND (&die->attrs[i])) |