From ae0686dd0be55830a946743f0b35b260b5bf0f91 Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 8 Jul 2004 19:49:08 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84306 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/langhooks.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'gcc/langhooks.c') diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 1b2a84e20ed..1400a6c9786 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)); } } -- cgit v1.2.1