aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-20 23:28:39 -0600
committerTom Tromey <tom@tromey.com>2018-07-16 08:55:22 -0600
commit6cccc9a89160455aab634784c231af4590d943f3 (patch)
treef9df8eaf98263018587b093ea8287b6c13a0c750 /gdb/dwarf2read.c
parent652788a73137d8c16ac67a0cf9a8e51dd336d09e (diff)
downloadgdb-6cccc9a89160455aab634784c231af4590d943f3.zip
gdb-6cccc9a89160455aab634784c231af4590d943f3.tar.gz
gdb-6cccc9a89160455aab634784c231af4590d943f3.tar.bz2
Move the using directives to buildsym_compunit
This moves the globals local_using_directives and global_using_directives to be members of buildsym_compunit, and adds the necessary accessors. gdb/ChangeLog 2018-07-16 Tom Tromey <tom@tromey.com> * dwarf2read.c (using_directives, read_func_scope) (read_lexical_block_scope): Update. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update. * buildsym.h (local_using_directives, global_using_directives): Don't declare. (get_local_using_directives, set_local_using_directives) (get_global_using_directives): Declare. * buildsym.c (struct buildsym_compunit) <m_local_using_directives, m_global_using_directives>: New members. (finish_block_internal, prepare_for_building) (reset_symtab_globals, end_symtab_get_static_block) (push_context): Update. (get_local_using_directives, set_local_using_directives) (get_global_using_directives): New functions. (buildsym_init): Update.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ff9d72c..74da35c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -11104,9 +11104,9 @@ static struct using_direct **
using_directives (enum language language)
{
if (language == language_ada && context_stack_depth == 0)
- return &global_using_directives;
+ return get_global_using_directives ();
else
- return &local_using_directives;
+ return get_local_using_directives ();
}
/* Read the import statement specified by the given die and record it. */
@@ -13721,7 +13721,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
when we finish processing a function scope, we may need to go
back to building a containing block's symbol lists. */
local_symbols = newobj->locals;
- local_using_directives = newobj->local_using_directives;
+ set_local_using_directives (newobj->local_using_directives);
/* If we've finished processing a top-level function, subsequent
symbols go in the file symbol list. */
@@ -13779,7 +13779,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
inherit_abstract_dies (die, cu);
newobj = pop_context ();
- if (local_symbols != NULL || local_using_directives != NULL)
+ if (local_symbols != NULL || (*get_local_using_directives ()) != NULL)
{
struct block *block
= finish_block (0, &local_symbols, newobj->old_blocks, NULL,
@@ -13798,7 +13798,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
dwarf2_record_block_ranges (die, block, baseaddr, cu);
}
local_symbols = newobj->locals;
- local_using_directives = newobj->local_using_directives;
+ set_local_using_directives (newobj->local_using_directives);
}
/* Read in DW_TAG_call_site and insert it to CU->call_site_htab. */