diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-03-08 11:21:28 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-03-08 11:21:28 +0000 |
commit | 2ce07e2d9247f692e424385deb1e8b154bf1b388 (patch) | |
tree | d0c5ae25c2c3150c4c348ac64a3fdbdef73e015a /gcc/cp/semantics.c | |
parent | 8ce5ef1923e1bc826b4159ecee825db5fc9b8cd9 (diff) | |
download | gcc-2ce07e2d9247f692e424385deb1e8b154bf1b388.zip gcc-2ce07e2d9247f692e424385deb1e8b154bf1b388.tar.gz gcc-2ce07e2d9247f692e424385deb1e8b154bf1b388.tar.bz2 |
c-common.h (make_fname_decl): Declare.
gcc:
* c-common.h (make_fname_decl): Declare.
* c-common.c (make_fname_decl): Define.
(declare_hidden_char_array): Remove.
(declare_function_name): Use make_fname_decl.
* c-decl.c (c_make_fname_decl): New function.
(init_decl_processing): Set make_fname_decl.
gcc/cp:
* decl.c (cp_make_fname_decl): New function.
(wrapup_globals_for_namespace): Don't emit unused static vars.
(init_decl_processing): Remove comment about use of
array_domain_type. Set make_fname_decl.
(cp_finish_decl): Remove __FUNCTION__ nadgering.
* semantics.c (begin_compound_stmt): Remove
current_function_name_declared flagging.
(expand_stmt): Don't emit unused local statics.
* typeck.c (decay_conversion): Don't treat __FUNCTION__ decls
specially.
From-SVN: r32418
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ad961f8..3402d3b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -980,13 +980,8 @@ begin_compound_stmt (has_no_scope) && !current_function_name_declared && !has_no_scope) { - /* When we get callbacks from the middle-end, we need to know - we're in the midst of declaring these variables. */ - current_function_name_declared = 2; - /* Actually insert the declarations. */ - declare_function_name (); - /* And now just remember that we're all done. */ current_function_name_declared = 1; + declare_function_name (); } return r; @@ -2397,7 +2392,11 @@ expand_stmt (t) expand_anon_union_decl (decl, NULL_TREE, DECL_ANON_UNION_ELEMS (decl)); } - else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) + else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) + && TREE_USED (decl)) + /* Do not emit unused decls. This is not just an + optimization. We really do not want to emit + __PRETTY_FUNCTION__ etc, if they're never used. */ make_rtl_for_local_static (decl); } break; |