diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2004-07-08 19:49:08 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2004-07-08 19:49:08 +0000 |
commit | 5b02f0e0046d946792d7e05b569cb6d2c54442ee (patch) | |
tree | 4da42eccc0c6c979a20a5bd52c246aa67107bf03 /gcc/langhooks.c | |
parent | 95bcca470502e25b79b4b7820732d706bc7317aa (diff) | |
download | gcc-5b02f0e0046d946792d7e05b569cb6d2c54442ee.zip gcc-5b02f0e0046d946792d7e05b569cb6d2c54442ee.tar.gz gcc-5b02f0e0046d946792d7e05b569cb6d2c54442ee.tar.bz2 |
c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope decls when...
* c-decl.c (pop_scope): Do not set DECL_CONTEXT on file-scope
decls when there is only one input translation unit.
* langhooks.c (lhd_set_decl_assembler_name): Partially revert
change of 2004-07-05; do not treat declarations with
DECL_CONTEXT a TRANSLATION_UNIT_DECL specially.
* opts.c (cur_in_fname): Delete.
* opts.h: Likewise.
* tree.c: Revert changes of 2004-07-05; no special treatment
for TRANSLATION_UNIT_DECLs.
* Makefile.in (tree.o): Update dependencies.
From-SVN: r84306
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r-- | gcc/langhooks.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 1b2a84e..1400a6c 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -179,31 +179,15 @@ lhd_set_decl_assembler_name (tree decl) Can't use just the variable's own name for a variable whose scope is less than the whole compilation. Concatenate a - distinguishing number. If the decl is at block scope, the - number assigned is the DECL_UID; if the decl is at file - scope, the number is the DECL_UID of the surrounding - TRANSLATION_UNIT_DECL, except for the T_U_D with UID 0. - Those (the file-scope internal-linkage declarations from the - first input file) get no suffix, which is consistent with - what has historically been done for file-scope declarations - with internal linkage. */ - if (TREE_PUBLIC (decl) - || DECL_CONTEXT (decl) == NULL_TREE - || (TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL - && DECL_UID (DECL_CONTEXT (decl)) == 0)) + distinguishing number - we use the DECL_UID. */ + if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE) SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl)); else { const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); char *label; - unsigned int uid; - if (TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL) - uid = DECL_UID (DECL_CONTEXT (decl)); - else - uid = DECL_UID (decl); - - ASM_FORMAT_PRIVATE_NAME (label, name, uid); + ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label)); } } |