diff options
author | Mark Mitchell <mark@codesourcery.com> | 2001-04-19 22:49:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2001-04-19 22:49:48 +0000 |
commit | 5d2ed28c27166bc105ec9fe3a9a18af5c1409010 (patch) | |
tree | be41a31f61cfc5955ed9ac031129b966e6b6e950 /gcc/cp/mangle.c | |
parent | 45936a85bc20fdfa776dbd17069c941806b45420 (diff) | |
download | gcc-5d2ed28c27166bc105ec9fe3a9a18af5c1409010.tar.gz |
cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is set.
* cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is
set.
(SET_DECL_LANGUAGE): New macro.
* decl.c (duplicate_decls): Use SET_DECL_LANGUAGE.
(pushdecl): Likewise.
(build_library_fn_1): Likewise.
(build_cp_library_fn): Likewise.
(grokfndecl): Likewise.
(grokvardecl): Mark `extern "C"' variables as having C linkage.
* decl2.c (grokclassfn): Use SET_DECL_LANGUAGE.
* lex.c (retrofit_lang_decl): Likewise.
* mangle.c (mangle_decl_string): Don't mangle the names of
variables declared with C language linkage.
* semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE.
From-SVN: r41430
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 18f99a10fbf..7b6857d6793 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2085,17 +2085,15 @@ mangle_decl_string (decl) if (TREE_CODE (decl) == TYPE_DECL) write_type (TREE_TYPE (decl)); else if (/* The names of `extern "C"' functions are not mangled. */ - (TREE_CODE (decl) == FUNCTION_DECL + (DECL_EXTERN_C_FUNCTION_P (decl) /* But overloaded operator names *are* mangled. */ - && !DECL_OVERLOADED_OPERATOR_P (decl) - /* If there's no DECL_LANG_SPECIFIC, it's a function built - by language-independent code, which never builds - functions with C++ linkage. */ - && (!DECL_LANG_SPECIFIC (decl) - || DECL_EXTERN_C_FUNCTION_P (decl))) + && !DECL_OVERLOADED_OPERATOR_P (decl)) /* The names of global variables aren't mangled either. */ || (TREE_CODE (decl) == VAR_DECL - && CP_DECL_CONTEXT (decl) == global_namespace)) + && CP_DECL_CONTEXT (decl) == global_namespace) + /* And neither are `extern "C"' variables. */ + || (TREE_CODE (decl) == VAR_DECL + && DECL_EXTERN_C_P (decl))) write_string (IDENTIFIER_POINTER (DECL_NAME (decl))); else { |