Patchwork [google] make the temp names in FDO/LIPO demanglable (issue6251048)

login
register
mail settings
Submitter Rong Xu
Date May 24, 2012, 6:38 p.m.
Message ID <20120524183858.1C613C1B3C@rong.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/161188/
State New
Headers show

Comments

Rong Xu - May 24, 2012, 6:38 p.m.
Hi,

This is for google branches only.

It changes the format of the temp function name so that they
can be demangled.

Tested with regression tests.

Google ref b/5733865.

Thanks,

2012-05-24   Rong Xu  <xur@google.com>

	* l-ipo.c (create_unique_name): Make temp names demanglable.


--
This patch is available for review at http://codereview.appspot.com/6251048
Xinliang David Li - May 24, 2012, 6:39 p.m.
Ok.

David

On Thu, May 24, 2012 at 11:38 AM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> This is for google branches only.
>
> It changes the format of the temp function name so that they
> can be demangled.
>
> Tested with regression tests.
>
> Google ref b/5733865.
>
> Thanks,
>
> 2012-05-24   Rong Xu  <xur@google.com>
>
>        * l-ipo.c (create_unique_name): Make temp names demanglable.
>
> Index: l-ipo.c
> ===================================================================
> --- l-ipo.c     (revision 187817)
> +++ l-ipo.c     (working copy)
> @@ -1726,15 +1726,15 @@ create_unique_name (tree decl, unsigned module_id)
>       char *n;
>       unsigned fno =  FUNC_DECL_FUNC_ID (context);
>       n = (char *)alloca (strlen (name) + 15);
> -      sprintf (n, "%s_%u", name, fno);
> +      sprintf (n, "%s.%u", name, fno);
>       name = n;
>     }
>
>   assembler_name = (char*) alloca (strlen (name) + 30);
> -  sprintf (assembler_name, "%s_cmo_%u", name, module_id);
> +  sprintf (assembler_name, "%s.cmo.%u", name, module_id);
>   seq = get_name_seq_num (assembler_name);
>   if (seq)
> -    sprintf (assembler_name, "%s_%d", assembler_name, seq);
> +    sprintf (assembler_name, "%s.%d", assembler_name, seq);
>
>   assemb_id = get_identifier (assembler_name);
>
>
> --
> This patch is available for review at http://codereview.appspot.com/6251048

Patch

Index: l-ipo.c
===================================================================
--- l-ipo.c	(revision 187817)
+++ l-ipo.c	(working copy)
@@ -1726,15 +1726,15 @@  create_unique_name (tree decl, unsigned module_id)
       char *n;
       unsigned fno =  FUNC_DECL_FUNC_ID (context);
       n = (char *)alloca (strlen (name) + 15);
-      sprintf (n, "%s_%u", name, fno);
+      sprintf (n, "%s.%u", name, fno);
       name = n;
     }
 
   assembler_name = (char*) alloca (strlen (name) + 30);
-  sprintf (assembler_name, "%s_cmo_%u", name, module_id);
+  sprintf (assembler_name, "%s.cmo.%u", name, module_id);
   seq = get_name_seq_num (assembler_name);
   if (seq)
-    sprintf (assembler_name, "%s_%d", assembler_name, seq);
+    sprintf (assembler_name, "%s.%d", assembler_name, seq);
 
   assemb_id = get_identifier (assembler_name);