diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-07-21 21:25:47 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-07-21 21:25:47 +0000 |
commit | 48873ed202e108b84d10358932a8cbf02c41f15e (patch) | |
tree | b8c3a0974d2bb92c973491e3808baf5224a7730d /gcc/c-decl.c | |
parent | dd039fc9e6cc2bf9214cb0ff87a07d0346829a59 (diff) | |
download | gcc-48873ed202e108b84d10358932a8cbf02c41f15e.zip gcc-48873ed202e108b84d10358932a8cbf02c41f15e.tar.gz gcc-48873ed202e108b84d10358932a8cbf02c41f15e.tar.bz2 |
c-common.h (num_in_fnames): Declare.
* c-common.h (num_in_fnames): Declare.
(c_static_assembler_name): Move from here...
* c-tree.h (c_static_assembler_name): ... to here.
* c-opts.c: Don't include langhooks-def.h.
(c_static_assembler_name): Move to c-decl.c.
(num_in_fnames): Make externally visible.
* c-decl.c: Include langhooks-def.h.
(c_static_assembler_name): Move from c-opts.c.
* Makefile.in (c-decl.o): Add $(LANGHOOKS_DEF_H).
(c-opts.o): Remove $(LANGHOOKS_DEF_H).
From-SVN: r69650
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 990b4ef..92a8d85 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -52,6 +52,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "hashtab.h" #include "libfuncs.h" #include "except.h" +#include "langhooks-def.h" /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context @@ -6771,6 +6772,22 @@ make_pointer_declarator (tree type_quals_attrs, tree target) return build1 (INDIRECT_REF, quals, itarget); } +/* A wrapper around lhd_set_decl_assembler_name that gives static + variables their C names if they are at the top level and only one + translation unit is being compiled, for backwards compatibility + with certain bizzare assembler hacks (like crtstuff.c). */ + +void +c_static_assembler_name (tree decl) +{ + if (num_in_fnames == 1 + && TREE_STATIC (decl) && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl) + && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL) + SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl)); + else + lhd_set_decl_assembler_name (decl); +} + /* Hash and equality functions for link_hash_table: key off DECL_ASSEMBLER_NAME. */ |