aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-04 05:27:52 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-08-04 05:27:52 +0000
commit73a8adb62e1609c94e21903fe9c261b6d30a8415 (patch)
treedc4c187d7c4a64c15aab2950413405f2b750eaf1 /gcc/cp/rtti.c
parentaed6152d8c55eb6e756b7459733a8bfda3dd00a3 (diff)
downloadgcc-73a8adb62e1609c94e21903fe9c261b6d30a8415.zip
gcc-73a8adb62e1609c94e21903fe9c261b6d30a8415.tar.gz
gcc-73a8adb62e1609c94e21903fe9c261b6d30a8415.tar.bz2
class.c (build_vtable): Do not set DECL_VISIBILITY here.
* class.c (build_vtable): Do not set DECL_VISIBILITY here. (check_field_decls): Or here. (check_methods): Or here. (initialize_array): Don't mess with DECL_CONTEXT. * cp-tree.h (start_decl): Adjust prototype. (determine_visibility): New function. * decl.c (duplicate_decls): Remove checks for hidden "operator new". (build_library_fn_1): Give all library functions default visibility. (start_decl): Add pop_scope_p parameter. Tidy. (cp_finish_decl): Do not pop scopes here. Call determine_visibility for variable definitions. (start_preparsed_function): Call determine_visibility. * decl2.c (determine_visibility): New function. * method.c (use_thunk): Fix formatting. * parser.c (cp_parser_condition): Adjust calls to start_decl. (cp_parser_init_declarator): Likewise. * pt.c (instantiate_decl): Always call pop_nested_class. * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY. (tinfo_base_init): Likewise. * g++.dg/ext/visibility/assign1.C: New test. * g++.dg/ext/visibility/new1.C: Likewise. From-SVN: r85543
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 83e24c4..a59af79 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -346,6 +346,8 @@ get_tinfo_decl (tree type)
d = build_lang_decl (VAR_DECL, name, TINFO_PSEUDO_TYPE (var_desc));
SET_DECL_ASSEMBLER_NAME (d, name);
+ /* Remember the type it is for. */
+ TREE_TYPE (name) = type;
DECL_TINFO_P (d) = 1;
DECL_ARTIFICIAL (d) = 1;
TREE_READONLY (d) = 1;
@@ -354,20 +356,11 @@ get_tinfo_decl (tree type)
define it later if we need to do so. */
DECL_EXTERNAL (d) = 1;
DECL_NOT_REALLY_EXTERN (d) = 1;
+ if (CLASS_TYPE_P (type))
+ CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
set_linkage_according_to_type (type, d);
-
pushdecl_top_level_and_finish (d, NULL_TREE);
- if (CLASS_TYPE_P (type))
- {
- CLASSTYPE_TYPEINFO_VAR (TYPE_MAIN_VARIANT (type)) = d;
- DECL_VISIBILITY (d) = CLASSTYPE_VISIBILITY (type);
- DECL_VISIBILITY_SPECIFIED (d) = CLASSTYPE_VISIBILITY_SPECIFIED (type);
- }
-
- /* Remember the type it is for. */
- TREE_TYPE (name) = type;
-
/* Add decl to the global array of tinfo decls. */
my_friendly_assert (unemitted_tinfo_decls != 0, 20030312);
VARRAY_PUSH_TREE (unemitted_tinfo_decls, d);
@@ -791,18 +784,12 @@ tinfo_base_init (tree desc, tree target)
TREE_TYPE (name_name) = target;
name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
-
+ SET_DECL_ASSEMBLER_NAME (name_decl, name_name);
DECL_ARTIFICIAL (name_decl) = 1;
TREE_READONLY (name_decl) = 1;
TREE_STATIC (name_decl) = 1;
DECL_EXTERNAL (name_decl) = 0;
DECL_TINFO_P (name_decl) = 1;
- if (CLASS_TYPE_P (target))
- {
- DECL_VISIBILITY (name_decl) = CLASSTYPE_VISIBILITY (target);
- DECL_VISIBILITY_SPECIFIED (name_decl)
- = CLASSTYPE_VISIBILITY_SPECIFIED (target);
- }
if (involves_incomplete_p (target))
{
TREE_PUBLIC (name_decl) = 0;
@@ -811,10 +798,6 @@ tinfo_base_init (tree desc, tree target)
else
set_linkage_according_to_type (target, name_decl);
import_export_decl (name_decl);
- /* External name of the string containing the type's name has a
- special name. */
- SET_DECL_ASSEMBLER_NAME (name_decl,
- mangle_typeinfo_string_for_type (target));
DECL_INITIAL (name_decl) = name_string;
mark_used (name_decl);
pushdecl_top_level_and_finish (name_decl, name_string);