When enabling free-lang-data the lang_hooks.decl_printable_name hook
gets reset.  The following patch reduces the noise from that by
using verbosity 1 (do not print arguments) from the places where
we dump the function name and then follow by arguments manually.

This makes dumping consistent with calls in the IL so you can
cut&paste & search in dumps easier (Ada dumps had case differences
for example).  This requires a few changes in the testsuite dump scans
(but not too many to make the change controversical).

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2017-08-23  Richard Biener  <rguent...@suse.de>

        * function.c (fndecl_name): Use verbosity 1 (no arguments) for
        lang_hooks.decl_printable_name.
        * print-rtl-function.c (print_rtx_function): Likewise.
        * tree-pretty-print.c (dump_function_header): Likewise.

        * g++.dg/cpp1y/constexpr-instantiate.C: Adjust.
        * g++.dg/tree-ssa/pr45605.C: Likewise.
        * gnat.dg/noinline2.ad: Likewise.b
        * gnat.dg/renaming6.ad: Likewise.b
        * gnat.dg/renaming6.ad: Likewise.s
        * gnat.dg/specs/noinline3.ad: Likewise.s

Index: gcc/function.c
===================================================================
--- gcc/function.c      (revision 251301)
+++ gcc/function.c      (working copy)
@@ -6259,7 +6259,7 @@ fndecl_name (tree fndecl)
 {
   if (fndecl == NULL)
     return "(nofn)";
-  return lang_hooks.decl_printable_name (fndecl, 2);
+  return lang_hooks.decl_printable_name (fndecl, 1);
 }
 
 /* Returns the name of function FN.  */
Index: gcc/print-rtl-function.c
===================================================================
--- gcc/print-rtl-function.c    (revision 251301)
+++ gcc/print-rtl-function.c    (working copy)
@@ -227,7 +227,7 @@ print_rtx_function (FILE *outfile, funct
 
   tree fdecl = fn->decl;
 
-  const char *dname = lang_hooks.decl_printable_name (fdecl, 2);
+  const char *dname = lang_hooks.decl_printable_name (fdecl, 1);
 
   fprintf (outfile, "(function \"%s\"\n", dname);
 
Index: gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C
===================================================================
--- gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C  (revision 251301)
+++ gcc/testsuite/g++.dg/cpp1y/constexpr-instantiate.C  (working copy)
@@ -17,5 +17,5 @@ bool g (int x) { return f (x); }
 template bool f<int>(int);
 
 // Verify that the defintions of both f() and g() are emitted.
-// { dg-final { scan-tree-dump-times "\nconstexpr bool f\\\(" 1 "optimized" } }
-// { dg-final { scan-tree-dump-times "\nbool g\\\(" 1 "optimized" } }
+// { dg-final { scan-tree-dump-times ";; Function f" 1 "optimized" } }
+// { dg-final { scan-tree-dump-times ";; Function g" 1 "optimized" } }
Index: gcc/testsuite/g++.dg/tree-ssa/pr45605.C
===================================================================
--- gcc/testsuite/g++.dg/tree-ssa/pr45605.C     (revision 251301)
+++ gcc/testsuite/g++.dg/tree-ssa/pr45605.C     (working copy)
@@ -37,4 +37,4 @@ int main() {
 
 
 /* We should devirtualize call to D::Run */
-/* { dg-final { scan-tree-dump-times "D::Run \\(" 1 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "D::Run \\(" 3 "fre1" } } */
Index: gcc/testsuite/gnat.dg/noinline2.adb
===================================================================
--- gcc/testsuite/gnat.dg/noinline2.adb (revision 251301)
+++ gcc/testsuite/gnat.dg/noinline2.adb (working copy)
@@ -18,4 +18,4 @@ package body Noinline2 is
 
 end Noinline2;
 
--- { dg-final { scan-tree-dump-times "noinline2.inner" 2 "optimized"  } }
+-- { dg-final { scan-tree-dump-times "noinline2.inner" 4 "optimized"  } }
Index: gcc/testsuite/gnat.dg/renaming6.adb
===================================================================
--- gcc/testsuite/gnat.dg/renaming6.adb (revision 251301)
+++ gcc/testsuite/gnat.dg/renaming6.adb (working copy)
@@ -15,16 +15,16 @@ package body Renaming6 is
 
   function Get_J return Integer is
   begin
-    return J;
+    return X;
   end;
 
   procedure Set_J (Val : Integer) is
   begin
-    J := Val;
+    X := Val;
   end;
 
 end Renaming6;
 
 -- { dg-final { scan-tree-dump-times "atomic_load" 2 "original" } }
 -- { dg-final { scan-tree-dump-times "atomic_store" 2 "original" } }
--- { dg-final { scan-tree-dump-not "j" "original" } }
+-- { dg-final { scan-tree-dump-not "x" "original" } }
Index: gcc/testsuite/gnat.dg/renaming6.ads
===================================================================
--- gcc/testsuite/gnat.dg/renaming6.ads (revision 251301)
+++ gcc/testsuite/gnat.dg/renaming6.ads (working copy)
@@ -6,7 +6,7 @@ package Renaming6 is
   function Get_I return Integer;
   procedure Set_I (Val : Integer);
 
-  J : Integer renames I;
+  X : Integer renames I;
 
   function Get_J return Integer;
   procedure Set_J (Val : Integer);
Index: gcc/testsuite/gnat.dg/specs/noinline3.ads
===================================================================
--- gcc/testsuite/gnat.dg/specs/noinline3.ads   (revision 251301)
+++ gcc/testsuite/gnat.dg/specs/noinline3.ads   (working copy)
@@ -5,4 +5,4 @@ with Noinline3_Pkg;
 
 package Noinline3 is new Noinline3_Pkg (0);
 
--- { dg-final { scan-tree-dump-times "noinline3.inner" 2 "optimized"  } }
+-- { dg-final { scan-tree-dump-times "noinline3.inner" 4 "optimized"  } }
Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c     (revision 251301)
+++ gcc/tree-pretty-print.c     (working copy)
@@ -4047,7 +4047,7 @@ dump_function_header (FILE *dump_file, t
   struct cgraph_node *node = cgraph_node::get (fdecl);
   struct function *fun = DECL_STRUCT_FUNCTION (fdecl);
 
-  dname = lang_hooks.decl_printable_name (fdecl, 2);
+  dname = lang_hooks.decl_printable_name (fdecl, 1);
 
   if (DECL_ASSEMBLER_NAME_SET_P (fdecl))
     aname = (IDENTIFIER_POINTER

Reply via email to