aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-02-04 08:35:11 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-02-04 08:35:11 +0000
commit97458258b8e196f88ba17d4ed985aece3ec5675c (patch)
tree1c27fa8594fbc42a3c7557f4dbff567d0733267c /gcc/cp/decl2.c
parent1ca894a0e403de4be67483069f8b59059ad53a31 (diff)
downloadgcc-97458258b8e196f88ba17d4ed985aece3ec5675c.zip
gcc-97458258b8e196f88ba17d4ed985aece3ec5675c.tar.gz
gcc-97458258b8e196f88ba17d4ed985aece3ec5675c.tar.bz2
cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting.
* cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting. Document. (CLASSTYPE_INTERFACE_KNOWN): Likewise. (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. * decl.c (maybe_commonize_var): Use the new name-mangling where appropriate. * decl2.c (comdat_linkage): Enhance comments. Make all compiler-generated things static, if COMDAT is not available. (get_tinfo_decl): Do not make typeinfo objects that belong in the library COMDAT. (tinfo_base_init): Use the correct mangled name for typeinfo strings, and push them into the global scope. (typeinfo_in_lib_p): New function. (synthesize_tinfo_var): Use it. (create_real_tinfo_var): Likewise. From-SVN: r39437
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 6088e10..2c3dbc7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2396,14 +2396,24 @@ comdat_linkage (decl)
{
if (flag_weak)
make_decl_one_only (decl);
- else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl))
- /* We can just emit functions and vtables statically; having
- multiple copies is (for the most part) only a waste of space.
- There is at least one correctness issue, however: the address
- of a template instantiation with external linkage should be the
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ || (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl)))
+ /* We can just emit function and compiler-generated variables
+ statically; having multiple copies is (for the most part) only
+ a waste of space.
+
+ There are two correctness issues, however: the address of a
+ template instantiation with external linkage should be the
same, independent of what translation unit asks for the
address, and this will not hold when we emit multiple copies of
- the function. However, there's little else we can do. */
+ the function. However, there's little else we can do.
+
+ Also, by default, the typeinfo implementation for the new ABI
+ assumes that there will be only one copy of the string used as
+ the name for each type. Therefore, if weak symbols are
+ unavailable, the run-time library should perform a more
+ conservative check; it should perform a string comparison,
+ rather than an address comparison. */
TREE_PUBLIC (decl) = 0;
else
{