This patch adds using directive and using decls support
in dwarf2out.c (and namespace alias).
More information about this patch is in this msg:
http://gcc.gnu.org/ml/gcc/2003-12/msg00336.html
Bootstrapped and tested on i686-pc-linux-gnu.
GDB test run does not reveal any new regression.
(I used David Carlton's carlton_dictionary-branch for GDB testing).
I also hand coded few examples and analyzed dwarf output.
OK for mainline ?
--
Devang
2003-12-11 Devang Patel <dpatel@apple.com>
* dbxout.c (dbx_debug_hooks): Add new empty hook for
imported_module_or_decl.
(xcoff_debug_hooks): Same.
* debug.c (do_nothing_debug_hooks): Same.
* dwarfout.c (dwarf_debug_hooks): Same.
* sdbout.c (sdb_debug_hooks): Same.
* vmsdbgout.c (vmsdbg_debug_hooks): Same.
(debug_nothing_tree_tree_int): New function.
* debug.h (gcc_debug_hooks): New hook, imported_module_or_decl.
(dbg_module_or_decl): New enum.
* dwarf2out.c: Include input.h.
(dwarf2_debug_hooks): Add new hook for imported_module_or_decl.
(dwarf_tag_name): Handle DW_TAG_imported_module.
(gen_decl_die): Output DIE to represent the function itself iff
we are emiting primary DIE for the decl. Setup namespace
context
for VAR_DECL.
(dwarf2out_imported_module_or_decl): New function.
(dwarf2out_decl): Add DECL_CONTEXT check for FUNCTION_DECL.
(force_namespace_die): Replace it with ...
(force_decl_die): ... this.
(force_type_die): New function.
(setup_namespace_context): Replace use of
force_namespace_die() with
force_decl_die().
(gen_namespace_die): Same.
* Makefile.in (dwarf2out.o): Depend on input.h
cp:
* name-lookup.c: Include "debug.h"
(do_namespace_alias): Invoke debug_hooks to emit debug info
for namespace alias.
* parser.c: Include "debug.h"
(cp_emit_debug_info_for_using): New function.
(cp_parser_using_declaration): Emit debug info for using decl.
(cp_parser_using_directive): Invoke debug_hooks to emit debug
info for using directive.
* Make-lang.in (cp/parser.o): Depend on debug.h
(cp/name-lookup.o): Same.
testsuite:
g++.dg/debug/namespace1.C: New test.