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

Reply via email to