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>
This commit is contained in:
Tom Tromey
2024-04-10 11:48:13 -06:00
parent 35d6915157
commit 12406b2cda
4 changed files with 13 additions and 32 deletions

View File

@@ -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;