aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-04-10 11:48:13 -0600
committerTom Tromey <tromey@adacore.com>2024-04-15 11:45:33 -0600
commit12406b2cdab40fd05df65c4fe4aabaf4882fcc8e (patch)
tree18d3e87d9450ee498d254daddc1cedc21a34cdb2 /gdb/cp-namespace.c
parent35d691515799a8cf7b82a1cb934dadb6a85b022f (diff)
downloadgdb-12406b2cdab40fd05df65c4fe4aabaf4882fcc8e.zip
gdb-12406b2cdab40fd05df65c4fe4aabaf4882fcc8e.tar.gz
gdb-12406b2cdab40fd05df65c4fe4aabaf4882fcc8e.tar.bz2
Remove 'copy_names' parameter from add_using_directive
I noticed that add_using_directive's 'copy_names' parameter is only used by a single caller. This patch removes the parameter and changes that caller to copy the names itself. I chose to use intern here since I suspect the names may well be repeated in a given objfile. Approved-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r--gdb/cp-namespace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index ec72d72..4434ddf 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -100,8 +100,9 @@ cp_scan_for_anonymous_namespaces (struct buildsym_compunit *compunit,
to 0, this way it is always considered valid. */
std::vector<const char *> excludes;
add_using_directive (compunit->get_local_using_directives (),
- dest, src, NULL, NULL, excludes, 0,
- 1, &objfile->objfile_obstack);
+ objfile->intern (dest), objfile->intern (src),
+ nullptr, nullptr, excludes, 0,
+ &objfile->objfile_obstack);
}
/* The "+ 2" is for the "::". */
previous_component = next_component + 2;