diff options
author | Daniel Jacobowitz <dan@codesourcery.com> | 2006-08-01 14:23:58 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@gcc.gnu.org> | 2006-08-01 14:23:58 +0000 |
commit | 6193b8b7edb139ddf475352a0822482f16be4a2d (patch) | |
tree | 8de0634b83102dd0cc5f4b28594ecb7f65a6dd52 /gcc/dwarf2out.c | |
parent | 9824b8867a2c169ee38947d191ba646786586ae6 (diff) | |
download | gcc-6193b8b7edb139ddf475352a0822482f16be4a2d.zip gcc-6193b8b7edb139ddf475352a0822482f16be4a2d.tar.gz gcc-6193b8b7edb139ddf475352a0822482f16be4a2d.tar.bz2 |
re PR debug/23336 (enum constants not visible to gdb because of -feliminate-unused-debug-types)
gcc/
PR debug/23336
* c-typeck.c (build_external_type): Mark used enum types.
* dwarf2out.c (dwarf2out_abstract_function): Save and restore
cfun also.
(gen_subprogram_die): Whitespace fix.
gcc/cp/
PR debug/23336
* pt.c (tsubst_copy_and_build): Mark used enum types.
* semantics.c (finish_id_expression): Likewise.
gcc/testsuite/
PR debug/23336
* lib/gcc-dg.exp (gcc-dg-debug-runtest): Suppress new tests
at -g1.
* gcc.dg/debug/enum-1.c, g++.dg/debug/enum-1.C,
g++.dg/debug/enum-2.C: New.
From-SVN: r115853
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 3d0c890..41aa5ac 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11457,6 +11457,7 @@ dwarf2out_abstract_function (tree decl) { dw_die_ref old_die; tree save_fn; + struct function *save_cfun; tree context; int was_abstract = DECL_ABSTRACT (decl); @@ -11480,7 +11481,9 @@ dwarf2out_abstract_function (tree decl) /* Pretend we've just finished compiling this function. */ save_fn = current_function_decl; + save_cfun = cfun; current_function_decl = decl; + cfun = DECL_STRUCT_FUNCTION (decl); set_decl_abstract_flags (decl, 1); dwarf2out_decl (decl); @@ -11488,6 +11491,7 @@ dwarf2out_abstract_function (tree decl) set_decl_abstract_flags (decl, 0); current_function_decl = save_fn; + cfun = save_cfun; } /* Helper function of premark_used_types() which gets called through @@ -11531,7 +11535,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) int declaration = (current_function_decl != decl || class_or_namespace_scope_p (context_die)); - premark_used_types(); + premark_used_types (); /* It is possible to have both DECL_ABSTRACT and DECLARATION be true if we started to generate the abstract instance of an inline, decided to output |