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.
This commit is contained in:
Tom Tromey
2018-05-22 14:44:09 -06:00
parent 0baae8dbd3
commit 80e649fcac
7 changed files with 36 additions and 8 deletions

View File

@@ -375,3 +375,12 @@ scoped_free_pendings::~scoped_free_pendings ()
{
free_buildsym_compunit ();
}
/* See buildsym-legacy.h. */
struct buildsym_compunit *
get_buildsym_compunit ()
{
gdb_assert (buildsym_compunit != nullptr);
return buildsym_compunit;
}