Re: [google/gcc-4_9] Minor changes to -ftwo-level-line-tables

2015-03-03 Thread Cary Coutant
 @@ -21817,22 +21823,39 @@ out_subprog_directive (subprog_entry *su
  {
tree decl = subprog-decl;
tree decl_name = DECL_NAME (decl);
 -  const char *name;
 +  tree origin;

 Explicitly initialize origin to NULL_TREE;

Done.

 +  /* For inlined subroutines, use the linkage name.
 + If -ftwo-level-all-subprogs is set, use the linkage name
 + for all subroutines.  */
 +  if (subprog-is_inlined || flag_two_level_all_subprogs)
  {
 -  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
 -  if (name[0] == '*')
 -name++;
 +  if (DECL_ASSEMBLER_NAME (origin))
 +   {
 + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (origin));
 + if (name[0] == '*')
 +   name++;
 +   }
 +  else
 +   name = dwarf2_name (origin, 0);
  }
else
 -name = dwarf2_name (decl, 0);
 +{
 +  /* To save space, we don't emit the name for non-inlined
 + subroutines, whose linkage names are available from the
 + object file's symbol table.  */

 flag_two_level_all_subprogs will be 1 by default. This mean else
 branch is not the default behavior?

No, I changed the default in common.opt:

 ftwo-level-all-subprogs
-Common Report Var(flag_two_level_all_subprogs) Init(1)
+Common Report Var(flag_two_level_all_subprogs) Init(0)
 When generating two-level line tables in DWARF (experimental),
-generate subprogram table entries for all functions.
+add linkage names for all functions (not just inlined functions).

-cary


Re: [google/gcc-4_9] Minor changes to -ftwo-level-line-tables

2015-03-03 Thread Dehao Chen
ok for google branch.

Dehao

On Tue, Mar 3, 2015 at 12:26 PM, Cary Coutant ccout...@google.com wrote:
 @@ -21817,22 +21823,39 @@ out_subprog_directive (subprog_entry *su
  {
tree decl = subprog-decl;
tree decl_name = DECL_NAME (decl);
 -  const char *name;
 +  tree origin;

 Explicitly initialize origin to NULL_TREE;

 Done.

 +  /* For inlined subroutines, use the linkage name.
 + If -ftwo-level-all-subprogs is set, use the linkage name
 + for all subroutines.  */
 +  if (subprog-is_inlined || flag_two_level_all_subprogs)
  {
 -  name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
 -  if (name[0] == '*')
 -name++;
 +  if (DECL_ASSEMBLER_NAME (origin))
 +   {
 + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (origin));
 + if (name[0] == '*')
 +   name++;
 +   }
 +  else
 +   name = dwarf2_name (origin, 0);
  }
else
 -name = dwarf2_name (decl, 0);
 +{
 +  /* To save space, we don't emit the name for non-inlined
 + subroutines, whose linkage names are available from the
 + object file's symbol table.  */

 flag_two_level_all_subprogs will be 1 by default. This mean else
 branch is not the default behavior?

 No, I changed the default in common.opt:

  ftwo-level-all-subprogs
 -Common Report Var(flag_two_level_all_subprogs) Init(1)
 +Common Report Var(flag_two_level_all_subprogs) Init(0)
  When generating two-level line tables in DWARF (experimental),
 -generate subprogram table entries for all functions.
 +add linkage names for all functions (not just inlined functions).

 -cary