aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-22 14:44:09 -0600
committerTom Tromey <tom@tromey.com>2018-07-20 09:42:53 -0600
commit80e649fcac86101a8a4581317e867e89de015d28 (patch)
tree66a16b2c2b5afa37a1ac6509bc2096de4f4150f8 /gdb/cp-namespace.c
parent0baae8dbd38534c0f3dcedc7b9204bbc8f18de1b (diff)
downloadbinutils-80e649fcac86101a8a4581317e867e89de015d28.zip
binutils-80e649fcac86101a8a4581317e867e89de015d28.tar.gz
binutils-80e649fcac86101a8a4581317e867e89de015d28.tar.bz2
Parameterize cp_scan_for_anonymous_namespaces
This changes cp_scan_for_anonymous_namespaces to use the buildsym_compunit API, rather than the function-based API. gdb/ChangeLog 2018-07-20 Tom Tromey <tom@tromey.com> * stabsread.c (define_symbol): Update. * buildsym-legacy.h (get_buildsym_compunit): Declare. * dwarf2read.c (new_symbol): Update. * cp-support.h (cp_scan_for_anonymous_namespaces): Update. * cp-namespace.c: Include buildsym.h. (cp_scan_for_anonymous_namespaces): Add "compunit" parameter. * buildsym-legacy.c (get_buildsym_compunit): New function.
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r--gdb/cp-namespace.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index ef0c823..9ee2439 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -29,7 +29,7 @@
#include "dictionary.h"
#include "command.h"
#include "frame.h"
-#include "buildsym-legacy.h"
+#include "buildsym.h"
#include "language.h"
#include "namespace.h"
#include <string>
@@ -50,7 +50,8 @@ static struct type *cp_lookup_transparent_type_loop (const char *name,
anonymous namespace; if so, add an appropriate using directive. */
void
-cp_scan_for_anonymous_namespaces (const struct symbol *const symbol,
+cp_scan_for_anonymous_namespaces (struct buildsym_compunit *compunit,
+ const struct symbol *const symbol,
struct objfile *const objfile)
{
if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
@@ -94,9 +95,9 @@ cp_scan_for_anonymous_namespaces (const struct symbol *const symbol,
namespace given by the previous component if there is
one, or to the global namespace if there isn't. */
std::vector<const char *> excludes;
- add_using_directive (get_local_using_directives (),
- dest, src, NULL, NULL, excludes, 1,
- &objfile->objfile_obstack);
+ add_using_directive (compunit->get_local_using_directives (),
+ dest, src, NULL, NULL, excludes,
+ 1, &objfile->objfile_obstack);
}
/* The "+ 2" is for the "::". */
previous_component = next_component + 2;