aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-11-13 09:39:11 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-11-13 04:39:11 -0500
commit794d4a61f8208daf82205681b6081fa560b68ddd (patch)
tree45520d80ba13438efbfeed405494e430fddd89e8 /gcc
parent78df89edfa46a674d81fa6a21170037a28d6a36e (diff)
downloadgcc-794d4a61f8208daf82205681b6081fa560b68ddd.zip
gcc-794d4a61f8208daf82205681b6081fa560b68ddd.tar.gz
gcc-794d4a61f8208daf82205681b6081fa560b68ddd.tar.bz2
decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
* decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT. * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. * class.c (set_rtti_entry): Use it. From-SVN: r30523
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/rtti.c25
6 files changed, 36 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4273726..8bd88f3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+1999-11-13 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
+ * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
+ * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
+ * class.c (set_rtti_entry): Use it.
+
1999-11-12 Mark Mitchell <mark@codesourcery.com>
* decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a1ac9cd..73a9dc9 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -652,7 +652,7 @@ set_rtti_entry (virtuals, offset, type)
return;
if (flag_rtti)
- fn = get_tinfo_fn (type);
+ fn = get_tinfo_fn_unused (type);
else
/* If someone tries to get RTTI information for a type compiled
without RTTI, they're out of luck. By calling __pure_virtual
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index f4059a2..ac9d37a 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3792,6 +3792,7 @@ extern tree get_tinfo_fn_dynamic PROTO((tree));
extern tree build_typeid PROTO((tree));
extern tree build_x_typeid PROTO((tree));
extern tree get_tinfo_fn PROTO((tree));
+extern tree get_tinfo_fn_unused PROTO((tree));
extern tree get_typeid PROTO((tree));
extern tree get_typeid_1 PROTO((tree));
extern tree build_dynamic_cast PROTO((tree, tree));
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fd4361a..f01d4de 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3408,6 +3408,7 @@ duplicate_decls (newdecl, olddecl)
/* Merge the storage class information. */
DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
DECL_ONE_ONLY (newdecl) |= DECL_ONE_ONLY (olddecl);
+ DECL_DEFER_OUTPUT (newdecl) |= DECL_DEFER_OUTPUT (olddecl);
TREE_PUBLIC (newdecl) = TREE_PUBLIC (olddecl);
TREE_STATIC (olddecl) = TREE_STATIC (newdecl) |= TREE_STATIC (olddecl);
if (! DECL_EXTERNAL (olddecl))
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 5624767..2d57b78 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2355,6 +2355,9 @@ comdat_linkage (decl)
if (DECL_LANG_SPECIFIC (decl))
DECL_COMDAT (decl) = 1;
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ DECL_DEFER_OUTPUT (decl) = 1;
}
/* For win32 we also want to put explicit instantiations in
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 87d6df1..71a0000 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -361,8 +361,19 @@ get_tinfo_var (type)
return tdecl;
}
+/* Returns the decl for a function which will return a type_info node for
+ TYPE. This version does not mark the function used, for use in
+ set_rtti_entry; for the vtable case, we'll get marked in
+ finish_vtable_vardecl, when we know that we want to be emitted.
+
+ We do this to avoid emitting the tinfo node itself, since we don't
+ currently support DECL_DEFER_OUTPUT for variables. Also, we don't
+ associate constant pools with their functions properly, so we would
+ emit string constants and such even though we don't emit the actual
+ function. When those bugs are fixed, this function should go away. */
+
tree
-get_tinfo_fn (type)
+get_tinfo_fn_unused (type)
tree type;
{
tree name;
@@ -391,13 +402,23 @@ get_tinfo_fn (type)
pushdecl_top_level (d);
make_function_rtl (d);
- mark_used (d);
mark_inline_for_output (d);
pop_obstacks ();
return d;
}
+/* Likewise, but also mark it used. Called by various EH and RTTI code. */
+
+tree
+get_tinfo_fn (type)
+ tree type;
+{
+ tree d = get_tinfo_fn_unused (type);
+ mark_used (d);
+ return d;
+}
+
tree
get_typeid_1 (type)
tree type;