public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Factor mangled id computation (issue5311075)
@ 2011-10-30 23:50 Diego Novillo
  2011-10-31  7:58 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Diego Novillo @ 2011-10-30 23:50 UTC (permalink / raw)
  To: reply, jason, gcc-patches


This factors the computation of mangled names so it can be called
without actually setting the assembler name on the DECL.  It is used
in the pph branch for merging symbols that are replicated in multiple
images.

On trunk, it changes nothing, but it sets it up for when we are ready
to merge the pph branch.  OK for trunk?


Thanks.  Diego.


	* mangle.c (get_mangled_id): Factor from ...
	(mangle_decl): ... here.
	Call get_mangled_id.

diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 8bc26d8..69fe147 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3177,13 +3177,21 @@ mangle_decl_string (const tree decl)
   return result;
 }
 
+/* Return an identifier for the external mangled name of DECL.  */
+
+static tree
+get_mangled_id (tree decl)
+{
+  tree id = mangle_decl_string (decl);
+  return targetm.mangle_decl_assembler_name (decl, id);
+}
+
 /* Create an identifier for the external mangled name of DECL.  */
 
 void
 mangle_decl (const tree decl)
 {
-  tree id = mangle_decl_string (decl);
-  id = targetm.mangle_decl_assembler_name (decl, id);
+  tree id = get_mangled_id (decl);
   SET_DECL_ASSEMBLER_NAME (decl, id);
 
   if (G.need_abi_warning)
-- 
1.7.3.1


--
This patch is available for review at http://codereview.appspot.com/5311075

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Factor mangled id computation (issue5311075)
  2011-10-30 23:50 Factor mangled id computation (issue5311075) Diego Novillo
@ 2011-10-31  7:58 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2011-10-31  7:58 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, gcc-patches

OK.

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-31  5:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-30 23:50 Factor mangled id computation (issue5311075) Diego Novillo
2011-10-31  7:58 ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).