From: jason Date: Sat, 13 Nov 1999 09:39:11 +0000 (+0000) Subject: * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73aad9b9712041752a0f57c47f5fcac841f9b3a9;p=platform%2Fupstream%2Flinaro-gcc.git * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30523 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 + + * 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 * 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;